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

A DFSgeneration module that also computes the order in which is variable is visited and the total number of variables in the DFS. More...

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

Classes

class  DFSorderOutputMessage
 Carries DFS order information for one variable. More...

Public Member Functions

 DFSgenerationWithOrder (DCOPProblemInterface< V, U > problem, Element parameters) throws ClassNotFoundException
 Constructor.
 DFSgenerationWithOrder (Element parameters, DCOPProblemInterface< V, U > problem)
 The constructor called in "statistics gatherer" mode.
Collection< MessageTypegetMsgTypes ()
void reset ()
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 MessageType ROOT_VAR_MSG_TYPE = LeaderElectionMaxID.OUTPUT_MSG_TYPE
 The type of the messages telling whether a given variable is a root.
static MessageType CHILD_ORDER_MSG_TYPE = new MessageType ("VarOrdering", "DFSgenerationWithOrder", "CHILDwithOrder")
 The type of the message used to tell the recipient that it is a child of the sender.
static MessageType PSEUDO_ORDER_MSG_TYPE = new MessageType ("VarOrdering", "DFSgenerationWithOrder", "PSEUDOwithOrder")
 The type of the message used to tell the recipient that it is a pseudo-child of the sender.
static MessageType OUTPUT_MSG_TYPE = new MessageType ("VarOrdering", "DFSgenerationWithOrder", "DFSoutput_DFSgenerationWithOrder")
 The type of the output messages.
static final MessageType OUTPUT_ORDER_TYPE = new MessageType ("VarOrdering", "DFSgenerationWithOrder", "DFSorderOutput")
 The type of the output messages containing the orders of variables in the DFS.
static final MessageType VARIABLE_COUNT_TYPE = new MessageType ("VarOrdering", "DFSgenerationWithOrder", "DFSorderVarNbr")
 The type of the top-down messages sent by the root containing the number of variables in the DFS.
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

MessageType getRootVarMsgType ()
MessageType getChildMsgType ()
MessageType getPseudoMsgType ()
MessageType getOutputMsgType ()
void init ()
void init (String var)
CHILDmsg makeChildToken (Serializable rootID, String var, String parent, Collection< String > openNeighbors)
void processAdditionalMsgInformation (Message msg, String myVar, DFSview< V, U > myRelationships)
void sendAdditionalDFSoutput (Serializable rootID, String myVar)
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

boolean isRoot (String var)
int orderOfNextChild (String var)

Private Attributes

Map< String, Integer > trueOrder
 Map of the true final order of this agent's variables.
Map< String, Integer > declaredOrder
 Map of the declared final order of this agent's variables.
Map< String, Integer > order_process
 Map of the last order received.
Map< String, Boolean > are_root
 For each variable, whether it is a root.
Map< String, Integer > nbrVars
 For each variable, the total number of variables in its constraint graph component.
final SecureRandom rnd = new SecureRandom ()
 A source of randomness.
final int minIncr
 Each variable overstates by rand(minIncr, 2*minIncr) its visiting order in the constraint graph traversal, in order to keep its number of neighbors secret.

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 DFSgeneration module that also computes the order in which is variable is visited and the total number of variables in the DFS.

