FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > > Class Template Reference

VALUE propagation protocol. More...

Inheritance diagram for frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >:

Public Member Functions

 VALUEpropagation ()
 Default constructor.
 VALUEpropagation (DCOPProblemInterface< Val, ?> problem, Boolean swap)
 Manual constructor that does not use XML elements.
 VALUEpropagation (DCOPProblemInterface< Val, ?> problem, Element parameters)
 Constructor from XML elements.
void reset ()
 Resets the state, only keeping the problem.
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
 The algorithm.
void setQueue (Queue queue)
Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T >
default void notifyIn (Message msg, Object toAgent)
 Notifies the listener of an incoming message.

Static Public Attributes

static MessageType START_MSG_TYPE = AgentInterface.START_AGENT
 The type of the message telling the module to start.
static MessageType FINISH_MSG_TYPE = AgentInterface.AGENT_FINISHED
 The type of the message telling the agent finished.
static MessageType DFS_MSG_TYPE = DFSgeneration.OUTPUT_MSG_TYPE
 The type of the messages containing information about the DFS.
static MessageType UTIL_MSG_TYPE = UTILpropagation.OUTPUT_MSG_TYPE
 The type of the messages containing optimal conditional assignments.
static MessageType SEPARATOR_MSG_TYPE = UTILpropagation.SEPARATOR_MSG_TYPE
 The type of the messages containing information about separators.
static final MessageType VALUE_MSG_TYPE = new MessageType ("DPOP", "VALUEpropagation", "VALUE")
 The type of the VALUE messages.

Protected Member Functions

void init ()
 Parses the problem.

Protected Attributes

Queue queue
 The queue on which it should call sendMessage().
DCOPProblemInterface< Val, ?> problem
 The problem.
boolean started = false
 Whether the execution of the algorithm has started.
HashMap< String, String[]> separators
 For each variable, its separator.
HashMap< String, List< String > > allChildren
 For each variable, the list of its children.
HashMap< String, SolutionMessage< Val > > condAssignments
 For each variable, its optimal assignment conditioned on the assignments to its separator.
int nbrVarsDone = 0
 The number of variables owned by this agents that have already sent VALUE messages to all their children.

Private Member Functions

void sendVALUEmessage (String child, String[] separator, HashMap< String, Val > optVals, VALUEmsg< Val > valueMsg)
 Instantiates a VALUE message and sends it.
void computeOptValAndSendVALUEmsgs (String[] vars, BasicUtilitySolutionSpace< Val, ArrayList< Val > > optAssignments, VALUEmsg< Val > valueMsg)
 Compute the optimal assignments to some variables, and sends VALUE messages to children accordingly.

Private Attributes

HashMap< String, VALUEmsg< Val > > valueMessages
 For each variable, the VALUE message received containing its separator's optimal assignments.
HashMap< String, String > allParents
 The parent for each of my variables.
HashMap< String, String > condAssignmentsFiles
 For each variable, the file containing its optimal assignment conditioned on the assignments to its separator.
HashMap< String, Val > solution
 For each variable, its optimal value.
final boolean swap
 If true, conditional optimal assignments are swapped until the VALUE message is received.
HashMap< String, Integer > clusterSizes = new HashMap<String, Integer> ()
 How many variables there are in each cluster, identified by its root.
HashMap< String, String > owners = new HashMap<String, String> ()
 For each child variable, its corresponding agent.

Detailed Description

VALUE propagation protocol.

Author
Thomas Leaute
Parameters
<Val>type used for variable values
Todo
Improve the implementation by reasoning on groups of variables to be projected together.

Constructor & Destructor Documentation

◆ VALUEpropagation() [1/3]

Default constructor.

◆ VALUEpropagation() [2/3]

frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.VALUEpropagation ( DCOPProblemInterface< Val, ?> problem,
Boolean swap )

Manual constructor that does not use XML elements.

Parameters
problemthe problem
swapif true, conditional optimal assignments are swapped until the VALUE message is received

References problem, and swap.

◆ VALUEpropagation() [3/3]

frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.VALUEpropagation ( DCOPProblemInterface< Val, ?> problem,
Element parameters )

Constructor from XML elements.

Parameters
problemdescription of the problem
parametersthe parameters of the module

References problem.

Member Function Documentation

◆ computeOptValAndSendVALUEmsgs()

void frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.computeOptValAndSendVALUEmsgs ( String[] vars,
BasicUtilitySolutionSpace< Val, ArrayList< Val > > optAssignments,
VALUEmsg< Val > valueMsg )
private

Compute the optimal assignments to some variables, and sends VALUE messages to children accordingly.

Parameters
varsthe variables to be optimized
optAssignmentsthe conditional optimal assignments to the variables
valueMsgthe VALUE message received for the variables

