FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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 setNewValue (V value)
AddableConflicts< U > calculateCurrentUtility ()
 Given the current agent view, the current utility is calculated.
AddableConflicts< U > calculateCurrentUtility (String variable)
 Given the current agent view, the current utility is calculated, ignoring constraints that contain the variable.
AddableConflicts< U > calculateGain (BinaryAssignment< V > assignment, String variable)
 Calculate the utility gain of the assignment.
AddableConflicts< U > calculateGain (V ownValue, V neighborValue, String variable)
 Calculate the utility gain of the assignment.
AddableConflicts< U > calculateGain (V ownValue, V neighborValue, int neighborIndex, String variable)
 Calculate the utility gain of the assignment.
OFFER< V, U > calculateOffer (int neighborIndex)
 Creates the offer to be made to the chosen neighbor.
boolean determinePossibleImprovement ()
 Given the current context (agent_view), this method determines the maximal improvement that can be made.
void reset ()
 Resets the fields.
String toString ()

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.
boolean terminated
 true when this variable has terminated
int number_of_neighbors
 The number of neighboring variables.
String[] neighbors
 List of neighbors.
V[][] neighborDomains
 The domains of not this variable and all the neighbors.
AddableConflicts< U > infeasibleUtility
 The utility value used for an infeasible utility.
AddableConflicts< U > zeroConflicts
 The utility value used to denote zero with no conflicts.
zeroUtility
 The utility value used to denote zero.
int okMsgsReceived
 Counts the number of OK messages received.
List< OK< V > > okMsgsToProcess
 List of OK messages to process.
V[] agent_view
 The current context.
List< OFFER< V, U > > offerMsgsToProcess
 List of OFFER messages to process.
int improveMsgReceived
 Counts the number of IMPROVE messages received.
List< IMPROVE< U > > improveMsgsToProcess
 List of IMPROVE messages to process.
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
AddableConflicts< U > currentUtility
 The current utiliyt, give the current context.
AddableConflicts< U > improve
 The value with which this variable can improve its utility, given the context.
int termination_counter
 Used to determine when to terminate.
Message goMsgToProcess
 Stores a GO message when the variable is not yet ready to process it.

Private Attributes

List< UtilitySolutionSpace< V, U > > spaces
 The variable's local problem.
HashMap< String, Integer > neighborPointer
 gives the position of a neighboring variable in the array
int offersReceived
 Counts the number of OFFER messages received.
BinaryAssignment< V > bestOffer
 The neighbor that made the best offer so far.
String bestOfferer
 The best offer received in the current round so far.
HashMap< BinaryAssignment< V >, AddableConflicts< U > > submittedOffers
 Maps submitted offer to private gain.
boolean offer
 When true this variable is offering, otherwise it is receiving.
HashSet< String > offeringVariables
 The neighboring variables that have submitted an offer.
boolean committed
 true if at least one offer has been accepted, false otherwise

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.mgm2.MGM2< 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 currentValueIndex, improveMsgsToProcess, infeasibleUtility, maximize, offeringVariables, offerMsgsToProcess, frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.StateValue.OK, okMsgsToProcess, frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.problem, spaces, submittedOffers, variableID, VariableInfo(), and zeroUtility.

Referenced by VariableInfo().

Here is the call graph for this function:

Member Function Documentation

◆ calculateCurrentUtility() [1/2]

AddableConflicts< U > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateCurrentUtility ( )

◆ calculateCurrentUtility() [2/2]

AddableConflicts< U > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateCurrentUtility ( String variable)

Given the current agent view, the current utility is calculated, ignoring constraints that contain the variable.

Author
Brammert Ottens, 6 apr. 2011
Parameters
variablethe variable that needs to be ignored
Returns
the current 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.

Here is the call graph for this function:

◆ calculateGain() [1/3]

AddableConflicts< U > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateGain ( BinaryAssignment< V > assignment,
String variable )

Calculate the utility gain of the assignment.

Author
Brammert Ottens, 29 mrt. 2011
Parameters
assignmentthe assignment
variablethe offering variable
Returns
the utility gain this assignment gives (can be negative)

References calculateGain(), frodo2.algorithms.localSearch.mgm.mgm2.BinaryAssignment< Val extends Addable< Val > >.getOwnValue(), and frodo2.algorithms.localSearch.mgm.mgm2.BinaryAssignment< Val extends Addable< Val > >.neighborValue.

Referenced by calculateGain(), calculateGain(), calculateOffer(), and frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.storeOffer().