This is (a modified version of) the DFSorder() procedure from the following paper: Thomas Leaute and Boi Faltings. Privacy-preserving multi-agent constraint satisfaction. In Proceedings of the 2009 IEEE International Conference on PrivAcy, Security, riSk and Trust (PASSAT'09), Vancouver, British Columbia, August 29-31 2009. IEEE Computer Society Press.

Author
Eric Zbinden, Thomas Leaute
Parameters
<V>the type used for variable values
<U>the type used for utility values

Constructor & Destructor Documentation

◆ DFSgenerationWithOrder() [1/2]

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

Constructor.

Parameters
problemthis agent's problem
parametersthe parameters for DFSgenerationWithOrder
Exceptions
ClassNotFoundExceptionif the heuristic class is unknown

References are_root, declaredOrder, order_process, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >.problem, and trueOrder.

◆ DFSgenerationWithOrder() [2/2]

frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.DFSgenerationWithOrder ( 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

◆ getChildMsgType()

MessageType frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.getChildMsgType ( )
protected

◆ getMsgTypes()

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

◆ getOutputMsgType()

MessageType frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.getOutputMsgType ( )
protected
Returns
The type of the output messages

References OUTPUT_MSG_TYPE.

◆ getPseudoMsgType()

MessageType frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.getPseudoMsgType ( )
protected
Returns
The type of the message used to tell the recipient that it is a pseudo-child of the sender

References PSEUDO_ORDER_MSG_TYPE.

◆ getRootVarMsgType()

MessageType frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.getRootVarMsgType ( )
protected

◆ init() [1/2]

void frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.init ( )
protected
See also
DFSgeneration.init()

References init(), and frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >.problem.

Referenced by init(), and notifyIn().

Here is the call graph for this function:

◆ init() [2/2]

void frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.init ( String var)
protected
See also
DFSgeneration.init(java.lang.String)

References are_root, declaredOrder, order_process, and trueOrder.

◆ isRoot()

boolean frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.isRoot ( String var)
private
Parameters
varthe variable to test
Returns
if the specified variable is a root

References are_root.

Referenced by processAdditionalMsgInformation().

◆ makeChildToken()

CHILDmsg frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.makeChildToken ( Serializable rootID,
String var,
String parent,
Collection< String > openNeighbors )
protected
See also
DFSgeneration#makeChildToken(Serializable, String, String, Collection)

References frodo2.algorithms.varOrdering.dfs.DFSgeneration< V, U >.openNeighbors, and orderOfNextChild().

Here is the call graph for this function:

◆ notifyIn()

◆ orderOfNextChild()

int frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.orderOfNextChild ( String var)
private
Parameters
varthe variable who calls this method
Returns
the order of the next var

References order_process.

Referenced by makeChildToken().

◆ processAdditionalMsgInformation()

void frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.processAdditionalMsgInformation ( Message msg,
String myVar,
DFSview< V, U > myRelationships )
protected

◆ reset()

◆ sendAdditionalDFSoutput()

void frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.sendAdditionalDFSoutput ( Serializable rootID,
String myVar )
protected

Member Data Documentation

◆ are_root

Map<String, Boolean> frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.are_root
private

For each variable, whether it is a root.

Referenced by DFSgenerationWithOrder(), init(), isRoot(), notifyIn(), and reset().

◆ CHILD_ORDER_MSG_TYPE

◆ declaredOrder

◆ minIncr

final int frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.minIncr
private

Each variable overstates by rand(minIncr, 2*minIncr) its visiting order in the constraint graph traversal, in order to keep its number of neighbors secret.

◆ nbrVars

Map<String, Integer> frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.nbrVars
private

For each variable, the total number of variables in its constraint graph component.

◆ order_process

Map<String, Integer> frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.order_process
private

◆ OUTPUT_MSG_TYPE

◆ OUTPUT_ORDER_TYPE

◆ PSEUDO_ORDER_MSG_TYPE

MessageType frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.PSEUDO_ORDER_MSG_TYPE = new MessageType ("VarOrdering", "DFSgenerationWithOrder", "PSEUDOwithOrder")
static

The type of the message used to tell the recipient that it is a pseudo-child of the sender.

Referenced by getPseudoMsgType().

◆ rnd

final SecureRandom frodo2.algorithms.varOrdering.dfs.DFSgenerationWithOrder< V extends Addable< V >, U extends Addable< U > >.rnd = new SecureRandom ()
private

A source of randomness.

◆ ROOT_VAR_MSG_TYPE

The type of the messages telling whether a given variable is a root.

Referenced by getRootVarMsgType().

◆ trueOrder

◆ VARIABLE_COUNT_TYPE


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