|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
Algorithm that generates samples for the random variables in the problem. More...

Classes | |
| class | RandVarsProjMsg |
| Message telling what random variables should be projected out at given decision variable. More... | |
| enum | WhereToProject |
| Where the random variables should be projected out. More... | |
| class | AtLeaves |
| The version of the SamplingPhase that samples at the leaves. More... | |
| class | AtLCAs |
| The version of the SamplingPhase that samples at the lcas. More... | |
| class | AtRoots |
| A version of the SamplingPhase in which the sampling for all random variables is performed at the roots. More... | |
Public Member Functions | |
| SamplingPhase (DCOPProblemInterface< V, U > problem, Element parameters) | |
| Constructor. | |
| void | reset () |
| SamplingPhase (Element parameters, DCOPProblemInterface< V, U > problem) | |
| Constructor in stats gatherer mode. | |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | getStatsFromQueue (Queue queue) |
| void | setSilent (boolean silent) |
| String | dfsToString () |
| Public Member Functions inherited from frodo2.algorithms.dpop.stochastic.LowestCommonAncestors | |
| LowestCommonAncestors (Map< String, Set< String > > flags, Map< String, String > owners) | |
| Constructor. | |
| void | setQueue (Queue queue) |
| 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 String | dfsToString (Map< String, ? extends DFSview<?, ?> > dfs, Map< String, Set< String > > randVars, Map< String, Set< String > > randVarsProj, final boolean projAtLeaves) |
| Prints the input dfs in DOT format. | |
Static Public Attributes | |
| static MessageType | START_MSG_TYPE = AgentInterface.START_AGENT |
| The type of the start message. | |
| static final MessageType | RAND_VARS_PROJ_MSG_TYPE = new MessageType ("E[DPOP]", "SamplingPhase", "Where to project random variables") |
| The type of the messages telling what random variables should be projected out at given decision variable. | |
| Static Public Attributes inherited from frodo2.algorithms.dpop.stochastic.LowestCommonAncestors | |
| static MessageType | DFS_MSG_TYPE = DFSgeneration.OUTPUT_MSG_TYPE |
| The type of the message containing information about the DFS. | |
| static final MessageType | PHASE1_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAmsg1") |
| The type of a phase 1 message. | |
| static final MessageType | PHASE2_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAmsg2") |
| The type of a phase 2 message. | |
| static final MessageType | OUTPUT_MSG_TYPE = new MessageType ("E[DPOP]", "LowestCommonAncestors", "LCAoutput") |
| The type of the output messages. | |
Protected Member Functions | |
| SamplingPhase () | |
| Nullary constructor. | |
| void | init () |
| Parses the problem. | |
| Protected Member Functions inherited from frodo2.algorithms.dpop.stochastic.LowestCommonAncestors | |
| LowestCommonAncestors () | |
| Empty constructor with no specified flags. | |
| void | setFlags (Map< String, ? extends Set< String > > flags) |
| Adds flags. | |
| LCAmsg1 | newPhase1msg (String node, NodeInfo nodeInfo) |
| Creates a new Phase 1 message. | |
| void | terminatePhase2 (String node, NodeInfo nodeInfo, Set< String > pendingFlags) |
| Sends messages to children and the output message. | |
| void | sendOutput (String node, NodeInfo nodeInfo) |
| Sends the output message. | |
Protected Attributes | |
| DCOPProblemInterface< V, U > | problem |
| The problem. | |
| boolean | started = false |
| Whether the execution of the algorithm has started. | |
| int | nbrSamples |
| The number of samples for each random variable. | |
| HashMap< String, UtilitySolutionSpace< V, U > > | probLaws = new HashMap< String, UtilitySolutionSpace<V, U> > () |
| For each random variable, its non-sampled probability law. | |
| boolean | reportStats = true |
| Whether to report stats. | |
| WhereToProject | proj |
| Where the random variables should be projected out. | |
| Protected Attributes inherited from frodo2.algorithms.dpop.stochastic.LowestCommonAncestors | |
| Queue | queue |
| The queue. | |
| HashMap< String, NodeInfo > | infos |
| The known information about each node. | |
| Map< String, String > | owners = new HashMap<String, String> () |
| For each known node, the name of the agent that owns it. | |
Private Attributes | |
| int | nbrStatsMsgs |
| The total number messages to expect in "statistics gatherer" mode. | |
| HashMap< String, DFSview< V, ?> > | relationships |
| For every variable this agent owns, its view of the DFS. | |
| String | dotRendererClass |
| Renderer to display DOT code. | |
| HashMap< String, Set< String > > | randVars |
| For each variable, the random variables it is linked to (only used in stats gatherer mode). | |
| HashMap< String, Set< String > > | randVarsProj |
| For each variable, the random variables it must project out (only used in stats gatherer mode). | |
Algorithm that generates samples for the random variables in the problem.
The samples for a given random variable are chosen by the Lowest Common Ancestor of all decision variables responsible for enforcing a constraint involving that random variable.
| <V> | the type used for random variable values |
| <U> | the type used for probabilities |
|
protected |
Nullary constructor.
Referenced by notifyIn().
| frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.SamplingPhase | ( | DCOPProblemInterface< V, U > | problem, |
| Element | parameters ) |
Constructor.
| problem | this agent's problem |
| parameters | the parameters for SamplingPhase |
References frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.LCAS, frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.LEAVES, problem, and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.ROOTS.
| frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.SamplingPhase | ( | Element | parameters, |
| DCOPProblemInterface< V, U > | problem ) |
Constructor in stats gatherer mode.
| problem | the overall problem |
| parameters | parameters of the stats gatherer |
References frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.LCAS, frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.LEAVES, problem, relationships, and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.ROOTS.
| String frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.dfsToString | ( | ) |
References dfsToString(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.WhereToProject.LEAVES.
Referenced by frodo2.algorithms.dpop.stochastic.E_DPOPsolver< V extends Addable< V >, U extends Addable< U > >.buildSolution(), dfsToString(), and notifyIn().

|
static |
Prints the input dfs in DOT format.
| dfs | for each variable, a map associating a list of neighbors to each type of relationship |
| randVars | for each variable, the set of random variables it is linked to |
| randVarsProj | for each variable, which random variables it must project out |
| projAtLeaves | whether projection of random variables is performed at the leaves |
References randVars, randVarsProj, and relationships.
| Collection< MessageType > frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.getMsgTypes | ( | ) |
Reimplemented from frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, and START_MSG_TYPE.
| void frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue | ( | Queue | queue | ) |
|
protected |
| void frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Reimplemented from frodo2.algorithms.dpop.stochastic.LowestCommonAncestors.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, dfsToString(), dotRendererClass, frodo2.communication.MessageType.equals(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getAllPseudoChildren(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getChildren(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.MessageDFSoutput< V extends Addable< V >, U extends Addable< U > >.getNeighbors(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.RandVarsProjMsg.getRandVars(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getSpaces(), frodo2.communication.Message.getType(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.MessageDFSoutput< V extends Addable< V >, U extends Addable< U > >.getVar(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.RandVarsProjMsg.getVariable(), init(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.isRandom(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.OUTPUT_MSG_TYPE, RAND_VARS_PROJ_MSG_TYPE, randVars, relationships, reset(), SamplingPhase(), and frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.STATS_MSG_TYPE.

| void frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.reset | ( | ) |
Implements frodo2.algorithms.StatsReporter.
References probLaws, problem, and relationships.
Referenced by notifyIn().
| void frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.setSilent | ( | boolean | silent | ) |
Implements frodo2.algorithms.StatsReporter.
|
private |
Renderer to display DOT code.
Referenced by notifyIn().
|
protected |
The number of samples for each random variable.
|
private |
The total number messages to expect in "statistics gatherer" mode.
|
protected |
For each random variable, its non-sampled probability law.
Referenced by reset().
|
protected |
The problem.
Referenced by frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtRoots< V extends Addable< V >, U extends Addable< U > >.AtRoots(), frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.AtRoots< V extends Addable< V >, U extends Addable< U > >.AtRoots(), init(), reset(), SamplingPhase(), and SamplingPhase().
|
protected |
Where the random variables should be projected out.
|
static |
The type of the messages telling what random variables should be projected out at given decision variable.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.getMsgTypes(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.getMsgTypes(), getStatsFromQueue(), notifyIn(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.notifyIn(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.notifyIn(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.RandVarsProjMsg.RandVarsProjMsg().
|
private |
For each variable, the random variables it is linked to (only used in stats gatherer mode).
Referenced by dfsToString(), notifyIn(), and frodo2.algorithms.dpop.stochastic.SamplingPhase< V extends Addable< V >, U extends Addable< U > >.RandVarsProjMsg.RandVarsProjMsg().
|
private |
For each variable, the random variables it must project out (only used in stats gatherer mode).
Referenced by dfsToString().
|
private |
For every variable this agent owns, its view of the DFS.
Used only in stats gatherer mode.
Referenced by dfsToString(), notifyIn(), reset(), and SamplingPhase().
|
protected |
Whether to report stats.
|
static |
The type of the start message.
Referenced by getMsgTypes().
|
protected |
Whether the execution of the algorithm has started.