FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest Class Reference

JUnit tests for ExpectedUTIL. More...

Inheritance diagram for frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest:

Classes

class  Listener
 The listener that checks the messages sent by the ExpectedUTIL listeners. More...

Public Member Functions

 ExpectedUTILtest (boolean useTCP, boolean useXML, Method method, int nbrSamples)
 Constructor.
Public Member Functions inherited from frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >
 UTILpropagationTest (String method)
 Constructor that instantiates a test only for the input method.
 UTILpropagationTest (boolean useTCP, boolean useXML, Class< U > utilClass, boolean minNCCCs)
 Constructor.
void testComputeDFS ()
 A test method that tests the test helper method computeDFS().
void test () throws Exception
 Tests the UTIL propagation protocol on a random graph.

Static Public Member Functions

static TestSuite suite ()
Static Public Member Functions inherited from frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >
static< V extends Addable< V > U extends Addable< U > Map< String, DFSview< V, U > > computeDFS (Graph graph, DCOPProblemInterface< V, U > problem)
static< V extends Addable< V > U extends Addable< U > Map< String, DFSview< V, U > > computeDFS (Graph graph, DCOPProblemInterface< V, U > problem, boolean withSharedVars)
static< U extends Addable< U > Map< String, UtilitySolutionSpace< AddableInteger, U > > startUTIL (RandGraphFactory.Graph graph, Map< String, DFSview< AddableInteger, U > > dfs, Map< String, Queue > queues, List< ? extends UtilitySolutionSpace< AddableInteger, U > > constraints)
 Sends messages to the queues to initiate the UTIL propagation.

Protected Member Functions

void setUp ()
Listener newListenerInstance (boolean useTCP, boolean useXML, Element parameters) throws Exception
 Creates a new Listener.
Protected Member Functions inherited from frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >
void tearDown () throws Exception
 Ends all queues.

Protected 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.
Protected Attributes inherited from frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >
final int maxNbrVars = 10
 Maximum number of variables in the random graph.
final int maxNbrEdges = 40
 Maximum number of edges in the random graph.
final int maxNbrAgents = 10
 Maximum number of agents.
RandGraphFactory.Graph graph
 Random graph used to generate a constraint graph.
Map< String, DFSview< AddableInteger, U > > dfs
 The DFS corresponding to the random graph.
Element parameters
 The parameters for the module under test.
boolean maximize
 Whether we should maximize or minimize.
int sign = 0
 The desired sign for the utilities (if 0, utilities can be either sign).

Private Attributes

int nbrSamples
 The number of samples.
Method method
 The method to use.

Detailed Description

JUnit tests for ExpectedUTIL.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ ExpectedUTILtest()

frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.ExpectedUTILtest ( boolean useTCP,
boolean useXML,
Method method,
int nbrSamples )

Constructor.

Parameters
useTCPwhether to use TCP pipes or shared memory pipes
useXMLwhether to use the XML-based constructor
methodthe method to use
nbrSamplesthe number of samples

References frodo2.algorithms.dpop.stochastic.ExpectedUTIL< Val extends Addable< Val >, U extends Addable< U > >.Method.EXPECTATION_MONOTONE, method, nbrSamples, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.useTCP, and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.useXML.

Referenced by suite().

Member Function Documentation

◆ newListenerInstance()

Listener frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.newListenerInstance ( boolean useTCP,
boolean useXML,
Element parameters ) throws Exception
protected

Creates a new Listener.

Parameters
useTCPtrue whether TCP pipes should be used instead of QueueIOPipes
useXMLwhether we should use the constructor that takes in XML elements or the manual constructor
parametersthe parameters for the module under test
Returns
the new listener
Exceptions
Exceptionif an error occurs

Reimplemented from frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.

References frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.parameters, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.useTCP, and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.useXML.

◆ setUp()

◆ suite()

Member Data Documentation

◆ maxNbrAgents

final int frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.maxNbrAgents = 5
protected

Maximum number of agents.

Referenced by setUp().

◆ maxNbrEdges

final int frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.maxNbrEdges = 10
protected

Maximum number of edges in the random graph.

Referenced by setUp().

◆ maxNbrVars

final int frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.maxNbrVars = 5
protected

Maximum number of variables in the random graph.

Note
Must be at least 2.

Referenced by setUp().

◆ method

Method frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.method
private

◆ nbrSamples


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