FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.duct.tests.DUCTagentChildTest Class Reference

JUnit test for DUCT. More...

Inheritance diagram for frodo2.algorithms.duct.tests.DUCTagentChildTest:

Public Member Functions

 DUCTagentChildTest (boolean useTCP, boolean useCentralMailer, boolean measureMsgs, String samplingMethodClass, String termination, String bound)
 Creates a JUnit test case corresponding to the input method.
 DUCTagentChildTest (boolean useTCP, boolean useCentralMailer, Class< ? extends XCSPparser< AddableInteger, AddableReal > > parserClass, boolean measureMsgs, String samplingMethod, String termination, String bound)
 Creates a JUnit test case corresponding to the input method.
void setUp () throws Exception
Public Member Functions inherited from frodo2.algorithms.duct.tests.DUCTagentTest
 DUCTagentTest (boolean useTCP, boolean useCentralMailer, boolean measureMsgs, String samplingMethodClass, String termination, String bound)
 Creates a JUnit test case corresponding to the input method.
 DUCTagentTest (boolean useTCP, boolean useCentralMailer, Class< ? extends XCSPparser< AddableInteger, AddableReal > > parserClass, boolean measureMsgs, String samplingMethod, String termination, String bound)
 Creates a JUnit test case corresponding to the input method.
void testRandom () throws Exception
 Tests the DPOPagent on a random problem.
Collection< MessageTypegetMsgTypes ()
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 ()

Additional Inherited Members

Protected Member Functions inherited from frodo2.algorithms.duct.tests.DUCTagentTest
void setStartMsgType (MessageType startMsgType) throws JDOMException
 Sets the type of the start message for all modules.
void tearDown () throws Exception
void checkOutput () throws Exception
 Checks that the output of the algorithm is correct.
Protected Attributes inherited from frodo2.algorithms.duct.tests.DUCTagentTest
final int maxNbrVars = 5
 Maximum number of variables in the problem.
final int maxNbrEdges = 20
 Maximum number of binary constraints in the problem.
final int maxNbrAgents = 5
 Maximum number of agents.
Document agentConfig
 The agent configuration file.
Queue queue
 The queue used to listen to the agents.
Map< Object, QueueOutputPipeInterfacepipes
 For each agent, the output pipe to it.
RandGraphFactory.Graph graph
 Random graph used to generate a constraint graph.
int nbrMsgsReceived
 Used to track the number of various types of messages received from the agents.
int nbrAgentsFinished
 Number of agents finished.
boolean useCentralMailer = false
 true if the algorithm should be tested with the central mailer
boolean measureMsgs
 Whether to measure message numbers and sizes.
Document problemDoc
 The XCSP random problem file.
Class< ? extends XCSPparser< AddableInteger, AddableReal > > parserClass
 The class of the parser/subsolver to use.
DCOPProblemInterface< AddableInteger, AddableRealproblem
 The problem.
Normalize< AddableIntegernormModule
 The module listening for the optimal utility to the problem.
Sampling< AddableIntegersamplingModule
 The module listening for the optimal assignment to the problem.
String samplingMethod
 The sampling method to be used.
String terminationMethod
 The termination method to be used.
String bound
 The bound to be used.
MessageType startMsgType
 The type of the start message.
boolean maximize = true
 Whether we should maximize or minimize.
CentralMailer mailman
 The CentralMailer.

Detailed Description

JUnit test for DUCT.

Author
Brammert Ottens
Todo
Many tests should inherit this class to favor code reuse.

Constructor & Destructor Documentation

◆ DUCTagentChildTest() [1/2]

frodo2.algorithms.duct.tests.DUCTagentChildTest.DUCTagentChildTest ( boolean useTCP,
boolean useCentralMailer,
boolean measureMsgs,
String samplingMethodClass,
String termination,
String bound )

Creates a JUnit test case corresponding to the input method.

Parameters
useTCPwhether TCP pipes should be used for communication between agents
useCentralMailertrue when the central mailer should be tested
measureMsgstrue when message sizes have to be measured
samplingMethodClassThe sampling method to be used
terminationThe termination method to be used
boundThe bound to be used

