|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
JUnit test of the ODPOP agent. More...

Public Member Functions | |
| ODPOPagentTestFullDomain (String string, boolean useCentralMailer, boolean useDelay, MessageType startMsgType, Class< V > domClass, Class< U > utilClass) | |
| Creates a JUnit test case corresponding to the input method. | |
| void | setUp () throws Exception |
| void | testRandomSharedMemory () throws Exception |
| Tests the ODPOPagent on a random problem using QueueIOPipes for inter-agent communication. | |
| void | testRandomTCP () throws Exception |
| Tests the ODPOPagent on a random problem using TCP pipes for inter-agent communication. | |
| void | testRandom (boolean useTCP, Class< ? extends XCSPparser< V, U > > parserClass) throws JDOMException, IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException |
| Tests the DPOPagent on a random problem. | |
| Collection< MessageType > | getMsgTypes () |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| Does nothing. | |
| 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 () |
Protected Member Functions | |
| void | tearDown () throws Exception |
Private Member Functions | |
| void | setStartMsgType (MessageType startMsgType) throws JDOMException |
| Sets the type of the start message for all modules. | |
| void | setStartMsgType (Element messages, MessageType startMsgType) |
| Overwrites the type of the start messages. | |
Private Attributes | |
| final int | maxNbrVars = 10 |
| Maximum number of variables in the problem. | |
| final int | maxNbrEdges = 15 |
| Maximum number of binary constraints in the problem. | |
| final int | maxNbrAgents = 10 |
| Maximum number of agents. | |
| Queue | queue |
| The queue used to listen to the agents. | |
| Map< Object, QueueOutputPipeInterface > | pipes |
| For each agent, the output pipe to it. | |
| QueueIOPipe | pipe |
| The testers pipe. | |
| Map< String, AgentInterface< V > > | agents |
| All agents, indexed by their IDs. | |
| int | nbrAgents |
| Total number of agents. | |
| int | nbrMsgsReceived |
| Used to track the number of various types of messages received from the agents. | |
| int | nbrAgentsFinished |
| Number of agents finished. | |
| 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. | |
| UTILpropagationFullDomain< V, U, LeafNode< U > > | statsGathererUTIL |
| The UTILpropagation stats gatherer listening for the solution. | |
| SolutionCollector< V, U > | solCollector |
| The solution collector. | |
| DFSgeneration< V, U > | statsGathererDFS |
| The DFS tree generation stats gatherer listening for DFS tree information. | |
| MessageType | startMsgType |
| The type of the start message. | |
| Document | agentDesc |
| The description of the agent. | |
| boolean | useCentralMailer |
true if the algorithm must be tested with the central mailer | |
| boolean | useDelay |
true if the central mailer must be tested with added delays | |
| CentralMailer | mailman |
| The CentralMailer. | |
| boolean | maximize |
when true a maximization problem should be generated, when false a minimization problem | |
| Class< V > | domClass |
| The class used for variable values. | |
| Class< U > | utilClass |
| The class used for utility values. | |
JUnit test of the ODPOP agent.
| <V> | the type used for variable values |
| <U> | the type used for utility values |
| frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.ODPOPagentTestFullDomain | ( | String | string, |
| boolean | useCentralMailer, | ||
| boolean | useDelay, | ||
| MessageType | startMsgType, | ||
| Class< V > | domClass, | ||
| Class< U > | utilClass ) |
Creates a JUnit test case corresponding to the input method.
| string | name of the method |
| useCentralMailer | true when the central mailer is to be tested |
| useDelay | whether to use message delays |
| startMsgType | the type of the start message |
| domClass | The class used for variable values |
| utilClass | the class used for utility values |
References domClass, startMsgType, useCentralMailer, useDelay, and utilClass.
Referenced by suite().
| Collection< MessageType > frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.getMsgTypes | ( | ) |
Implements frodo2.communication.MessageListener< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_CONNECTED, frodo2.algorithms.AgentInterface< V extends Addable< V > >.AGENT_FINISHED, frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_ADDRESS_REQUEST, and frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_REPORTING.
| void frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_REPORTING, nbrAgents, notifyIn(), pipe, and pipes.
Referenced by notifyIn().

