|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
This class is used to test the workings of the ADOPT listener. More...

Public Member Functions | |
| testADOPT (Class< ? extends Addable<?> > utilClass, String version, boolean useTCP, boolean useXML) | |
| Constructor that instantiates a test only for the input method. | |
| void | test () throws Exception |
| Runs a random test. | |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| 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 TestSuite | suite () |
| static< U extends Addable< U > Map< String, UtilitySolutionSpace< AddableInteger, U > > | startADOPT (RandGraphFactory.Graph graph, Map< String, DFSview< AddableInteger, U > > dfs, Map< String, Queue > queues, List< ? extends UtilitySolutionSpace< AddableInteger, U > > constraints, XCSPparser< AddableInteger, U > parser) |
| Sends messages to the queues to initiate ADOPT. | |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Package Attributes | |
| Queue | myQueue |
| The queue to which this class is registered as a listener. | |
Private Member Functions | |
| Hypercube< AddableInteger, AddableInteger > | simulateUTIL (String var) |
| Simulates UTIL propagation on the subtree rooted at the input variable, while checking separators. | |
Private Attributes | |
| final int | maxNbrVars = 7 |
| Maximum number of variables in the random graph. | |
| final int | maxNbrEdges = 25 |
| Maximum number of edges in the random graph. | |
| final int | maxNbrAgents = 7 |
| Maximum number of agents. | |
| int | nbrMsgsRemaining |
| The number of output messages remaining to be received. | |
| final ReentrantLock | finished_lock = new ReentrantLock () |
| Used to make the test thread wait. | |
| final Condition | finished = finished_lock.newCondition() |
| Used to wake up the test thread when all agents have finished. | |
| Map< String, Queue > | queues |
| List of queues, indexed by agent name. | |
| Element | parameters |
| The parameters for adopt. | |
| RandGraphFactory.Graph | graph |
| Random graph used to generate a constraint graph. | |
| Map< String, DFSview< AddableInteger, AddableInteger > > | dfs |
| The DFS corresponding to the random graph. | |
| Map< String, UtilitySolutionSpace< AddableInteger, AddableInteger > > | hypercubes |
| For each variable, the constraint it is responsible for enforcing. | |
| XCSPparser< AddableInteger, AddableInteger > | parser |
| The parser. | |
| Class<? extends Addable<?> > | utilClass |
| The class of utility values. | |
| String | version |
| The version of ADOPT. | |
| boolean | useTCP |
| Whether to use TCP pipes or shared memory pipes. | |
| boolean | useXML |
| Whether to use the XML-based constructor. | |
This class is used to test the workings of the ADOPT listener.
| frodo2.algorithms.adopt.test.testADOPT.testADOPT | ( | Class< ? extends Addable<?> > | utilClass, |
| String | version, | ||
| boolean | useTCP, | ||
| boolean | useXML ) |
Constructor that instantiates a test only for the input method.
| utilClass | the class of utility values |
| version | the version of ADOPT |
| useTCP | whether to use TCP pipes or shared memory pipes |
| useXML | whether to use the XML-based constructor |
References useTCP, useXML, utilClass, and version.
Referenced by suite().
| Collection< MessageType > frodo2.algorithms.adopt.test.testADOPT.getMsgTypes | ( | ) |
| void frodo2.algorithms.adopt.test.testADOPT.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References nbrMsgsRemaining.
| void frodo2.algorithms.adopt.test.testADOPT.setQueue | ( | Queue | queue | ) |
Implements frodo2.communication.MessageListener< T >.
|
protected |
References frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.computeDFS(), dfs, frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, maxNbrVars, parameters, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), parser, and setUp().
Referenced by setUp().

|
private |
Simulates UTIL propagation on the subtree rooted at the input variable, while checking separators.
| var | root variable |
References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.blindProject(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.clone(), dfs, hypercubes, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF, and simulateUTIL().
Referenced by simulateUTIL(), and test().

|
static |
Sends messages to the queues to initiate ADOPT.
| <U> | the type used for utility values |
| graph | the constraint graph |
| dfs | the corresponding DFS (for each node in the graph, the relationships of this node) |
| queues | the array of queues, indexed by the names of the clusters in the graph |
| constraints | the hypercubes in the problem definition |
| parser | the parser for the random problem |
References dfs, 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(), graph, hypercubes, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), parser, queues, frodo2.communication.Queue.sendMessageToSelf(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.setSpaces(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.
Referenced by test().

|
static |
References testADOPT().
Referenced by frodo2.algorithms.adopt.test.AllTestsADOPT.suite().

|
protected |
| void frodo2.algorithms.adopt.test.testADOPT.test | ( | ) | throws Exception |
Runs a random test.
| Exception | if an error occurs |
References frodo2.solutionSpaces.AddableInteger.add(), frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.algorithms.test.AllTests.createQueueNetwork(), dfs, frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgents(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomain(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomClass(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getOwners(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpacePerRandVar(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getRandVars(), frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getSolution(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getUtilClass(), frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getUtility(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.getUtility(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVariables(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVarScopes(), graph, hypercubes, myQueue, nbrMsgsRemaining, parameters, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), parser, queues, frodo2.communication.Queue.setProblem(), frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.setSilent(), simulateUTIL(), startADOPT(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, test(), useTCP, useXML, and version.
Referenced by test().

|
private |
The DFS corresponding to the random graph.
Referenced by setUp(), simulateUTIL(), startADOPT(), tearDown(), and test().
|
private |
Used to wake up the test thread when all agents have finished.
|
private |
Used to make the test thread wait.
|
private |
Random graph used to generate a constraint graph.
Referenced by setUp(), startADOPT(), tearDown(), and test().
|
private |
For each variable, the constraint it is responsible for enforcing.
Referenced by simulateUTIL(), startADOPT(), and test().
|
private |
Maximum number of agents.
Referenced by setUp().
|
private |
Maximum number of edges in the random graph.
Referenced by setUp().
|
private |
|
package |
The queue to which this class is registered as a listener.
Referenced by test().
|
private |
The number of output messages remaining to be received.
Referenced by notifyIn(), and test().
|
private |
|
private |
The parser.
Referenced by setUp(), startADOPT(), and test().
|
private |
List of queues, indexed by agent name.
Referenced by startADOPT(), tearDown(), and test().
|
private |
Whether to use TCP pipes or shared memory pipes.
Referenced by test(), and testADOPT().
|
private |
Whether to use the XML-based constructor.
Referenced by test(), and testADOPT().
|
private |
The class of utility values.
Referenced by testADOPT().
|
private |
The version of ADOPT.
Referenced by test(), and testADOPT().