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

Convenience class that contains all necessary information on a single variable. More...

Public Member Functions

 VariableInfo (String variableID, DCOPProblemInterface< V, U > problem, List<? extends UtilitySolutionSpace< V, U > > spaces, boolean maximize)
 Constructor.
void setNeighborValue (String neighbor, V value)
 Stores the value reported by a neighbor.
void calculateCurrentUtility ()
 Given the current agent view, calculate the current utility.
void determinePossibleImprovement ()
 Given the current context (agent_view), this method determines the maximal improvement that can be made.
boolean processOK (OK< V > msg)
 Method to process an OK message.
boolean processStoredIMPROVEMessages ()
 Process already received IMPROVE messages.
boolean processIMPROVE (IMPROVE< U > msg)
 Method to process an IMPROVE message.
boolean processStoredOKMessages ()
 Process already received OK messages.
void reset ()
 reset the agent view
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 name of the variable.
final boolean maximize
 true when maximizing, and false when minimizing
StateValue state
 The current state of the variable.
V[] domain
 The domain of the variable.
List< UtilitySolutionSpace< V, U > > spaces
 The variable's local problem.
currentValue
 The variable's current value.
int currentValueIndex
 The index of the current value.
int newValue
 The possible new value of this variable, given the context.
boolean can_move
 true when this variable is allowed to change value, and false otherwise
int counter
 Counts the number of received messages.
int number_of_neighbors
 The number of neighboring variables.
AddableConflicts< U > currentUtility
 The current utility, give the current context.
AddableConflicts< U > improve
 The value with which this variable can improve its utility, given the context.
AddableConflicts< U > infeasibleUtility
 The utility value used for an infeasible utility.
AddableConflicts< U > zeroConflicts
 The utility value used to denote zero with zero conflicts.
zeroUtility
 The utility value used to denote zero.
HashMap< String, Integer > neighborPointer
 gives the position of a neighboring variable in the array
String[] neighbors
 List of neighbors.
V[] agent_view
 The current context.
int termination_counter
 Used to determine when to terminate.
List< OK< V > > okMsgsToProcess
 List of OK messages to process.
List< IMPROVE< U > > improveMsgsToProcess
 List of IMPROVE messages to process.
boolean terminated
 true when this variable has terminated

Detailed Description

Convenience class that contains all necessary information on a single variable.

Parameters
<V>type used for domain values
<U>type used for utility values

Constructor & Destructor Documentation

◆ VariableInfo()

frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.VariableInfo ( String variableID,
DCOPProblemInterface< V, U > problem,
List<? extends UtilitySolutionSpace< V, U > > spaces,
boolean maximize )

Constructor.

Parameters
variableIDthe ID of the variable
problemthe local problem definition
spaceslist of all spaces owned by the agent
maximizetrue when the problem is a maximization problem, and false otherwise

References domain, improveMsgsToProcess, maximize, okMsgsToProcess, frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.problem, spaces, variableID, and VariableInfo().

Referenced by VariableInfo().

Here is the call graph for this function:

Member Function Documentation

◆ calculateCurrentUtility()

void frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateCurrentUtility ( )

Given the current agent view, calculate the current utility.

Author
Brammert Ottens, 1 apr. 2011

References frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.addDelayed(), currentUtility, frodo2.solutionSpaces.AddableConflicts< U extends Addable< U > >.getUtility(), frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.resolve(), spaces, and zeroUtility.

Referenced by processOK().

Here is the call graph for this function:

◆ calculateUtility()

AddableConflicts< U > frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, 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(), frodo2.solutionSpaces.AddableConflicts< U extends Addable< U > >.getUtility(), frodo2.solutionSpaces.AddableDelayed< T extends Addable< T > >.resolve(), spaces, and zeroUtility.

Referenced by determinePossibleImprovement().

Here is the call graph for this function:

◆ determinePossibleImprovement()

void frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.determinePossibleImprovement ( )

Given the current context (agent_view), this method determines the maximal improvement that can be made.

Author
Brammert Ottens, 21 feb. 2011

References agent_view, calculateUtility(), can_move, currentUtility, domain, improve, maximize, and zeroConflicts.

Referenced by frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.sendIMPROVE().

Here is the call graph for this function:

◆ processIMPROVE()

