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

JUnit tests for SamplingPhase. More...

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

Public Member Functions

 SamplingPhaseTest (Class< ? extends IncomingMsgPolicyInterface< MessageType > > versionClass, String whereToProj)
 Constructor.
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
Public Member Functions inherited from frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest
 LowestCommonAncestorsTest (String method)
 Constructor that instantiates a test only for the input method.
void test () throws Exception
 Tests the output of the LowestCommonAncestors module.
void setQueue (Queue queue)
 Does nothing in this case.
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 setUp ()
void tearDown () throws Exception
void checkOutput ()
void setModules () throws Exception

Private Attributes

final int maxNbrRandVars = 10
 Maximum number of random variables in the random graph.
Document problem
 The random problem.
XCSPparser< AddableInteger, AddableRealparser
 The parser for the overall problem.
HashMap< String, DCOPProblemInterface< AddableInteger, AddableReal > > subProblems
 Each agent's subproblem.
HashMap< String, Collection< String > > allHigherRelevantRandVars
 For each variable, the random variables 1) that one of its ancestors must project out and 2) that one of its descendants is a neighbor of.
Class< ? extends IncomingMsgPolicyInterface< MessageType > > versionClass
 The inner class under test.
String whereToProj
 Where random variables should be projected out (leaves, lcas, or roots).

Additional Inherited Members

Protected Attributes inherited from frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest
final int maxNbrVars = 20
 Maximum number of variables in the random graph.
RandGraphFactory.Graph graph
 Random graph.
HashMap< String, HashSet< String > > allFlags
 For each node, its set of flags.
HashMap< String, HashSet< String > > lcas = new HashMap< String, HashSet<String> > ()
 For each node, the set of flags it is the lca of.
Map< String, Queuequeues
 List of queues, indexed by agent name.
Map< String, QueueOutputPipeInterfacepipes
 One output pipe used to send messages to each queue, indexed by the queue's agent name.
int remainingOutputs
 Current number of outputs yet to be received from the LowestCommonAncestors module.
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.
Map< String, ? extends DFSview<?, ?> > dfs
 The chosen DFS.

Detailed Description

JUnit tests for SamplingPhase.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ SamplingPhaseTest()

frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.SamplingPhaseTest ( Class< ? extends IncomingMsgPolicyInterface< MessageType > > versionClass,
String whereToProj )

Constructor.

Parameters
versionClassthe inner class under test
whereToProjwhere random variables should be projected out (leaves, lcas, or roots)

References versionClass, and whereToProj.

Referenced by suite().

Member Function Documentation

◆ checkOutput()

◆ getMsgTypes()

◆ notifyIn()

◆ setModules()

void frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setModules ( ) throws Exception
protected

◆ setUp()

◆ suite()

TestSuite frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.suite ( )
static
Returns
the test suite for this test

Reimplemented from frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.

References SamplingPhaseTest().

Referenced by frodo2.algorithms.dpop.stochastic.test.AllTestsStochDPOP.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.tearDown ( ) throws Exception
protected

Member Data Documentation

◆ allHigherRelevantRandVars

HashMap< String, Collection<String> > frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.allHigherRelevantRandVars
private

For each variable, the random variables 1) that one of its ancestors must project out and 2) that one of its descendants is a neighbor of.

Referenced by setUp().

◆ maxNbrRandVars

final int frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.maxNbrRandVars = 10
private

Maximum number of random variables in the random graph.

Referenced by setUp().

◆ parser

XCSPparser<AddableInteger, AddableReal> frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.parser
private

The parser for the overall problem.

Referenced by checkOutput(), and setModules().

◆ problem

Document frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.problem
private

The random problem.

◆ subProblems

HashMap< String, DCOPProblemInterface<AddableInteger, AddableReal> > frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.subProblems
private

Each agent's subproblem.

Referenced by checkOutput(), and setUp().

◆ versionClass

Class< ? extends IncomingMsgPolicyInterface<MessageType> > frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.versionClass
private

The inner class under test.

Referenced by SamplingPhaseTest().

◆ whereToProj

String frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.whereToProj
private

Where random variables should be projected out (leaves, lcas, or roots).

Referenced by SamplingPhaseTest().


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