| void frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
|
private |
Overwrites the type of the start messages.
| messages | messages element |
| startMsgType | the new type of the start messages |
References startMsgType.
|
private |
Sets the type of the start message for all modules.
| startMsgType | the new type for the start message |
| JDOMException | if parsing the agent configuration file failed |
References agentDesc, setStartMsgType(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT, and startMsgType.
Referenced by setStartMsgType(), and setUp().

| void frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.setUp | ( | ) | throws Exception |
References agentDesc, mailman, maximize, nbrAgentsFinished, nbrMsgsReceived, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), pipes, queue, setStartMsgType(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, and statsGathererUTIL.

|
static |
References ODPOPagentTestFullDomain(), and suite().
Referenced by frodo2.algorithms.odpop.tests.AllTestsODPOP.suite(), and suite().

|
protected |
References agents, mailman, pipe, pipes, queue, solCollector, and statsGathererUTIL.
| void frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.testRandom | ( | boolean | useTCP, |
| Class< ? extends XCSPparser< V, U > > | parserClass ) throws JDOMException, IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException |
Tests the DPOPagent on a random problem.
| useTCP | whether TCP pipes should be used for communication between agents |
| parserClass | the class to be used when parsing a problem |
| IOException | if unable to access DPOPagent.xml |
| JDOMException | if unable to parse DPOPagent.xml |
| NoSuchMethodException | if the parser does not have a constructor that takes in a Document |
| InvocationTargetException | if the parser constructor throws an exception |
| IllegalAccessException | if the parser constructor is not accessible |
| InstantiationException | if the parser is abstract |
| IllegalArgumentException | should never happen |
References agentDesc, agents, frodo2.algorithms.AgentFactory< V extends Addable< V >, U extends Addable< U > >.createAgent(), frodo2.algorithms.test.AllTests.createRandProblem(), domClass, frodo2.communication.mailer.CentralMailer.execute(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgent(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getAgents(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.getUtility(), mailman, maximize, maxNbrAgents, maxNbrEdges, maxNbrVars, nbrAgents, nbrAgentsFinished, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.newInstance(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), pipe, queue, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setDomClass(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), solCollector, frodo2.algorithms.AbstractDCOPsolver< V extends Addable< V >, U extends Addable< U >, S extends Solution< V, U >.solve(), statsGathererDFS, statsGathererUTIL, frodo2.timeout, useCentralMailer, and utilClass.
Referenced by testRandomSharedMemory(), and testRandomTCP().

| void frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.testRandomSharedMemory | ( | ) | throws Exception |
Tests the ODPOPagent on a random problem using QueueIOPipes for inter-agent communication.
| Exception | if an error occurs |
References testRandom(), and testRandomSharedMemory().
Referenced by testRandomSharedMemory().

| void frodo2.algorithms.odpop.tests.ODPOPagentTestFullDomain< V extends Addable< V >, U extends Addable< U > >.testRandomTCP | ( | ) | throws Exception |
Tests the ODPOPagent on a random problem using TCP pipes for inter-agent communication.
| Exception | if an error occurs |
References testRandom(), and testRandomTCP().
Referenced by testRandomTCP().

|
private |
The description of the agent.
Referenced by setStartMsgType(), setUp(), and testRandom().
|
private |
All agents, indexed by their IDs.
Referenced by tearDown(), and testRandom().
|
private |
The class used for variable values.
Referenced by ODPOPagentTestFullDomain(), and testRandom().
|
private |
Used to wake up the test thread when all agents have finished.
|
private |
Used to make the test thread wait.
|
private |
The CentralMailer.
Referenced by setUp(), tearDown(), and testRandom().
|
private |
when true a maximization problem should be generated, when false a minimization problem
Referenced by setUp(), and testRandom().
|
private |
Maximum number of agents.
Referenced by testRandom().
|
private |
Maximum number of binary constraints in the problem.
Referenced by testRandom().
|
private |
|
private |
Total number of agents.
Referenced by notifyIn(), and testRandom().
|
private |
Number of agents finished.
Referenced by setUp(), and testRandom().
|
private |
Used to track the number of various types of messages received from the agents.
Referenced by setUp().
|
private |
The testers pipe.
Referenced by notifyIn(), tearDown(), and testRandom().
|
private |
For each agent, the output pipe to it.
Referenced by notifyIn(), setUp(), and tearDown().
|
private |
The queue used to listen to the agents.
Referenced by setQueue(), setUp(), tearDown(), and testRandom().
|
private |
The solution collector.
Referenced by tearDown(), and testRandom().
|
private |
The type of the start message.
Referenced by ODPOPagentTestFullDomain(), setStartMsgType(), and setStartMsgType().
|
private |
The DFS tree generation stats gatherer listening for DFS tree information.
Referenced by testRandom().
|
private |
The UTILpropagation stats gatherer listening for the solution.
Referenced by setUp(), tearDown(), and testRandom().
|
private |
true if the algorithm must be tested with the central mailer
Referenced by ODPOPagentTestFullDomain(), and testRandom().
|
private |
true if the central mailer must be tested with added delays
Referenced by ODPOPagentTestFullDomain().
|
private |
The class used for utility values.
Referenced by ODPOPagentTestFullDomain(), and testRandom().