◆ processOK()

boolean frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.processOK ( OK< V > msg)

◆ processStoredIMPROVEMessages()

boolean frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.processStoredIMPROVEMessages ( )

Process already received IMPROVE messages.

Author
Brammert Ottens, 18 apr. 2011
Returns
true when switched to OK state

References improveMsgsToProcess, and processIMPROVE().

Here is the call graph for this function:

◆ processStoredOKMessages()

boolean frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.processStoredOKMessages ( )

Process already received OK messages.

Author
Brammert Ottens, 18 apr. 2011
Returns
true when switched to IMPROVE state

References okMsgsToProcess, and processOK().

Here is the call graph for this function:

◆ reset()

void frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.reset ( )

reset the agent view

Author
Brammert Ottens, 18 apr. 2011

References agent_view, and currentValue.

◆ setNeighborValue()

void frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.setNeighborValue ( String neighbor,
V value )

Stores the value reported by a neighbor.

Author
Brammert Ottens, 21 feb. 2011
Parameters
neighborthe neighbor that reported the value
valuethe reported value

References agent_view, and neighborPointer.

Referenced by processOK().

◆ toString()

String frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.toString ( )
See also
java.lang.Object#toString()

References agent_view, and neighbors.

Member Data Documentation

◆ agent_view

◆ can_move

boolean frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.can_move
protected

true when this variable is allowed to change value, and false otherwise

Referenced by determinePossibleImprovement(), processIMPROVE(), and frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.sendOK().

◆ counter

int frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.counter
protected

Counts the number of received messages.

Referenced by processIMPROVE(), and processOK().

◆ currentUtility

AddableConflicts<U> frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.currentUtility
protected

The current utility, give the current context.

Referenced by calculateCurrentUtility(), and determinePossibleImprovement().

◆ currentValue

◆ currentValueIndex

int frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.currentValueIndex
protected

The index of the current value.

◆ domain

V [] frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.domain
protected

◆ improve

AddableConflicts<U> frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.improve
protected

The value with which this variable can improve its utility, given the context.

Referenced by determinePossibleImprovement(), processIMPROVE(), and frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.sendIMPROVE().

◆ improveMsgsToProcess

List<IMPROVE<U> > frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.improveMsgsToProcess
protected

List of IMPROVE messages to process.

Referenced by processStoredIMPROVEMessages(), and VariableInfo().

◆ infeasibleUtility

AddableConflicts<U> frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.infeasibleUtility
protected

The utility value used for an infeasible utility.

◆ maximize

final boolean frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.maximize
protected

true when maximizing, and false when minimizing

Referenced by determinePossibleImprovement(), processIMPROVE(), and VariableInfo().

◆ neighborPointer

HashMap<String, Integer> frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.neighborPointer
protected

gives the position of a neighboring variable in the array

Referenced by setNeighborValue().

◆ neighbors

◆ newValue

int frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.newValue
protected

The possible new value of this variable, given the context.

Referenced by frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.sendOK().

◆ number_of_neighbors

int frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.number_of_neighbors
protected

The number of neighboring variables.

Referenced by processIMPROVE(), and processOK().

◆ okMsgsToProcess

List<OK<V> > frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.okMsgsToProcess
protected

List of OK messages to process.

Referenced by processStoredOKMessages(), and VariableInfo().

◆ spaces

List<UtilitySolutionSpace<V, U> > frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.spaces
protected

The variable's local problem.

Referenced by calculateCurrentUtility(), calculateUtility(), and VariableInfo().

◆ state

StateValue frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.state
protected

The current state of the variable.

Referenced by processIMPROVE(), and processOK().

◆ terminated

boolean frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.terminated
protected

true when this variable has terminated

Referenced by processIMPROVE(), and processOK().

◆ termination_counter

int frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.termination_counter
protected

◆ variableID

◆ zeroConflicts

AddableConflicts<U> frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.zeroConflicts
protected

The utility value used to denote zero with zero conflicts.

Referenced by determinePossibleImprovement().

◆ zeroUtility

U frodo2.algorithms.localSearch.mgm.MGM< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.zeroUtility
protected

The utility value used to denote zero.

Referenced by calculateCurrentUtility(), and calculateUtility().


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