|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
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. | |
| U | currentUtility |
| Its current utility. | |
| Set< String > | reportedNeighbours |
| The set of neighbours that have reported a value. | |
| U | 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. | |
| U | infeasibleUtil |
| The utility value used for infeasible solutions. | |
Container class for information needed for each variable.
| <Val> | type used for variable values |
| <U> | type used for utility values |
| 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 ) |
Constructor.
| variableID | The ID of the variable |
| domain | The domain of the variable |
| neighbours | The neighbouring variables |
| problem | The local problem |
| listener | The listener that owns this object |
References bestAssignment(), context, currentUtility, currentValue, domain, domainSize, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.DSA(), listener, maximize, neighbourPointers, neighbours, numberOfNeighbours, pendingMessages, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.problem, reportedNeighbours, spaces, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VarAssignment< Val extends Addable< Val >, U extends Addable< U > >.util, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VarAssignment< Val extends Addable< Val >, U extends Addable< U > >.value, variableID, and zero.

| VarAssignment< Val, U > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.bestAssignment | ( | ) |
Method used to determine the best assignment to the variable given the current context.
References calculateUtility(), frodo2.solutionSpaces.AddableConflicts< U extends Addable< U > >.compareTo(), context, currentValue, domain, domainSize, frodo2.solutionSpaces.AddableConflicts< U extends Addable< U > >.getUtility(), maximize, and variableID.
Referenced by frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.A< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.C< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.E< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), and VariableInfo().

|
protected |
Given the current context and variable assignment, this method calculates the utility for the local problem.
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().

| Val frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.getCurrentValue | ( | ) |
| 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
References listener, and pendingMessages.
| 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.
References reportedNeighbours.
| 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.
| msg | the message that needs to be processed |
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.

| boolean frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.setCurrentValue | ( | VarAssignment< Val, U > | ass | ) |
Sets the current value to the value in ass.
| ass | The new assignment |
false if the assignment does not change, and true otherwise References context, currentUtility, currentValue, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VarAssignment< Val extends Addable< Val >, U extends Addable< U > >.util, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VarAssignment< Val extends Addable< Val >, U extends Addable< U > >.value, and variableID.
Referenced by frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.A< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.C< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), and frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.E< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment().
| String frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.toString | ( | ) |
|
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().
|
protected |
Its current utility.
Referenced by frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.A< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.C< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.E< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), setContext(), setCurrentValue(), and VariableInfo().
|
protected |
Its current value.
Referenced by bestAssignment(), getCurrentValue(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.init(), setCurrentValue(), and VariableInfo().
|
protected |
Contains the current cycle the variable is in.
Referenced by frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.init().
|
private |
The variable's domain.
Referenced by bestAssignment(), and VariableInfo().
|
private |
The size of the domain.
Referenced by bestAssignment(), and VariableInfo().
|
private |
The utility value used for infeasible solutions.
|
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().
|
protected |
pointer to the listener that owns this object
Referenced by processPendingMessages(), and VariableInfo().
|
protected |
true when the problem is a maximization problem and false otherwise
Referenced by bestAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.A< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.C< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.E< Val extends Addable< Val >, U extends Addable< U > >.determineAssignment(), and VariableInfo().
|
protected |
A map that maps neighbours to positions in an array.
Referenced by VariableInfo().
|
protected |
The ID's of its neighbours.
For efficiency reasons there should also be a slot for this variable
Referenced by VariableInfo().
|
protected |
The number of neighbours this variable has.
Referenced by setContext(), and VariableInfo().
|
protected |
Received messages that one cannot yet process.
Referenced by processPendingMessages(), setContext(), and VariableInfo().
|
protected |
The set of neighbours that have reported a value.
Referenced by resetReportedNeighbours(), setContext(), and VariableInfo().
|
private |
The variable's local problem.
Referenced by calculateUtility(), and VariableInfo().
|
protected |
The variable's ID.
Referenced by bestAssignment(), setCurrentValue(), and VariableInfo().
|
protected |
the zero utility
Referenced by calculateUtility(), and VariableInfo().