References allChildren, FINISH_MSG_TYPE, frodo2.algorithms.dpop.VALUEmsg< Val extends Addable< Val > >.getDest(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getNbrIntVars(), frodo2.algorithms.dpop.VALUEmsg< Val extends Addable< Val > >.getValues(), frodo2.algorithms.dpop.VALUEmsg< Val extends Addable< Val > >.getVariables(), queue, frodo2.communication.Queue.sendMessageToSelf(), sendVALUEmessage(), separators, solution, and frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR.

Referenced by notifyIn().

Here is the call graph for this function:

◆ getMsgTypes()

◆ init()

void frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.init ( )
protected

◆ notifyIn()

void frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.notifyIn ( Message msg)

The algorithm.

See also
IncomingMsgPolicyInterface.notifyIn(Message)
Todo
Swap the optimal assignments BEFORE sending up the UTIL message, and on the fly.

Implements frodo2.communication.IncomingMsgPolicyInterface< T >.

Reimplemented in frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.

References computeOptValAndSendVALUEmsgs(), condAssignments, frodo2.communication.MessageType.equals(), FINISH_MSG_TYPE, init(), notifyIn(), UTIL_MSG_TYPE, and valueMessages.

Referenced by notifyIn().

Here is the call graph for this function:

◆ reset()

void frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.reset ( )

Resets the state, only keeping the problem.

Reimplemented in frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.

◆ sendVALUEmessage()

void frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.sendVALUEmessage ( String child,
String[] separator,
HashMap< String, Val > optVals,
VALUEmsg< Val > valueMsg )
private

Instantiates a VALUE message and sends it.

Parameters
childdestination variable of the message
separatorvariables to be mentioned in the message
optValsthe optimal values for some variables
valueMsgVALUE message received from parent

References queue, and sendVALUEmessage().

Referenced by computeOptValAndSendVALUEmsgs(), and sendVALUEmessage().

Here is the call graph for this function:

◆ setQueue()

Member Data Documentation

◆ allChildren

HashMap< String, List<String> > frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.allChildren
protected

◆ allParents

HashMap<String, String> frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.allParents
private

The parent for each of my variables.

◆ clusterSizes

HashMap<String, Integer> frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.clusterSizes = new HashMap<String, Integer> ()
private

How many variables there are in each cluster, identified by its root.

◆ condAssignments

HashMap< String, SolutionMessage<Val> > frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.condAssignments
protected

For each variable, its optimal assignment conditioned on the assignments to its separator.

Referenced by frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.notifyIn(), and notifyIn().

◆ condAssignmentsFiles

HashMap<String, String> frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.condAssignmentsFiles
private

For each variable, the file containing its optimal assignment conditioned on the assignments to its separator.

◆ DFS_MSG_TYPE

The type of the messages containing information about the DFS.

Referenced by getMsgTypes().

◆ FINISH_MSG_TYPE

The type of the message telling the agent finished.

Referenced by computeOptValAndSendVALUEmsgs(), getMsgTypes(), and notifyIn().

◆ nbrVarsDone

int frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.nbrVarsDone = 0
protected

The number of variables owned by this agents that have already sent VALUE messages to all their children.

◆ owners

HashMap<String, String> frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.owners = new HashMap<String, String> ()
private

For each child variable, its corresponding agent.

◆ problem

◆ queue

◆ SEPARATOR_MSG_TYPE

MessageType frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.SEPARATOR_MSG_TYPE = UTILpropagation.SEPARATOR_MSG_TYPE
static

The type of the messages containing information about separators.

Referenced by getMsgTypes().

◆ separators

HashMap<String, String[]> frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.separators
protected

◆ solution

HashMap<String, Val> frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.solution
private

For each variable, its optimal value.

Referenced by computeOptValAndSendVALUEmsgs().

◆ START_MSG_TYPE

The type of the message telling the module to start.

Referenced by frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.getMsgTypes(), and getMsgTypes().

◆ started

boolean frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.started = false
protected

Whether the execution of the algorithm has started.

Referenced by frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.notifyIn().

◆ swap

final boolean frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.swap
private

If true, conditional optimal assignments are swapped until the VALUE message is received.

Referenced by frodo2.algorithms.dpop.param.ParamVALUE< Val extends Addable< Val > >.ParamVALUE(), and VALUEpropagation().

◆ UTIL_MSG_TYPE

The type of the messages containing optimal conditional assignments.

Referenced by getMsgTypes(), and notifyIn().

◆ VALUE_MSG_TYPE

◆ valueMessages

HashMap< String, VALUEmsg<Val> > frodo2.algorithms.dpop.VALUEpropagation< Val extends Addable< Val > >.valueMessages
private

For each variable, the VALUE message received containing its separator's optimal assignments.

Referenced by notifyIn().


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