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

A convenience class that contains the following information for a variable. More...

Public Member Functions

 VariableInfo (boolean root, String variableID, String parent, String[] children, String[] pseudo_children, List< String > pseudo_parents, int numberOfPseudoParents, GoodsTree< Val, U, LeafNode< U > > tree)
 A constructor.
Good< Val, U > getAmax ()
 Method to return the next good to send.
Val getRandomValue ()
void setCurrentContext (HashMap< String, Val > context, boolean isConfirmed)
 Set the current context.
void updateCurrentContext (String variable, Val value)
 Updates the value of variable in the current context.
void setNewVariable (boolean newVariable)
 Setter method for newVariable.
boolean getNewVariable ()
ASKmsg getAskMessage (int child)
ASKmsg getAskMessage (String child)
ACKmsg getAckMessage (int child)
boolean valuesAreConsistent (Val[] values, String child)
 Checks whether the number of values in values is consistent with the reported separator size of the child.
String toString ()
 Method to print out state of the variable.

Public Attributes

boolean root
 Denotes whether the variable is the root or not.
boolean isDone
 Stores whether this variable already send a DONE message.
boolean terminated
 When the optimal assignment is known, this variable is set to true.
String variableID
 The variables ID.
String parent
 The parents ID.
String[] children
 The children's IDs.
String[] pseudo_children
 The pseudo children of this variable.
HashSet< String > pseudo_parents
 A list of pseudo parents.
HashMap< String, Integer > childrenPointer
 Maps a child's ID to an integer.
int numberOfChildren
 The number of children this variable has.
boolean infeasible
 true when the remain part of the local problem has become infeasible
GoodsTree< Val, U, LeafNode< U > > tree
 This data structure contains all the information for this variable.
boolean[] done
 For each child it stores whether it is done or not.
Good< Val, U > lastSent
 The last good that has been sent.
boolean notResponded
 True if the agent has not yet responded to an ASK message.
HashMap< String, Val > currentContextMap
 The currentContextMap.
LinkedList< MessagegoodsToSend
 list of goods that are still to be send

Private Attributes

ASKmsg[] askMessages
 A list of precreated ask messages, one for each child.
ACKmsg[] ackMessages
 A list of precreated ack messages, one for each child.
boolean newVariable
 true when this variable must report a new variable in his separator to his parent
boolean acknowledged = true
 true when the last utility message with variable info has been acknowledge, and false otherwise.

Detailed Description

A convenience class that contains the following information for a variable.

  • information on this variables separator
  • a list of assignments
    Author
    brammert

Constructor & Destructor Documentation

◆ VariableInfo()

frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.VariableInfo ( boolean root,
String variableID,
String parent,
String[] children,
String[] pseudo_children,
List< String > pseudo_parents,
int numberOfPseudoParents,
GoodsTree< Val, U, LeafNode< U > > tree )

A constructor.

Parameters
roottrue when this variable is a root
variableIDThe ID of this variable
parentThe parent of this variable
childrenThe children of this variable
pseudo_childrenA list of pseudo children
pseudo_parentsA list of pseudo parents
numberOfPseudoParentsthe size of the list of pseudo children
treeThe GoodsTree

References ackMessages, askMessages, children, childrenPointer, currentContextMap, done, newVariable, notResponded, numberOfChildren, parent, pseudo_children, pseudo_parents, root, tree, and variableID.

Member Function Documentation

◆ getAckMessage()

ACKmsg frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getAckMessage ( int child)
Author
Brammert Ottens, 3 sep 2009
Parameters
childchild of the variable
Returns
pre-created ACK message for child

References ackMessages.

◆ getAmax()

Good< Val, U > frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getAmax ( )

Method to return the next good to send.

Returns
aMax

References tree.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processASKMessage().

◆ getAskMessage() [1/2]

ASKmsg frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getAskMessage ( int child)
Author
Brammert Ottens, 2 sep 2009
Parameters
childchild of the variable
Returns
pre-created ASK message for child

References askMessages.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.sendASK().

◆ getAskMessage() [2/2]

ASKmsg frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getAskMessage ( String child)
Author
Brammert Ottens, 2 sep 2009
Parameters
childchild of the variable
Returns
pre-created ASK message for child

References askMessages, and childrenPointer.

◆ getNewVariable()

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getNewVariable ( )

◆ getRandomValue()

Val frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.getRandomValue ( )
Author
Brammert Ottens, 26 mei 2010
Returns
a random value from the variables domain

References tree.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processVALUEmessageParent().

◆ setCurrentContext()

void frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.setCurrentContext ( HashMap< String, Val > context,
boolean isConfirmed )

Set the current context.

Parameters
contextthe current context
isConfirmedtrue when the received VALUE message is confirmed

References currentContextMap, and pseudo_parents.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processVALUEmessageParent().

◆ setNewVariable()

void frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.setNewVariable ( boolean newVariable)

Setter method for newVariable.

Author
Brammert Ottens, 21 aug 2009
Parameters
newVariablethe value for newVariable

References newVariable.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processUTILMessage(), and frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.sendGood().

◆ toString()

◆ updateCurrentContext()

void frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.updateCurrentContext ( String variable,
Val value )

Updates the value of variable in the current context.

Parameters
variableThe variable whos value must be updated
valueThe new value of the variable

References currentContextMap.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processVALUEmessagePseudoParent().

◆ valuesAreConsistent()

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.valuesAreConsistent ( Val[] values,
String child )

Checks whether the number of values in values is consistent with the reported separator size of the child.

Author
Brammert Ottens, 2 sep 2009
Parameters
valuesthe set of values reported by the child
childthe child who reported the values
Returns
true when the reported separator is consistent with the reported values

References childrenPointer, and tree.

Member Data Documentation

◆ ackMessages

ACKmsg [] frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.ackMessages
private

A list of precreated ack messages, one for each child.

Referenced by getAckMessage(), and VariableInfo().

◆ acknowledged

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.acknowledged = true
private

true when the last utility message with variable info has been acknowledge, and false otherwise.

The acknowledgements are there to enable the algorithm to function when the order of messages is not garuanteed.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.sendGood().

◆ askMessages

ASKmsg [] frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.askMessages
private

A list of precreated ask messages, one for each child.

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

◆ children

◆ childrenPointer

◆ currentContextMap

◆ done

◆ goodsToSend

LinkedList<Message> frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.goodsToSend

◆ infeasible

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.infeasible

true when the remain part of the local problem has become infeasible

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processASKMessage().

◆ isDone

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.isDone

Stores whether this variable already send a DONE message.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processASKMessage().

◆ lastSent

Good<Val, U> frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.lastSent

The last good that has been sent.

Should be set to null after a confirmed good has been sent.

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.sendGood().

◆ newVariable

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.newVariable
private

true when this variable must report a new variable in his separator to his parent

Referenced by getNewVariable(), setNewVariable(), and VariableInfo().

◆ notResponded

◆ numberOfChildren

◆ parent

◆ pseudo_children

◆ pseudo_parents

HashSet<String> frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.pseudo_parents

A list of pseudo parents.

Referenced by setCurrentContext(), and VariableInfo().

◆ root

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.root

◆ terminated

boolean frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo.terminated

When the optimal assignment is known, this variable is set to true.

It is used to ignore messages received after termination

Referenced by frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processASKMessage(), and frodo2.algorithms.asodpop.ASODPOP< Val extends Addable< Val >, U extends Addable< U > >.processUTILMessage().

◆ tree

◆ variableID


The documentation for this class was generated from the following file: