|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This class implements the ADOPT algorithm as described in: More...

Classes | |
| interface | Version |
| The different versions of adopt handle some things differently. More... | |
| class | Original |
| The original adopt version. More... | |
| class | VariableInfo |
| Helper class that contains all the info belonging to a specific variable. More... | |
Public Member Functions | |
| ADOPT (Element parameters, DCOPProblemInterface< Val, U > problem) | |
| Constructor for the stats gatherer mode. | |
| ADOPT (DCOPProblemInterface< Val, U > problem, Element parameters) throws Exception | |
| A constructor that takes in the description of the problem and the parameters of adopt. | |
| ADOPT (DCOPProblemInterface< Val, U > problem, String versionName, boolean convergence) throws Exception | |
| Constructor. | |
| void | reset () |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| void | getStatsFromQueue (Queue queue) |
| HashMap< String, ArrayList< CurrentAssignment< Val > > > | getAssignmentHistories () |
| boolean | compatible (HashMap< String, Val > context1, HashMap< String, Val > context2) |
| Two contexts are compatible if they agree on the shared variables. | |
| void | sendMessageToVariable (String variable, Message msg) |
| Sends a message to the owner of the variable. | |
| void | setSilent (boolean silent) |
| 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 Member Functions | |
| static< Val extends Addable< Val > U extends Addable< U > void | log (VariableInfo< Val, U > variable, String message) |
Static Public Attributes | |
| static MessageType | START_MSG_TYPE = AgentInterface.START_AGENT |
| The type of the message telling the module to start. | |
| static final MessageType | CONV_STATS_MSG_TYPE = new MessageType ("ADOPT", "ConvStats") |
| The type of the message containing the assignment history. | |
Private Member Functions | |
| void | init () |
| Parses the problem. | |
| boolean | checkAllCostsNonNeg () |
| void | setVersion (String versionName) throws ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException |
| Helper function to set the heuristic used for preprocessing. | |
| void | decideSingleton (VariableInfo< Val, U > variable) |
| When this variable is isolated, immediately calculate its decision and terminate. | |
Private Attributes | |
| Queue | queue |
| The message queue. | |
| U | infinity |
| Infinite utility. | |
| HashMap< String, VariableInfo< Val, U > > | infos |
| For each variable all the info needed to run the algorithm. | |
| Map< String, String > | owners = new HashMap<String, String>() |
| For each known variable, the name of the agent that owns it. | |
| Version< Val, U > | adoptVersion |
| Object with version specific methods. | |
| HashMap< String, Boolean > | variableReady = new HashMap<String, Boolean>() |
| Variable used in order to determine whether the algorithm can be initiated or not for a particular variable. | |
| int | variableReadyCounter = 0 |
| Variable that counts the number of variables that have terminated. | |
| DCOPProblemInterface< Val, U > | problem |
| The agent's problem. | |
| boolean | started = false |
| Whether the algorithm has been started. | |
| final boolean | convergence |
true when the convergence history is to be stored | |
| HashMap< String, ArrayList< CurrentAssignment< Val > > > | assignmentHistoriesMap |
| For each variable its assignment history. | |
Static Private Attributes | |
| static final boolean | LOG = false |
| To log or not to log. | |
This class implements the ADOPT algorithm as described in:
"An Asynchronous Complete Method for Distributed Constraint Optimization" P.J. Modi et al AAMAS03
| <Val> | the type used for variable values |
| <U> | the type used for utility values |
| frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.ADOPT | ( | Element | parameters, |
| DCOPProblemInterface< Val, U > | problem ) |
Constructor for the stats gatherer mode.
| problem | the overall problem |
| parameters | the parameters of the module |
References assignmentHistoriesMap, and problem.
Referenced by frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.Original< Val extends Addable< Val >, U extends Addable< U > >.backTrack(), decideSingleton(), notifyIn(), frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.Original< Val extends Addable< Val >, U extends Addable< U > >.Original(), and setVersion().
| frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.ADOPT | ( | DCOPProblemInterface< Val, U > | problem, |
| Element | parameters ) throws Exception |
A constructor that takes in the description of the problem and the parameters of adopt.
| problem | Problem description |
| parameters | adopt's parameters |
| Exception | if an error occurs |
References infinity, problem, and setVersion().

| frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.ADOPT | ( | DCOPProblemInterface< Val, U > | problem, |
| String | versionName, | ||
| boolean | convergence ) throws Exception |
Constructor.
| problem | the problem |
| versionName | the name of the version of ADOPT |
| convergence | true when the assignment history should be stored |
| Exception | if an error occurs |
References convergence, infinity, problem, and setVersion().

|
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(), and frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.Iterator< V >.hasNext().
Referenced by init().

| boolean frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.compatible | ( | HashMap< String, Val > | context1, |
| HashMap< String, Val > | context2 ) |
Two contexts are compatible if they agree on the shared variables.
| context1 | the first context |
| context2 | the second context |
true if the contexts are compatible and false otherwise
|
private |
When this variable is isolated, immediately calculate its decision and terminate.
| variable | the information about the variable |
References ADOPT(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, assignmentHistoriesMap, convergence, frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Serializable &Addable< U > >.currentAssignment, infos, LOG, log(), frodo2.output, queue, frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Serializable &Addable< U > >.setCurrentAssignmentSingleton(), frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Serializable &Addable< U > >.setDelta(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Serializable &Addable< U > >.variableID, and variableReadyCounter.

| HashMap< String, ArrayList< CurrentAssignment< Val > > > frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.getAssignmentHistories | ( | ) |
| Map< String, Val > frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.getCurrentSolution | ( | ) |
Implements frodo2.algorithms.StatsReporterWithConvergence< Val extends Addable< Val > >.
| Collection< MessageType > frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References adoptVersion, frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.algorithms.adopt.Preprocessing< Val extends Addable< Val >, U extends Addable< U > >.HEURISTICS_MSG_TYPE, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, and START_MSG_TYPE.
| void frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.getStatsFromQueue | ( | Queue | queue | ) |
Implements frodo2.algorithms.StatsReporter.
References CONV_STATS_MSG_TYPE, and queue.
|
private |
Parses the problem.
References assignmentHistoriesMap, checkAllCostsNonNeg(), infinity, infos, problem, and variableReady.
Referenced by notifyIn().

|
static |
| void frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References ADOPT(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.communication.MessageType.equals(), init(), notifyIn(), and frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE.
Referenced by notifyIn().

| void frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.reset | ( | ) |
Implements frodo2.algorithms.StatsReporter.
| void frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.sendMessageToVariable | ( | String | variable, |
| Message | msg ) |
| void frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
References queue.
| void frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.setSilent | ( | boolean | silent | ) |
Implements frodo2.algorithms.StatsReporter.
|
private |
Helper function to set the heuristic used for preprocessing.
| versionName | the name of the version class |
| ClassNotFoundException | if the version is not found |
| NoSuchMethodException | if the version class does not have a constructor taking a single argument of class ADOPT |
| InstantiationException | if calling the constructor for the version failed |
| IllegalAccessException | if calling the constructor for the version failed |
| InvocationTargetException | if calling the constructor for the version failed |
References ADOPT(), and setVersion().
Referenced by ADOPT(), ADOPT(), and setVersion().

|
private |
Object with version specific methods.
Referenced by getMsgTypes().
|
private |
For each variable its assignment history.
Referenced by ADOPT(), decideSingleton(), getAssignmentHistories(), and init().
|
static |
The type of the message containing the assignment history.
Referenced by getStatsFromQueue().
|
private |
true when the convergence history is to be stored
Referenced by ADOPT(), and decideSingleton().
|
private |
|
private |
For each variable all the info needed to run the algorithm.
Referenced by decideSingleton(), and init().
|
staticprivate |
To log or not to log.
Referenced by frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.Original< Val extends Addable< Val >, U extends Addable< U > >.backTrack(), decideSingleton(), log(), and frodo2.algorithms.adopt.ADOPT< Val extends Addable< Val >, U extends Addable< U > >.VariableInfo< Val extends Addable< Val >, U extends Serializable &Addable< U > >.VariableInfo().
|
private |
For each known variable, the name of the agent that owns it.
Referenced by sendMessageToVariable().
|
private |
|
private |
The message queue.
Referenced by decideSingleton(), getStatsFromQueue(), sendMessageToVariable(), and setQueue().
|
static |
The type of the message telling the module to start.
Referenced by getMsgTypes().
|
private |
Whether the algorithm has been started.
|
private |
Variable used in order to determine whether the algorithm can be initiated or not for a particular variable.
Referenced by init().
|
private |
Variable that counts the number of variables that have terminated.
Referenced by decideSingleton().