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

Public Member Functions | |
| MGM2agentTest (boolean useXCSP, boolean useTCP, boolean countNCCCs, boolean useCentralMailer, MessageType startMsgType, Class< V > domClass, Class< U > utilClass) | |
| Creates a JUnit test case corresponding to the input method. | |
| void | setUp () throws Exception |
| void | testRandom () |
| Tests the DSAagent 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 |
Protected Attributes | |
| 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. | |
Private Member Functions | |
| void | setStartMsgType (MessageType startMsgType) throws JDOMException |
| Sets the type of the start message for all modules. | |
Private Attributes | |
| final int | maxNbrVars = 5 |
| Maximum number of variables in the problem. | |
| final int | maxNbrEdges = 10 |
| Maximum number of binary constraints in the problem. | |
| final int | maxNbrAgents = 5 |
| 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 tester's 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. | |
| boolean | useXCSP |
| Whether to use XCSP. | |
| boolean | useTCP |
| Whether TCP pipes should be used for communication between agents. | |
| boolean | countNCCCs = false |
| Whether we should count Non-Concurrent Constraint Checks. | |
| MGM2< V, U > | statsGatherer |
| The MGM stats gatherer listening for the solution. | |
| 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 | |
| DCOPProblemInterface< V, U > | problem |
| The overall problem. | |
| CentralMailer | mailman |
| The CentralMailer. | |
| Class< V > | domClass |
| The class used for variable values. | |
| Class< U > | utilClass |
| The class used for utility values. | |
JUnit tests for the MGM agent.
| <V> | the type used for variable values |
| <U> | the type used for utility values |
| frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.MGM2agentTest | ( | boolean | useXCSP, |
| boolean | useTCP, | ||
| boolean | countNCCCs, | ||
| boolean | useCentralMailer, | ||
| MessageType | startMsgType, | ||
| Class< V > | domClass, | ||
| Class< U > | utilClass ) |
Creates a JUnit test case corresponding to the input method.
| useXCSP | Whether to use XCSP |
| useTCP | whether TCP pipes should be used for communication between agents |
| countNCCCs | whether we should tell the agent to count NCCCs |
| useCentralMailer | true when the central mailer should be used and tested |
| startMsgType | the type of the start message |
| domClass | The class used for variable values |
| utilClass | the class used for utility values |
References countNCCCs, domClass, startMsgType, useCentralMailer, useTCP, useXCSP, and utilClass.
Referenced by suite().
| Collection< MessageType > frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< 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.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.ASSIGNMENT_MSG_TYPE, 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.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.communication.MessageType.equals(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.LOCAL_AGENT_REPORTING, nbrAgents, notifyIn(), pipe, and pipes.
Referenced by notifyIn().

| void frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.setQueue | ( | Queue | queue | ) |
|
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 frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT, and startMsgType.
Referenced by setUp().
| void frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.setUp | ( | ) | throws Exception |
References agentDesc, mailman, nbrAgentsFinished, nbrMsgsReceived, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), pipes, queue, setStartMsgType(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR.

|
static |
References MGM2agentTest(), and suite().
Referenced by suite(), and frodo2.algorithms.test.AllTests.suite().

|
protected |
| void frodo2.algorithms.localSearch.mgm.mgm2.tests.MGM2agentTest< V extends Addable< V >, U extends Addable< U > >.testRandom | ( | ) |
Tests the DSAagent on a random problem.
References agentDesc, agents, countNCCCs, 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(), mailman, maxNbrAgents, maxNbrEdges, maxNbrVars, nbrAgents, nbrAgentsFinished, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), pipe, problem, queue, frodo2.algorithms.Problem< V extends Addable< V >, U extends Addable< U > >.reset(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setDomClass(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), statsGatherer, frodo2.timeout, useCentralMailer, and useTCP.

|
private |
The description of the agent.
Referenced by setUp(), and testRandom().
|
private |
All agents, indexed by their IDs.
Referenced by tearDown(), and testRandom().
|
private |
Whether we should count Non-Concurrent Constraint Checks.
Referenced by MGM2agentTest(), and testRandom().
|
private |
The class used for variable values.
Referenced by MGM2agentTest(), and testRandom().
|
protected |
Used to wake up the test thread when all agents have finished.
|
protected |
Used to make the test thread wait.
|
private |
The CentralMailer.
Referenced by setUp(), tearDown(), 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 tester's pipe.
Referenced by notifyIn(), tearDown(), and testRandom().
|
private |
For each agent, the output pipe to it.
Referenced by notifyIn(), setUp(), and tearDown().
|
private |
The overall problem.
Referenced by testRandom().
|
private |
The queue used to listen to the agents.
Referenced by setQueue(), setUp(), tearDown(), and testRandom().
|
private |
The type of the start message.
Referenced by MGM2agentTest(), and setStartMsgType().
|
private |
The MGM stats gatherer listening for the solution.
Referenced by tearDown(), and testRandom().
|
private |
true if the algorithm must be tested with the central mailer
Referenced by MGM2agentTest(), and testRandom().
|
private |
Whether TCP pipes should be used for communication between agents.
Referenced by MGM2agentTest(), and testRandom().
|
private |
Whether to use XCSP.
Referenced by MGM2agentTest().
|
private |
The class used for utility values.
Referenced by MGM2agentTest().