FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > > Class Template Reference

JUnit tests for AFB. More...

Inheritance diagram for frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >:

Public Member Functions

 AFBagentTest (String agentFile, boolean useXCSP, boolean useTCP, boolean useCentralMailer, boolean countNCCCs, Class< V > domClass, Class< U > utilClass, boolean maximize, int sign)
 Constructor.
void setUp () throws Exception
Public Member Functions inherited from frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >
 DPOPagentTest (boolean useXCSP, boolean useTCP, boolean useCentralMailer, boolean useDelay, Class< V > domClass, Class< U > utilClass)
 Creates a JUnit test case corresponding to the input method.
 DPOPagentTest (boolean useXCSP, boolean swap, boolean minNCCCs, boolean countNCCCs, boolean ignoreHypercubeNCCCs)
 Constructor.
 DPOPagentTest (boolean useXCSP, boolean swap, boolean minNCCCs, boolean countNCCCs, boolean ignoreHypercubeNCCCs, String dpopPath)
 Constructor.
 DPOPagentTest (Class<? extends XCSPparser< V, U > > parserClass)
 Constructor for a test with a subsolver.
 DPOPagentTest (boolean useXCSP, boolean useTCP, boolean useCentralMailer, boolean useDelay, Class< V > domClass, Class< U > utilClass, MessageType startMsgType)
 Creates a JUnit test case corresponding to the input method.
 DPOPagentTest (boolean useXCSP, boolean useTCP, boolean useCentralMailer, boolean useDelay, Class< V > domClass, Class< U > utilClass, MessageType startMsgType, Class< ? extends XCSPparser< V, U > > parserClass, boolean swap, boolean minNCCCs, boolean countNCCCs, boolean measureMsgs, boolean ignoreHypercubeNCCCs)
 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 ()

Protected Member Functions

void tearDown () throws Exception
void checkOutput ()
Protected Member Functions inherited from frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >
void setStartMsgType (MessageType startMsgType) throws JDOMException
 Sets the type of the start message for all modules.

Private Attributes

AFB< V, U > AFBmodule
 The stats gatherer.
SolutionCollector< V, U > solCollector
 The solution collector.
String agentFile
 The name of the agent configuration file.
final int sign
 The restriction on the sign of the costs/utilities.

Additional Inherited Members

Protected Attributes inherited from frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >
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
Document problemDoc
 The XCSP random problem file.
DCOPProblemInterface< V, U > problem
 The problem.
Class< V > domClass
 The class used for variable values.
Class< U > utilClass
 The class used for utility values.
UTILpropagation< V, U > utilModule
 The module listening for the optimal utility to the problem.
SolutionCollector< V, U > solCollector
 The module listening for the optimal assignment to the problem.
boolean useXCSP
 Whether to use XCSP.
MessageType startMsgType
 The type of the start message.
boolean countNCCCs
 Whether to count NCCCs.
boolean maximize = true
 Whether we should maximize or minimize.
CentralMailer mailman
 The CentralMailer.
boolean aggregate = false
 true when the weighted sum hypercube should be tested

Detailed Description

JUnit tests for AFB.

Parameters
<V>the type used for variable values
<U>the type used for utility values
Author
Alexandra Olteanu, Thomas Leaute

Constructor & Destructor Documentation

◆ AFBagentTest()

frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.AFBagentTest ( String agentFile,
boolean useXCSP,
boolean useTCP,
boolean useCentralMailer,
boolean countNCCCs,
Class< V > domClass,
Class< U > utilClass,
boolean maximize,
int sign )

Constructor.

Parameters
agentFilethe name of the agent configuration file
useXCSPwhether to use XCSP
useTCPwhether TCP pipes should be used for communication between agents
useCentralMailertrue when the central mailer should be tested
countNCCCswhether to count NCCCs
domClassclass used for variable values
utilClassclass used for utility values
maximizeWhether we should maximize or minimize
signThe restriction on the sign of the costs/utilities

References AFBagentTest(), agentFile, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.countNCCCs, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.domClass, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.maximize, sign, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.useCentralMailer, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.useTCP, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.useXCSP, and frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.utilClass.

Referenced by AFBagentTest(), and suite().

Here is the call graph for this function:

Member Function Documentation

◆ checkOutput()

◆ setUp()

void frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.setUp ( ) throws Exception
See also
DPOPagentTest.setUp()

Reimplemented from frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.

References frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.agentConfig, agentFile, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.countNCCCs, frodo2.communication.MessageType.fromXML(), frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.getStatsFromQueue(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.graph, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.maximize, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.problem, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.problemDoc, frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.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.SingleQueueAgent< Val extends Addable< Val > >.setMsgType(), frodo2.algorithms.afb.AFB< V extends Addable< V >, U extends Addable< U > >.setSilent(), frodo2.algorithms.SolutionCollector< V extends Addable< V >, U extends Addable< U > >.setSilent(), frodo2.algorithms.varOrdering.linear.LinearOrdering< V extends Addable< V >, U extends Addable< U > >.setSilent(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), and frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.utilClass.

Here is the call graph for this function:

◆ suite()

TestSuite frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.suite ( )
static
Returns
the test suite

Reimplemented from frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.

References AFBagentTest(), and suite().

Referenced by suite(), and frodo2.algorithms.afb.test.AllTestsAFB.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.tearDown ( ) throws Exception
protected

Member Data Documentation

◆ AFBmodule

AFB<V, U> frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.AFBmodule
private

The stats gatherer.

◆ agentFile

String frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.agentFile
private

The name of the agent configuration file.

Referenced by AFBagentTest(), and setUp().

◆ sign

final int frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.sign
private

The restriction on the sign of the costs/utilities.

Referenced by AFBagentTest().

◆ solCollector

SolutionCollector<V, U> frodo2.algorithms.afb.test.AFBagentTest< V extends Addable< V >, U extends Addable< U > >.solCollector
private

The solution collector.


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