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

A DFS generation protocol with a heuristic for E[DPOP]. More...

Inheritance diagram for frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >:

Classes

class  VarElectionHeuristic
 Heuristic used for variable election. More...

Public Member Functions

 LocalRandVarsDFS ()
 Default constructor.
 LocalRandVarsDFS (Element params)
 Constructor for the UniqueIDfactory.
 LocalRandVarsDFS (DCOPProblemInterface< V, U > problem, Element parameters) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
 LocalRandVarsDFS (Element parameters, DCOPProblemInterface< V, U > problem)
 The constructor called in "statistics gatherer" mode.
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
Public Member Functions inherited from frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >
 DFSgeneration ()
 Default constructor.
HashMap< String, DFSview< V, U > > getDFS ()
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
 The algorithm.
void setQueue (Queue queue)
void getStatsFromQueue (Queue queue)
void setSilent (boolean silent)
String dfsToString ()
void reset ()
long getFinalTime ()
 Returns the time at which the DFS phase has finished, determined by looking at the timestamp of the stat messages.

Static Public Attributes

static final MessageType RAND_VARS_MSG_TYPE = new MessageType ("VarOrdering", "LocalRandVarsDFS", "RandVars")
 The type of messages containing random variables.
Static Public Attributes inherited from frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >
static MessageType FINISH_MSG_TYPE
 The type of the message telling the agent finished.
static MessageType START_MSG_TYPE
 The type of the message telling the module to start.
static MessageType ROOT_VAR_MSG_TYPE
 The type of the messages telling whether a given variable is a root.
static final MessageType CHILD_MSG_TYPE
 The type of the message used to tell the recipient that it is a child of the sender.
static MessageType PSEUDO_MSG_TYPE
 The type of the message used to tell the recipient that it is a pseudo-child of the sender.
static MessageType OUTPUT_MSG_TYPE
 The type of the output messages.
static final MessageType STATS_MSG_TYPE
 The type of the messages containing statistics.

Protected Member Functions

void init ()
boolean sendDownCHILDtoken (Serializable rootID, String var, Collection< String > openList, DFSview< V, U > myDFSview, Message msg)
Protected Member Functions inherited from frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >
MessageType getRootVarMsgType ()
MessageType getChildMsgType ()
MessageType getPseudoMsgType ()
MessageType getOutputMsgType ()
void init ()
 Parses the problem.
void processAdditionalMsgInformation (Message msg, String var, DFSview< V, U > dfsView)
 allows to process information included in messages which extend CHILDmsg
CHILDmsg makeChildToken (Serializable rootID, String var, String dest, Collection< String > openNeighbors)
 makes the ChildToken Message with all the information required by the module
void sendAdditionalDFSoutput (Serializable rootID, String myVar)
 Use this method to send additional output from DFS generation.
boolean sendDownCHILDtoken (Serializable rootID, String var, Collection< String > openList, DFSview< V, U > myDFSview, Message msg)
 Attempts to choose the next child and sends it a CHILD token.

Private Member Functions

String popNextChild (String var, DFSview< V, U > dfsView, Collection< String > openNeighbors)
 Chooses the child with the most similar set of new neighboring random variables to that of the input variable.

Private Attributes

Map< String, Set< String > > randNeighborhoods
 For each of this agent's variables, its set of neighbor random variables.
Map< String, Set< String > > neighborAgents
 For each variable owned by this agent, the set of agents that own a variable connected to this variable.

Additional Inherited Members

Protected Attributes inherited from frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >
Queue queue
 The queue on which it should call sendMessage().
boolean started
 Whether the execution of the algorithm has started.
Map< String, Collection< String > > openNeighbors
 For each variable that this agent owns, a collection of open neighbor variables.
HashMap< String, DFSview< V, U > > dfsViews
 For every variable this agent owns, its view of the DFS.
Map< String, String > owners
 For each known variable, the name of the agent that owns it.
int totalNbrVars
 The total number of variables in the problem (used only in "statistics gatherer" mode).
NextChildChoiceHeuristic heuristic
 The heuristic used to choose a variable's next child from its list of open neighbors.
DCOPProblemInterface< V, U > problem
 The problem.
HashMap< Serializable, LinkedList< String > > partialPaths
 For each component, the current partial constraint graph traversal path.

Detailed Description

A DFS generation protocol with a heuristic for E[DPOP].

The heuristic attempts to avoid putting, on the path between a variable linked to random variable r and lca(r), a variable that is not linked to r. It is also a Variable Election heuristic, electing the variable with fewest neighboring random variables.

Author
Thomas Leaute
Todo
When lca(r) can be a variable that is not linked to r, the implementation should be improved by taking advantage of the random variables in backtracking CHILD tokens received from children.
Parameters
<V>the type used for variable values
<U>the type used for utility values

Constructor & Destructor Documentation

◆ LocalRandVarsDFS() [1/4]

Default constructor.

◆ LocalRandVarsDFS() [2/4]

frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.LocalRandVarsDFS ( Element params)

Constructor for the UniqueIDfactory.

Parameters
paramsunused

◆ LocalRandVarsDFS() [3/4]

frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.LocalRandVarsDFS ( DCOPProblemInterface< V, U > problem,
Element parameters ) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException
Parameters
problemthis agent's problem
parametersthe parameters for LocalRandVarsDFS
Exceptions
ClassNotFoundExceptionif the heuristic refers is of an unknown class
NoSuchMethodExceptionif the heuristic does not have a constructor that takes in one ProblemInterface
InvocationTargetExceptionif the heuristic constructor throws an exception
IllegalAccessExceptionif the heuristic constructor is not accessible
InstantiationExceptionif the heuristic class is abstract

References frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >.problem.

◆ LocalRandVarsDFS() [4/4]

frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.LocalRandVarsDFS ( Element parameters,
DCOPProblemInterface< V, U > problem )

The constructor called in "statistics gatherer" mode.

Parameters
problemthe overall problem
parametersthe description of what statistics should be reported

References frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >.problem.

Member Function Documentation

◆ getMsgTypes()

Collection< MessageType > frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.getMsgTypes ( )

◆ init()

◆ notifyIn()

◆ popNextChild()

String frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.popNextChild ( String var,
DFSview< V, U > dfsView,
Collection< String > openNeighbors )
private

Chooses the child with the most similar set of new neighboring random variables to that of the input variable.

Breaks ties using the heuristic given as a parameter to the module constructor.

Parameters
varthe variable for which we are looking for the next child
dfsViewthe current incomplete view that this variable has of its DFS neighbors
openNeighborsthe list of open neighbors for this variable
Returns
the name of the chosen next child, or null if not all messages necessary to choose have been received

References frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >.openNeighbors.

Referenced by sendDownCHILDtoken().

◆ sendDownCHILDtoken()

boolean frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.sendDownCHILDtoken ( Serializable rootID,
String var,
Collection< String > openList,
DFSview< V, U > myDFSview,
Message msg )
protected

Member Data Documentation

◆ neighborAgents

Map< String, Set<String> > frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.neighborAgents
private

For each variable owned by this agent, the set of agents that own a variable connected to this variable.

◆ RAND_VARS_MSG_TYPE

final MessageType frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.RAND_VARS_MSG_TYPE = new MessageType ("VarOrdering", "LocalRandVarsDFS", "RandVars")
static

The type of messages containing random variables.

Referenced by getMsgTypes(), notifyIn(), and frodo2.algorithms.varOrdering.dfs.RandVarsMsg.RandVarsMsg().

◆ randNeighborhoods

Map< String, Set<String> > frodo2.algorithms.varOrdering.dfs.LocalRandVarsDFS< V extends Addable< V >, U extends Addable< U > >.randNeighborhoods
private

For each of this agent's variables, its set of neighbor random variables.


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