FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > > Class Template Reference

Container class for information needed for each variable. More...

Public Member Functions

 VariableInfo (String variableID, Val[] domain, String[] neighbours, DCOPProblemInterface< Val, U > problem, DSA< Val, U > listener)
 Constructor.
VarAssignment< Val, U > bestAssignment ()
 Method used to determine the best assignment to the variable given the current context.
boolean setCurrentValue (VarAssignment< Val, U > ass)
 Sets the current value to the value in ass.
boolean setContext (VALUEmsg< Val > msg)
 Method to update the context of this variable.
void resetReportedNeighbours ()
 Resets the reported neighbours counter.
void processPendingMessages ()
 Method to process the already received, but not yet processed messages.
Val getCurrentValue ()
 Getter method.
String toString ()

Protected Member Functions

AddableConflicts< U > calculateUtility ()
 Given the current context and variable assignment, this method calculates the utility for the local problem.

Protected Attributes

String variableID
 The variable's ID.
Map< String, Val > context
 The values of its neighbours, i.e.
String[] neighbours
 The ID's of its neighbours.
HashMap< String, Integer > neighbourPointers
 A map that maps neighbours to positions in an array.
int numberOfNeighbours
 The number of neighbours this variable has.
Val currentValue
 Its current value.
currentUtility
 Its current utility.
Set< String > reportedNeighbours
 The set of neighbours that have reported a value.
zero
 the zero utility
final boolean maximize
 true when the problem is a maximization problem and false otherwise
int cycleCounter
 Contains the current cycle the variable is in.
HashMap< String, LinkedList< VALUEmsg< Val > > > pendingMessages
 Received messages that one cannot yet process.
HashMap< String, VALUEmsg< Val > > lastSentMsgs = new HashMap< String, VALUEmsg<Val> > ()
 For each neighbor of this variable, the last message sent to it.
DSA< Val, U > listener
 pointer to the listener that owns this object

Private Attributes

Val[] domain
 The variable's domain.
int domainSize
 The size of the domain.
List< ? extends UtilitySolutionSpace< Val, U > > spaces
 The variable's local problem.
infeasibleUtil
 The utility value used for infeasible solutions.

Detailed Description

Container class for information needed for each variable.

Author
Brammert Ottens, 10 aug 2009
Parameters
<Val>type used for variable values
<U>type used for utility values

Constructor & Destructor Documentation

◆ VariableInfo()

frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo ( String variableID,
Val[] domain,
String[] neighbours,
DCOPProblemInterface< Val, U > problem,
DSA< Val, U > listener )

Member Function Documentation

◆ bestAssignment()

◆ calculateUtility()

AddableConflicts< U > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.calculateUtility ( )
protected

Given the current context and variable assignment, this method calculates the utility for the local problem.

Author
Brammert Ottens, 19 aug 2009
Returns
the current local utility

References frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.addDelayed(), calculateUtility(), context, frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.resolve(), spaces, and zero.

Referenced by bestAssignment(), calculateUtility(), and setContext().

Here is the call graph for this function:

◆ getCurrentValue()

Val frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.getCurrentValue ( )

Getter method.

Author
Brammert Ottens, 12 aug 2009
Returns
the current value of this variable

References currentValue.

◆ processPendingMessages()

void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.processPendingMessages ( )

Method to process the already received, but not yet processed messages.

There should be at most one message per neighbour

Author
Brammert Ottens, 19 aug 2009

References listener, and pendingMessages.

◆ resetReportedNeighbours()

void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.resetReportedNeighbours ( )

Resets the reported neighbours counter.

Author
Brammert Ottens, 14 aug 2009

References reportedNeighbours.

◆ setContext()

boolean frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.setContext ( VALUEmsg< Val > msg)

Method to update the context of this variable.

Author
Brammert Ottens, 10 aug 2009
Parameters
msgthe message that needs to be processed
Returns
true when all neighbours have reported their states

References calculateUtility(), context, currentUtility, frodo2.algorithms.localSearch.dsa.VALUEmsg< Val extends Addable< Val > >.getSender(), frodo2.algorithms.localSearch.dsa.VALUEmsg< Val extends Addable< Val > >.getValue(), numberOfNeighbours, pendingMessages, and reportedNeighbours.

Here is the call graph for this function:

◆ setCurrentValue()

◆ toString()

String frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.toString ( )
See also
java.lang.Object#toString()

Member Data Documentation

◆ context

Map<String, Val> frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.context
protected

The values of its neighbours, i.e.

its context. For efficiency reasons there should also be an entry for this variable.

Referenced by bestAssignment(), calculateUtility(), setContext(), setCurrentValue(), and VariableInfo().

◆ currentUtility

◆ currentValue

◆ cycleCounter

int frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.cycleCounter
protected

◆ domain

Val [] frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.domain
private

The variable's domain.

Referenced by bestAssignment(), and VariableInfo().

◆ domainSize

int frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.domainSize
private

The size of the domain.

Referenced by bestAssignment(), and VariableInfo().

◆ infeasibleUtil

U frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.infeasibleUtil
private

The utility value used for infeasible solutions.

◆ lastSentMsgs

HashMap< String, VALUEmsg<Val> > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.lastSentMsgs = new HashMap< String, VALUEmsg<Val> > ()
protected

For each neighbor of this variable, the last message sent to it.

Referenced by frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.init().

◆ listener

DSA<Val, U> frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.listener
protected

pointer to the listener that owns this object

Referenced by processPendingMessages(), and VariableInfo().

◆ maximize

◆ neighbourPointers

HashMap<String, Integer> frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.neighbourPointers
protected

A map that maps neighbours to positions in an array.

Referenced by VariableInfo().

◆ neighbours

String [] frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.neighbours
protected

The ID's of its neighbours.

For efficiency reasons there should also be a slot for this variable

Referenced by VariableInfo().

◆ numberOfNeighbours

int frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.numberOfNeighbours
protected

The number of neighbours this variable has.

Referenced by setContext(), and VariableInfo().

◆ pendingMessages

HashMap<String, LinkedList<VALUEmsg<Val> > > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.pendingMessages
protected

Received messages that one cannot yet process.

Referenced by processPendingMessages(), setContext(), and VariableInfo().

◆ reportedNeighbours

Set<String> frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.reportedNeighbours
protected

The set of neighbours that have reported a value.

Referenced by resetReportedNeighbours(), setContext(), and VariableInfo().

◆ spaces

List< ? extends UtilitySolutionSpace<Val, U> > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.spaces
private

The variable's local problem.

Referenced by calculateUtility(), and VariableInfo().

◆ variableID

String frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.variableID
protected

The variable's ID.

Referenced by bestAssignment(), setCurrentValue(), and VariableInfo().

◆ zero

U frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.zero
protected

the zero utility

Referenced by calculateUtility(), and VariableInfo().


The documentation for this class was generated from the following file:
  • src/frodo2/algorithms/localSearch/dsa/DSA.java