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

Test for the ODPOP VALUE propagation module. More...

Inheritance diagram for frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >:

Public Member Functions

 VALUEpropagationTest (boolean useTCP, boolean useXML, Class< V > domClass, Class< U > utilClass)
 Constructor.
void test () throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, ClassNotFoundException, InvocationTargetException
 Runs a random test.
Collection< MessageTypegetMsgTypes ()
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< V extends Addable< V > U extends Addable< U > void startUTILpropagation (RandGraphFactory.Graph graph, Map< String, DFSview< V, U > > dfs, Map< String, Queue > queues)

Protected Member Functions

void setUp () throws Exception
void tearDown () throws Exception

Protected Attributes

XCSPparser< V, U > parser
 The XCSP parser.

Private Attributes

final int maxNbrVars = 5
 Maximum number of variables in the random graph.
final int maxNbrEdges = 10
 Maximum number of edges in the random graph.
final int maxNbrAgents = 5
 Maximum number of agents.
int nbrMsgsRemaining
 The number of output messages remaining to be received from the UTIL propagation protocol.
final Object nbrMsgsRemaining_lock = new Object ()
 Used to synchronize the access to nbrMsgsRemaining.
Map< String, Queuequeues
 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< V, U > > dfs
 The DFS corresponding to the random graph.
Document problem
 The problem to be solved.
DPOPsolver< V, U > solver
 Solver used to calculate the optimal utility.
optUtil
 The optimal utility reported by the UTILpropagation.
HashMap< String, V > assignments
 The assignments reported by the variables.
boolean useTCP
 Whether to use TCP or SharedMemory pipes.
boolean useXML
 Whether to test the XML-enabled constructor.
Class< V > domClass
 The class of variable values.
Class< U > utilClass
 The class of utility values.

Detailed Description

Test for the ODPOP VALUE propagation module.

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

Constructor & Destructor Documentation

◆ VALUEpropagationTest()

frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.VALUEpropagationTest ( boolean useTCP,
boolean useXML,
Class< V > domClass,
Class< U > utilClass )

Constructor.

Parameters
useTCPwhether to use TCP pipes or shared memory pipes
useXMLwhether to use the XML-based constructor
domClassThe class of variable values
utilClassthe class of utility values

References domClass, useTCP, useXML, and utilClass.

Referenced by suite().

Member Function Documentation

◆ getMsgTypes()

◆ notifyIn()

◆ setQueue()

◆ setUp()

void frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.setUp ( ) throws Exception
protected
See also
junit.framework.TestCase#setUp()
Todo
Also test when the signs of utilities are unrestricted, but this is currently not supported

References assignments, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.computeDFS(), dfs, domClass, frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, maxNbrVars, optUtil, parameters, parser, problem, solver, and utilClass.

Here is the call graph for this function:

◆ startUTILpropagation()

static< V extends Addable< V > U extends Addable< U > void frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.startUTILpropagation ( RandGraphFactory.Graph graph,
Map< String, DFSview< V, U > > dfs,
Map< String, Queue > queues )
static

◆ suite()

TestSuite frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.suite ( )
static
Returns
the test suite for this test

References VALUEpropagationTest().

Referenced by frodo2.algorithms.odpop.tests.AllTestsODPOP.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.tearDown ( ) throws Exception
protected
See also
junit.framework.TestCase#tearDown()

References dfs, graph, and queues.

◆ test()

void frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.test ( ) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, ClassNotFoundException, InvocationTargetException

Runs a random test.

Exceptions
IOExceptionif the method fails to create pipes
NoSuchMethodExceptionif the ADOPT class does not have a public constructor that takes in a ProblemInterface and a JDOM Element
IllegalAccessExceptionif the ADOPT class does not have a public constructor that takes in a ProblemInterface and a JDOM Element
InstantiationExceptionif the instantiation of ADOPT failed
IllegalArgumentExceptionif an error occurs in passing arguments to the constructor of ADOPT
ClassNotFoundExceptionif the utility class is not found
InvocationTargetExceptionif a module constructor throws an exception

References frodo2.communication.Queue.addIncomingMessagePolicy(), assignments, frodo2.algorithms.test.AllTests.createQueueNetwork(), dfs, domClass, 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.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getUtilClass(), frodo2.algorithms.Solution< V, 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, nbrMsgsRemaining, nbrMsgsRemaining_lock, optUtil, parameters, parser, problem, queues, frodo2.communication.Queue.setProblem(), solver, startUTILpropagation(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, test(), useTCP, and useXML.

Referenced by test().

Here is the call graph for this function:

Member Data Documentation

◆ assignments

HashMap<String, V> frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.assignments
private

The assignments reported by the variables.

Referenced by setUp(), and test().

◆ dfs

Map< String, DFSview<V, U> > frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.dfs
private

The DFS corresponding to the random graph.

Referenced by setUp(), startUTILpropagation(), tearDown(), and test().

◆ domClass

Class<V> frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.domClass
private

The class of variable values.

Referenced by setUp(), test(), and VALUEpropagationTest().

◆ graph

RandGraphFactory.Graph frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.graph
private

Random graph used to generate a constraint graph.

Referenced by setUp(), startUTILpropagation(), tearDown(), and test().

◆ maxNbrAgents

final int frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.maxNbrAgents = 5
private

Maximum number of agents.

Referenced by setUp().

◆ maxNbrEdges

final int frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.maxNbrEdges = 10
private

Maximum number of edges in the random graph.

Referenced by setUp().

◆ maxNbrVars

final int frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.maxNbrVars = 5
private

Maximum number of variables in the random graph.

Note
Must be at least 2.

Referenced by setUp().

◆ nbrMsgsRemaining

int frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.nbrMsgsRemaining
private

The number of output messages remaining to be received from the UTIL propagation protocol.

Referenced by test().

◆ nbrMsgsRemaining_lock

final Object frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.nbrMsgsRemaining_lock = new Object ()
private

Used to synchronize the access to nbrMsgsRemaining.

We cannot synchronize directly over nbrMsgsRemaining because it will be decremented, and hence the object will change.

Referenced by test().

◆ optUtil

U frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.optUtil
private

The optimal utility reported by the UTILpropagation.

Referenced by setUp(), and test().

◆ parameters

Element frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.parameters
private

The parameters for adopt.

Referenced by setUp(), and test().

◆ parser

XCSPparser<V, U> frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.parser
protected

The XCSP parser.

Referenced by setUp(), and test().

◆ problem

Document frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.problem
private

The problem to be solved.

Referenced by setUp(), and test().

◆ queues

Map<String, Queue> frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.queues
private

List of queues, indexed by agent name.

Referenced by startUTILpropagation(), tearDown(), and test().

◆ solver

DPOPsolver<V, U> frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.solver
private

Solver used to calculate the optimal utility.

Referenced by setUp(), and test().

◆ useTCP

boolean frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.useTCP
private

Whether to use TCP or SharedMemory pipes.

Referenced by test(), and VALUEpropagationTest().

◆ useXML

boolean frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.useXML
private

Whether to test the XML-enabled constructor.

Referenced by test(), and VALUEpropagationTest().

◆ utilClass

Class<U> frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.utilClass
private

The class of utility values.

Referenced by setUp(), and VALUEpropagationTest().


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