References frodo2.algorithms.duct.tests.DUCTagentTest.bound, DUCTagentChildTest(), frodo2.algorithms.duct.tests.DUCTagentTest.measureMsgs, frodo2.algorithms.duct.tests.DUCTagentTest.useCentralMailer, and frodo2.algorithms.duct.tests.DUCTagentTest.useTCP.

Referenced by DUCTagentChildTest(), and suite().

Here is the call graph for this function:

◆ DUCTagentChildTest() [2/2]

frodo2.algorithms.duct.tests.DUCTagentChildTest.DUCTagentChildTest ( boolean useTCP,
boolean useCentralMailer,
Class< ? extends XCSPparser< AddableInteger, AddableReal > > parserClass,
boolean measureMsgs,
String samplingMethod,
String termination,
String bound )

Creates a JUnit test case corresponding to the input method.

Parameters
useTCPwhether TCP pipes should be used for communication between agents
useCentralMailertrue when the central mailer should be tested
parserClassthe class of the parser/subsolver
measureMsgswhether to measure message numbers and sizes
samplingMethodThe sampling method to be used
terminationThe termination method to be used
boundThe bound to be used

References frodo2.algorithms.duct.tests.DUCTagentTest.bound, frodo2.algorithms.duct.tests.DUCTagentTest.measureMsgs, frodo2.algorithms.duct.tests.DUCTagentTest.parserClass, frodo2.algorithms.duct.tests.DUCTagentTest.samplingMethod, frodo2.algorithms.duct.tests.DUCTagentTest.useCentralMailer, and frodo2.algorithms.duct.tests.DUCTagentTest.useTCP.

Member Function Documentation

◆ setUp()

void frodo2.algorithms.duct.tests.DUCTagentChildTest.setUp ( ) throws Exception
See also
junit.framework.TestCase#setUp()

Reimplemented from frodo2.algorithms.duct.tests.DUCTagentTest.

References frodo2.algorithms.duct.tests.DUCTagentTest.agentConfig, frodo2.algorithms.duct.tests.DUCTagentTest.bound, frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.algorithms.duct.tests.DUCTagentTest.graph, frodo2.algorithms.duct.tests.DUCTagentTest.mailman, frodo2.algorithms.duct.tests.DUCTagentTest.maxNbrAgents, frodo2.algorithms.duct.tests.DUCTagentTest.maxNbrEdges, frodo2.algorithms.duct.tests.DUCTagentTest.maxNbrVars, frodo2.algorithms.duct.tests.DUCTagentTest.measureMsgs, frodo2.algorithms.duct.tests.DUCTagentTest.nbrAgentsFinished, frodo2.algorithms.duct.tests.DUCTagentTest.nbrMsgsReceived, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.newInstance(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), frodo2.algorithms.duct.tests.DUCTagentTest.parserClass, frodo2.algorithms.duct.tests.DUCTagentTest.pipes, frodo2.algorithms.duct.tests.DUCTagentTest.problem, frodo2.algorithms.duct.tests.DUCTagentTest.problemDoc, frodo2.algorithms.duct.tests.DUCTagentTest.queue, frodo2.algorithms.duct.tests.DUCTagentTest.samplingMethod, frodo2.algorithms.duct.tests.DUCTagentTest.samplingModule, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setDomClass(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.setSilent(), frodo2.algorithms.duct.tests.DUCTagentTest.setStartMsgType(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), frodo2.algorithms.duct.tests.DUCTagentTest.startMsgType, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.duct.tests.DUCTagentTest.terminationMethod, and frodo2.algorithms.duct.tests.DUCTagentTest.useCentralMailer.

Here is the call graph for this function:

◆ suite()

TestSuite frodo2.algorithms.duct.tests.DUCTagentChildTest.suite ( )
static
Returns
the test suite

Reimplemented from frodo2.algorithms.duct.tests.DUCTagentTest.

References DUCTagentChildTest(), and suite().

Referenced by frodo2.algorithms.duct.tests.AllTestsDUCT.suite(), and suite().

Here is the call graph for this function:

The documentation for this class was generated from the following file: