|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|

Classes | |
| class | VariableInfo |
| Container class for information needed for each variable. More... | |
| interface | DetermineAssignment |
| Interface used to implement the different decision strategies of DSA. More... | |
| class | A |
| class | C |
| class | E |
| class | VarAssignment |
| Container for a value assignment and its utility. More... | |
Public Member Functions | |
| DSA (Element parameters, DCOPProblemInterface< Val, U > problem) | |
| Constructor for the stats gatherer mode. | |
| DSA (DCOPProblemInterface< Val, U > problem, Element parameters) throws ClassNotFoundException | |
| Constructor. | |
| DSA (DCOPProblemInterface< Val, U > problem, Element parameters, int nbrCycles) | |
| Constructor. | |
| void | reset () |
| HashMap< String, ArrayList< CurrentAssignment< Val > > > | getAssignmentHistories () |
| void | getStatsFromQueue (Queue queue) |
| Val | getCurrentValue (String variable) |
| Getter method. | |
| U | getCurrentUtility (String variable) |
| Getter method. | |
| void | setSilent (boolean silent) |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| Map< String, Val > | 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 | VALUE_MSG_TYPE = new MessageType ("DSA", "VALUE") |
| The type of the message used to report a value to neighboring variables. | |
| static final MessageType | CONV_STATS_MSG_TYPE = new MessageType ("DSA", "ConvStats") |
| The type of the message containing the assignment history. | |
Protected Member Functions | |
| void | setDecisionStrategy (String decisionStrategy) |
| Method used to set the decision strategy. | |
| void | init () |
| Initializes the agent's variables. | |
| VariableInfo< Val, U > | createVariableInfo (String variableID, Val[] domain, String[] neighbours, DCOPProblemInterface< Val, U > problem) |
| method used to create a VariableInfo object | |
| void | log (String variableID, String message) |
| Log function used to print the variables state during debugging. | |
Protected Attributes | |
| final boolean | LOG = false |
When true, every variable writes log information to a log file. | |
| HashMap< String, BufferedWriter > | loggers |
| A list of buffered writers used to log information during debugging. | |
| final boolean | convergence |
| Whether the listener should record the assignment history or not. | |
| HashMap< String, ArrayList< CurrentAssignment< Val > > > | assignmentHistoriesMap |
| For each variable its assignment history. | |
| DCOPProblemInterface< Val, U > | problem |
| The agent's problem. | |
| double | p |
| The probability with which a new value is chosen. | |
| int | numberOfVariables |
| The number of variables owned by this agent. | |
| Queue | queue |
| The message queue. | |
| HashMap< String, VariableInfo< Val, U > > | infos |
| For each variable a container with information. | |
| DetermineAssignment< Val, U > | decisionStrategy |
| Strategy used to determine a new assignment. | |
| boolean | started |
true when the module has been initialized, and false otherwise | |
| Map< String, String > | owners |
| For each variable the agent that owns it. | |
| int | nbrCycles |
| The number of synchronous cycles before termination (except for isolated variables). | |
| int | variableFinishedCounter |
| Counts the number of variables that have hit the desired cycle count. | |
| boolean | terminated |
true when this agent has sent the agent finished message during initialization | |
This class implements the Distributed Local Search algorithm DSA as described in "Distributed stochastic search and distributed breakout: properties, comparison and applications to constraint optimization problems in sensor networks" by Zhang et al, 2005.
DSA is a very simple algorithm, where each variable decides whether to changes its value based on the values of its neighbouring variables and some local decision procedure. If the variable value changes this is reported to its neighbours via a message. The decision procedures implemented here are as follows, where delta is the difference between the current local utility and the optimal local utility obtainable when changing one's value, in terms of number of conflicts if either one is infeasible, or in terms of utility if both are feasible. v is the value that gives this optimal utility and 0 <= p <= 1 a probability
delta @iliteral > @endiliteral 0 conflict, delta == 0 no conflict, delta == 0
DSA-A : v with p - - DSA-B : v with p v with p - DSA-C : v with p v with p v with p DSA-D : v v with p - DSA-E : v v with p v with p
| <Val> | type used for variable values |
| <U> | type used for utility values |
| frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.DSA | ( | Element | parameters, |
| DCOPProblemInterface< Val, U > | problem ) |
Constructor for the stats gatherer mode.
| parameters | the parameters of the module |
| problem | the overall problem |
References assignmentHistoriesMap, convergence, numberOfVariables, and problem.
Referenced by frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.A< Val extends Addable< Val >, U extends Addable< U > >.A(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.C< Val extends Addable< Val >, U extends Addable< U > >.C(), DSA(), DSA(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.E< Val extends Addable< Val >, U extends Addable< U > >.E(), setDecisionStrategy(), and frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo().
| frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.DSA | ( | DCOPProblemInterface< Val, U > | problem, |
| Element | parameters ) throws ClassNotFoundException |
Constructor.
| problem | description of the local problem |
| parameters | parameters of the module |
| ClassNotFoundException | if the module parameters specify an unknown class for utility values |
References decisionStrategy, DSA(), nbrCycles, p, problem, and setDecisionStrategy().

| frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.DSA | ( | DCOPProblemInterface< Val, U > | problem, |
| Element | parameters, | ||
| int | nbrCycles ) |
Constructor.
| problem | description of the local problem |
| parameters | parameters of the module |
| nbrCycles | the number of cycles that the algorithm should run |
References decisionStrategy, DSA(), nbrCycles, p, problem, and setDecisionStrategy().

|
protected |
method used to create a VariableInfo object
| variableID | the ID of the variable |
| domain | the domain of the variable |
| neighbours | the neighbors of the variable |
| problem | the local problem definition |
variableID References problem.
Referenced by init().
| HashMap< String, ArrayList< CurrentAssignment< Val > > > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.getAssignmentHistories | ( | ) |
| Map< String, Val > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.getCurrentSolution | ( | ) |
Implements frodo2.algorithms.StatsReporterWithConvergence< Val extends Addable< Val > >.
| U frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.getCurrentUtility | ( | String | variable | ) |
Getter method.
| variable | the variable for which the utility is requested |
References infos.
| Val frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.getCurrentValue | ( | String | variable | ) |
Getter method.
| variable | the variable for which the value is requested |
References infos.
| Collection< MessageType > frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.getMsgTypes | ( | ) |
| void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.getStatsFromQueue | ( | Queue | queue | ) |
Implements frodo2.algorithms.StatsReporter.
References CONV_STATS_MSG_TYPE, and queue.
|
protected |
Initializes the agent's variables.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, assignmentHistoriesMap, CONV_STATS_MSG_TYPE, convergence, createVariableInfo(), frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.currentValue, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.cycleCounter, infos, frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Addable< U > >.lastSentMsgs, numberOfVariables, owners, problem, queue, frodo2.communication.Queue.sendMessageToSelf(), started, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, terminated, and variableFinishedCounter.
Referenced by notifyIn().

|
protected |
| void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, CONV_STATS_MSG_TYPE, frodo2.communication.MessageType.equals(), init(), notifyIn(), and VALUE_MSG_TYPE.
Referenced by notifyIn().

| void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.reset | ( | ) |
Implements frodo2.algorithms.StatsReporter.
|
protected |
Method used to set the decision strategy.
| decisionStrategy | the decision strategy to be used |
References decisionStrategy, DSA(), and setDecisionStrategy().
Referenced by DSA(), DSA(), and setDecisionStrategy().

| void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue.
| void frodo2.algorithms.localSearch.dsa.DSA< Val extends Addable< Val >, U extends Addable< U > >.setSilent | ( | boolean | silent | ) |
Implements frodo2.algorithms.StatsReporter.
|
protected |
For each variable its assignment history.
Referenced by DSA(), getAssignmentHistories(), and init().
|
static |
The type of the message containing the assignment history.
Referenced by getStatsFromQueue(), init(), and notifyIn().
|
protected |
|
protected |
Strategy used to determine a new assignment.
Referenced by DSA(), DSA(), and setDecisionStrategy().
|
protected |
For each variable a container with information.
Referenced by getCurrentUtility(), getCurrentValue(), and init().
|
protected |
When true, every variable writes log information to a log file.
Referenced by log().
|
protected |
|
protected |
|
protected |
|
protected |
For each variable the agent that owns it.
Referenced by init().
|
protected |
|
protected |
|
protected |
The message queue.
Referenced by getStatsFromQueue(), init(), and setQueue().
|
static |
The type of the message telling the module to start.
Referenced by getMsgTypes().
|
protected |
true when the module has been initialized, and false otherwise
Referenced by init().
|
protected |
true when this agent has sent the agent finished message during initialization
Referenced by init().
|
static |
The type of the message used to report a value to neighboring variables.
Referenced by getMsgTypes(), notifyIn(), frodo2.algorithms.localSearch.dsa.VALUEmsg< Val extends Addable< Val > >.VALUEmsg(), and frodo2.algorithms.localSearch.dsa.VALUEmsg< Val extends Addable< Val > >.VALUEmsg().
|
protected |
Counts the number of variables that have hit the desired cycle count.
Referenced by init().