|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
The SynchBB algorithm for DCOPs. More...

Classes | |
| class | ConvergenceMessage |
| A message reporting the convergence for a given component. More... | |
| class | ClusterInfo |
| Information about a cluster of variables owned by this agent. More... | |
| class | ComponentInfo |
| The information about a particular component of the constraint graph. More... | |
Public Member Functions | |
| SynchBB (Element parameters, DCOPProblemInterface< V, U > problem) | |
| The constructor called in "statistics gatherer" mode. | |
| SynchBB (DCOPProblemInterface< V, U > problem, Element parameters) | |
| Constructor. | |
| void | reset () |
| Collection< MessageType > | getMsgTypes () |
| void | getStatsFromQueue (Queue queue) |
| void | setSilent (boolean silent) |
| void | setQueue (Queue queue) |
| void | notifyIn (Message msg) |
| HashMap< String, ArrayList< CurrentAssignment< V > > > | getAssignmentHistories () |
| Map< String, V > | getCurrentSolution () |
| 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 | ORDER_MSG_TYPE = OrderMsg.ORDER_MSG_TYPE |
| The types of the messages containing the chosen linear order of (clusters of) variables. | |
| static MessageType | ORDER_STATS_MSG_TYPE = OrderMsg.STATS_MSG_TYPE |
| The types of the messages containing the chosen linear order of (clusters of) variables sent to the stats gatherer. | |
| static final MessageType | BACKTRACK_MSG_TYPE = new MessageType ("SynchBB", "Backtrack") |
| The type of the backtrack messages. | |
| static final MessageType | PATH_MSG_TYPE = new MessageType ("SynchBB", "Path") |
| The type of the messages containing the current partial assignment. | |
| static final MessageType | OUTPUT_MSG_TYPE = new MessageType ("SynchBB", "Solution") |
| The type of the message containing the optimal solution found. | |
| static final MessageType | UB_MSG_TYPE = new MessageType ("SynchBB", "UB") |
| The type of the messages broadcast by the last variable containing the current upper bound. | |
Private Member Functions | |
| void | start () |
| Parses the problem. | |
| boolean | checkAllCostsNonNeg () |
| void | initiate (Comparable<?> compID, ComponentInfo compInfo) |
| Chooses a first value for the first cluster of variables and starts the algorithm. | |
| void | terminate (Comparable<?> compID, ComponentInfo compInfo) |
| Sends output and termination messages. | |
| void | received_from_prev (PathMsg< V, U > msg) |
| Reacts to the reception of a path message from the previous cluster in the ordering. | |
| void | received_from_next (BTmsg msg) |
| Reacts to the reception of a backtrack message. | |
| void | send_token (Comparable<?> compID, ComponentInfo compInfo, final int clusterIndex, ClusterInfo info, V[] next) |
| Sends the next message. | |
| V[] | get_next (ComponentInfo compInfo, final int clusterIndex, ClusterInfo info) |
| Chooses the next assignment for the current cluster of variables. | |
Private Attributes | |
| final boolean | convergence |
true when the convergence history is to be stored | |
| HashMap< String, ArrayList< CurrentAssignment< V > > > | assignmentHistoriesMap |
| For each variable, its assignment history. | |
| HashMap< Comparable<?>, ComponentInfo > | compInfos |
| The information about each component in the constraint graph. | |
| HashMap< String, Comparable<?> > | compOfCluster |
| For each cluster, its component ID. | |
| Queue | queue |
| This module's queue. | |
| DCOPProblemInterface< V, U > | problem |
| The problem. | |
| boolean | started = false |
| Whether the module has already started the algorithm. | |
| U | zero |
| The 0 cost. | |
| HashMap< String, V > | solution |
| The solution. | |
| Class< V > | valClass |
| The class of V. | |
| Class< V[]> | valArrayClass |
| The class of V[]. | |
| LinkedList< SolutionMsg< V, U > > | pendingSolMsgs |
| Used to store solution messages received by the stats gatherer before their corresponding linear order. | |
| LinkedList< ConvergenceMessage< V > > | pendingConvMsgs |
| Used to store convergence messages received by the stats gatherer before their corresponding linear order. | |
| HashMap< String, PathMsg< V, U > > | pendingPathMsgs |
| For some clusters, a PathMsg that was received before the var order message. | |
Static Private Attributes | |
| static final MessageType | CONV_STATS_MSG_TYPE = new MessageType ("SynchBB", "Convergence") |
| The type of the message reporting the convergence for a given component. | |
| static final boolean | DEBUG = false |
| Whether the algorithm should print out debugging information. | |
The SynchBB algorithm for DCOPs.
This is the original SynchBB algorithm by Hirayama & Yokoo (CP'97), adapted to solve DCOPs as proposed by Meisels (Springer Verlag, 2008), with two additional performance improvements:
| <V> | the type used for variable values |
| <U> | the type used for utility values |
| frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.SynchBB | ( | Element | parameters, |
| DCOPProblemInterface< V, U > | problem ) |
The constructor called in "statistics gatherer" mode.
| problem | the overall problem |
| parameters | the description of what statistics should be reported (currently unused) |
References problem.
| frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.SynchBB | ( | DCOPProblemInterface< V, U > | problem, |
| Element | parameters ) |
|
private |
true if all utilities in all spaces are non-negative, false otherwise References frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.Iterator< V >.hasNext(), and zero.
Referenced by start().

|
private |
Chooses the next assignment for the current cluster of variables.
| compInfo | the information about the component in the constraint graph |
| clusterIndex | index of the current cluster in the cluster ordering |
| info | information about the current cluster |
null if the domain is exhausted References get_next(), and valArrayClass.
Referenced by get_next(), received_from_next(), and send_token().

| HashMap< String, ArrayList< CurrentAssignment< V > > > frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.getAssignmentHistories | ( | ) |
| Map< String, V > frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.getCurrentSolution | ( | ) |
Implements frodo2.algorithms.StatsReporterWithConvergence< Val extends Addable< Val > >.
| Collection< MessageType > frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.getMsgTypes | ( | ) |
| void frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue | ( | Queue | queue | ) |
|
private |
Chooses a first value for the first cluster of variables and starts the algorithm.
| compID | the ID of the component in the constraint graph |
| compInfo | the information about the component in the constraint graph |
References initiate(), frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ClusterInfo.nextAgent, terminate(), valArrayClass, and valClass.
Referenced by initiate().

| void frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.communication.MessageType.equals(), notifyIn(), and ORDER_STATS_MSG_TYPE.
Referenced by notifyIn().

|
private |
Reacts to the reception of a backtrack message.
| msg | the received backtrack message |
References frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.clusterIndexes, frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.clusterInfos, frodo2.algorithms.synchbb.BTmsg.dest, get_next(), and send_token().

|
private |
Reacts to the reception of a path message from the previous cluster in the ordering.
| msg | the received path message |
References frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.clusterIndexes, and received_from_prev().
Referenced by received_from_prev().

| void frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.reset | ( | ) |
Implements frodo2.algorithms.StatsReporter.
|
private |
Sends the next message.
| compID | the ID of the component in the constraint graph |
| compInfo | the information about the component in the constraint graph |
| clusterIndex | index of the current cluster in the cluster ordering |
| info | information on the current cluster |
| next | next assignment chosen for the current cluster |
References convergence, DEBUG, get_next(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.communication.Queue.getCurrentTime(), send_token(), frodo2.communication.Queue.sendMessage(), frodo2.communication.Queue.sendMessageToMulti(), terminate(), UB_MSG_TYPE, and valArrayClass.
Referenced by received_from_next(), and send_token().

| void frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue.
| void frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.setSilent | ( | boolean | silent | ) |
|
private |
Parses the problem.
References checkAllCostsNonNeg(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getZeroUtility(), and frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.maximize().

|
private |
Sends output and termination messages.
| compID | the ID of the component in the constraint graph |
| compInfo | the information about the component in the constraint graph |
References frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.agents, frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.bestSol, frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.history, OUTPUT_MSG_TYPE, frodo2.communication.Queue.sendMessage(), frodo2.communication.Queue.sendMessageToMulti(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, and frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.ub.
Referenced by initiate(), and send_token().

|
private |
For each variable, its assignment history.
|
static |
The type of the backtrack messages.
Referenced by frodo2.algorithms.synchbb.BTmsg.BTmsg(), frodo2.algorithms.synchbb.BTmsg.BTmsg(), and getMsgTypes().
|
private |
The information about each component in the constraint graph.
|
private |
For each cluster, its component ID.
|
staticprivate |
The type of the message reporting the convergence for a given component.
Referenced by frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ConvergenceMessage< V extends Addable< V > >.ConvergenceMessage(), frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ConvergenceMessage< V extends Addable< V > >.ConvergenceMessage(), and getStatsFromQueue().
|
private |
true when the convergence history is to be stored
Referenced by frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.ComponentInfo(), frodo2.algorithms.synchbb.SynchBB< V extends Addable< V >, U extends Addable< U > >.ComponentInfo.ComponentInfo(), and send_token().
|
staticprivate |
Whether the algorithm should print out debugging information.
Referenced by send_token().
|
static |
The types of the messages containing the chosen linear order of (clusters of) variables.
Referenced by getMsgTypes().
|
static |
The types of the messages containing the chosen linear order of (clusters of) variables sent to the stats gatherer.
Referenced by getStatsFromQueue(), and notifyIn().
|
static |
The type of the message containing the optimal solution found.
Referenced by getMsgTypes(), and terminate().
|
static |
The type of the messages containing the current partial assignment.
Referenced by getMsgTypes(), frodo2.algorithms.synchbb.PathMsg< V extends Addable< V >, U extends Addable< U > >.PathMsg(), and frodo2.algorithms.synchbb.PathMsg< V extends Addable< V >, U extends Addable< U > >.PathMsg().
|
private |
Used to store convergence messages received by the stats gatherer before their corresponding linear order.
|
private |
For some clusters, a PathMsg that was received before the var order message.
|
private |
Used to store solution messages received by the stats gatherer before their corresponding linear order.
|
private |
|
private |
This module's queue.
Referenced by getStatsFromQueue(), and setQueue().
|
private |
The solution.
|
static |
The type of the message telling the module to start.
Referenced by getMsgTypes().
|
private |
Whether the module has already started the algorithm.
|
static |
The type of the messages broadcast by the last variable containing the current upper bound.
Referenced by getMsgTypes(), and send_token().
|
private |
The class of V[].
Referenced by get_next(), initiate(), and send_token().
|
private |
The class of V.
Referenced by initiate().
|
private |
The 0 cost.
Referenced by checkAllCostsNonNeg().