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

Unit tests for CentralLinearOrdering. More...

Inheritance diagram for frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest:

Public Member Functions

 CentralLinearOrderingTest ()
 Constructor from a test method.
Collection< MessageTypegetMsgTypes ()
void setQueue (Queue queue)
void test () throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
 Test method.
void notifyIn (Message msg)
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

Protected Attributes

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.

Private Attributes

final int maxNbrVars = 15
 Maximum number of variables in the random graph.
final int maxNbrEdges = 100
 Maximum number of edges in the random graph.
final int maxNbrAgents = 10
 Maximum number of agents.
Graph graph
 The constraint graph for the overall problem.
XCSPparser< AddableInteger, AddableIntegerparser
 The parser for the overall problem.
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
 The number of output messages we are still waiting for.
List< String > order
 The chosen (flat) order on variables.
List< List< String > > clusteredOrder
 The chosen (clustered) order on variables.
List< String > owners
 The reported list of owners.

Detailed Description

Unit tests for CentralLinearOrdering.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ CentralLinearOrderingTest()

frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.CentralLinearOrderingTest ( )

Constructor from a test method.

Referenced by suite().

Member Function Documentation

◆ getMsgTypes()

Collection< MessageType > frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.getMsgTypes ( )

◆ notifyIn()

◆ setQueue()

void frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.setQueue ( Queue queue)

◆ setUp()

void frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.setUp ( )
protected
See also
junit.framework.TestCase#setUp()

References frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, and maxNbrVars.

Here is the call graph for this function:

◆ suite()

TestSuite frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.suite ( )
static
Returns
the suite of tests

References CentralLinearOrderingTest(), and suite().

Referenced by frodo2.algorithms.test.AllTests.suite(), and suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.tearDown ( ) throws Exception
protected
See also
junit.framework.TestCase#tearDown()

References pipes, and queues.

◆ test()

void frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.test ( ) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException

Test method.

Exceptions
IOExceptionif an I/O error occurred when creating the pipes
NoSuchMethodExceptionif the module does not have a constructor with the proper signature
IllegalArgumentExceptionshould never happen
InstantiationExceptionif the module is an abstract class
IllegalAccessExceptionif the module's constructor is not accessible
InvocationTargetExceptionif the module's constructor throws an exception

References frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.communication.Queue.end(), graph, parser, pipes, queues, frodo2.communication.Queue.setProblem(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.varOrdering.linear.OrderMsg< V extends Addable< V >, U extends Addable< U > >.STATS_MSG_TYPE, and test().

Referenced by test().

Here is the call graph for this function:

Member Data Documentation

◆ clusteredOrder

List< List<String> > frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.clusteredOrder
private

The chosen (clustered) order on variables.

◆ finished

final Condition frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.finished = finished_lock.newCondition()
protected

Used to wake up the test thread when all agents have finished.

◆ finished_lock

final ReentrantLock frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.finished_lock = new ReentrantLock ()
protected

Used to make the test thread wait.

◆ graph

Graph frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.graph
private

The constraint graph for the overall problem.

Referenced by setUp(), and test().

◆ maxNbrAgents

final int frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.maxNbrAgents = 10
private

Maximum number of agents.

Referenced by setUp().

◆ maxNbrEdges

final int frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.maxNbrEdges = 100
private

Maximum number of edges in the random graph.

Referenced by setUp().

◆ maxNbrVars

final int frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.maxNbrVars = 15
private

Maximum number of variables in the random graph.

Note
Must be at least 2.

Referenced by setUp().

◆ order

List<String> frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.order
private

The chosen (flat) order on variables.

◆ owners

List<String> frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.owners
private

The reported list of owners.

◆ parser

XCSPparser<AddableInteger, AddableInteger> frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.parser
private

The parser for the overall problem.

Referenced by test().

◆ pipes

Map<String, QueueOutputPipeInterface> frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.pipes
private

One output pipe used to send messages to each queue, indexed by the queue's agent name.

Referenced by tearDown(), and test().

◆ queues

Map<String, Queue> frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.queues
private

List of queues, indexed by agent name.

Referenced by tearDown(), and test().

◆ remainingOutputs

int frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.remainingOutputs
private

The number of output messages we are still waiting for.


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