Here is the call graph for this function:

◆ calculateGain() [2/3]

AddableConflicts< U > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateGain ( V ownValue,
V neighborValue,
int neighborIndex,
String variable )

Calculate the utility gain of the assignment.

Author
Brammert Ottens, 29 mrt. 2011
Parameters
ownValuethe variables own value in the offer
neighborValuethe value of the offering variable
neighborIndexthe index of the offering variable
variablethe offering variable
Returns
the utility gain this assignment gives (can be negative)

References agent_view, calculateCurrentUtility(), currentUtility, currentValue, infeasibleUtility, and frodo2.solutionSpaces.AddableConflicts< U extends Addable< U > >.subtract().

Here is the call graph for this function:

◆ calculateGain() [3/3]

AddableConflicts< U > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateGain ( V ownValue,
V neighborValue,
String variable )

Calculate the utility gain of the assignment.

Author
Brammert Ottens, 29 mrt. 2011
Parameters
ownValuethe variables own value in the offer
neighborValuethe value of the offering variable
variablethe offering variable
Returns
the utility gain this assignment gives (can be negative)

References calculateGain().

Here is the call graph for this function:

◆ calculateOffer()

OFFER< V, U > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.calculateOffer ( int neighborIndex)

Creates the offer to be made to the chosen neighbor.

Author
Brammert Ottens, 1 apr. 2011
Parameters
neighborIndexthe index of the chosen neighbor
Returns
the offer to be made

References calculateGain(), frodo2.solutionSpaces.AddableConflicts< U extends Addable< U > >.compareTo(), maximize, neighborDomains, neighbors, offer, submittedOffers, and zeroConflicts.

Referenced by frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.processOK().

Here is the call graph for this function:

◆ determinePossibleImprovement()

boolean frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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
Returns
true when the maximal improvement is positive, and false otherwise

References agent_view, calculateCurrentUtility(), currentUtility, currentValue, improve, maximize, neighborDomains, and zeroConflicts.

Referenced by frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.processOFFER().

Here is the call graph for this function:

◆ reset()

◆ setNeighborValue()

void frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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 frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.processOK().

◆ setNewValue()

void frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.setNewValue ( V value)
Author
Brammert Ottens, 20 mei 2011
Parameters
valuethe new value for the variable

References newValue.

Referenced by frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.processOFFER().

◆ toString()

String frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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

◆ bestOffer

BinaryAssignment<V> frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.bestOffer
private

◆ bestOfferer

◆ can_move

◆ committed

◆ currentUtility

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

The current utiliyt, give the current context.

Referenced by calculateGain(), and determinePossibleImprovement().

◆ currentValue

◆ currentValueIndex

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

◆ goMsgToProcess

Message frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.goMsgToProcess
protected

Stores a GO message when the variable is not yet ready to process it.

Referenced by frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.processIMPROVE().

◆ improve

◆ improveMsgReceived

◆ improveMsgsToProcess

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

◆ infeasibleUtility

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

◆ maximize

final boolean frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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 calculateOffer(), determinePossibleImprovement(), and VariableInfo().

◆ neighborDomains

V [][] frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.neighborDomains
protected

◆ neighborPointer

HashMap<String, Integer> frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.neighborPointer
private

gives the position of a neighboring variable in the array

Referenced by setNeighborValue().

◆ neighbors

◆ newValue

int frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.sendOK(), and setNewValue().

◆ number_of_neighbors

◆ offer

◆ offeringVariables

◆ offerMsgsToProcess

List<OFFER<V, U> > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.offerMsgsToProcess
protected

◆ offersReceived

◆ okMsgsReceived

int frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.okMsgsReceived
protected

◆ okMsgsToProcess

◆ spaces

List<UtilitySolutionSpace<V, U> > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.spaces
private

The variable's local problem.

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

◆ state

◆ submittedOffers

HashMap<BinaryAssignment<V>, AddableConflicts<U> > frodo2.algorithms.localSearch.mgm.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.submittedOffers
private

Maps submitted offer to private gain.

Referenced by calculateOffer(), and VariableInfo().

◆ terminated

◆ termination_counter

int frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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.mgm2.MGM2< V extends Addable< V >, U extends Addable< U > >.VariableInfo< V extends Addable< V >, U extends Addable< U > >.zeroConflicts
protected

◆ zeroUtility

U frodo2.algorithms.localSearch.mgm.mgm2.MGM2< 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(), calculateCurrentUtility(), and VariableInfo().


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