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

Test case for the module SecureCircularRouting. More...

Inheritance diagram for frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest:

Classes

class  TestMessage
 A message holding the sender variable and the number of variables visited so far. More...
class  Forwarder
 A test listener that asks the SecureCircularRouting message, for each variable, to forward a message forward all the way until it comes back, and same backwards. More...

Public Member Functions

 SecureCircularRoutingTest (String name, boolean useTCP)
 Constructor from a method name.
Collection< MessageTypegetMsgTypes ()
void notifyIn (Message msg)
void setQueue (Queue queue)
void test ()
 Tests the forwarding of a message from the first variable to last, and back to the first.
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 () throws Exception
void tearDown ()

Private Attributes

Graph graph
 The random graph.
XCSPparser< AddableInteger, AddableIntegerparser
 The parser for the whole problem.
Map< String, Queuequeues
 The queue of each agent, indexed by agent name.
Map< String, QueueOutputPipeInterfacepipes
 The pipe to send message to each agent, indexed by agent name.
int countdown
 Countdown until the test terminates.
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.
Queue myQueue
 The stats gatherer's queue.
HashMap< String, DFSview< AddableInteger, AddableInteger > > dfs
 The underlying DFS.
final boolean useTCP
 Whether to use TCP pipes.

Static Private Attributes

static final int maxNbrVars = 50
 The maximum number of variables in the random test problems.
static final int maxNbrEdges = 200
 The maximum number of edges in the random test problems.
static final int maxNbrAgents = 10
 The maximum number of agents in the random test problems.
static final MessageType TEST_FWD_MSG_TYPE = new MessageType ("Test forward message")
 The type of the test forward message.
static final MessageType TEST_BACK_MSG_TYPE = new MessageType ("Test backward message")
 The type of the test backward message.

Detailed Description

Test case for the module SecureCircularRouting.

Author
Thomas Leaute

Constructor & Destructor Documentation

◆ SecureCircularRoutingTest()

frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.SecureCircularRoutingTest ( String name,
boolean useTCP )

Constructor from a method name.

Parameters
namethe name of the test method
useTCPwhether to use TCP pipes

References useTCP.

Referenced by suite().

Member Function Documentation

◆ getMsgTypes()

◆ notifyIn()

void frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.notifyIn ( Message msg)

◆ setQueue()

void frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.setQueue ( Queue queue)

◆ setUp()

◆ suite()

TestSuite frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.suite ( )
static
Returns
the suite of tests

References SecureCircularRoutingTest(), and suite().

Referenced by frodo2.algorithms.dpop.privacy.test.AllTestsP_DPOP.suite(), and suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.tearDown ( )
protected
See also
junit.framework.TestCase#tearDown()

References frodo2.communication.Queue.end().

Here is the call graph for this function:

◆ test()

void frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.test ( )

Tests the forwarding of a message from the first variable to last, and back to the first.

References graph, queues, and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.

Member Data Documentation

◆ countdown

int frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.countdown
private

Countdown until the test terminates.

Referenced by notifyIn().

◆ dfs

HashMap< String, DFSview<AddableInteger, AddableInteger> > frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.dfs
private

The underlying DFS.

Referenced by setUp().

◆ finished

final Condition frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.finished = finished_lock.newCondition()
private

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

Referenced by notifyIn().

◆ finished_lock

final ReentrantLock frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.finished_lock = new ReentrantLock ()
private

Used to make the test thread wait.

Referenced by notifyIn().

◆ graph

Graph frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.graph
private

The random graph.

Referenced by setUp(), and test().

◆ maxNbrAgents

final int frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.maxNbrAgents = 10
staticprivate

The maximum number of agents in the random test problems.

Referenced by setUp().

◆ maxNbrEdges

final int frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.maxNbrEdges = 200
staticprivate

The maximum number of edges in the random test problems.

Referenced by setUp().

◆ maxNbrVars

final int frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.maxNbrVars = 50
staticprivate

The maximum number of variables in the random test problems.

Referenced by setUp().

◆ myQueue

Queue frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.myQueue
private

The stats gatherer's queue.

Referenced by setUp().

◆ parser

XCSPparser<AddableInteger, AddableInteger> frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.parser
private

The parser for the whole problem.

Referenced by setUp().

◆ pipes

Map<String, QueueOutputPipeInterface> frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.pipes
private

The pipe to send message to each agent, indexed by agent name.

◆ queues

Map<String, Queue> frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.queues
private

The queue of each agent, indexed by agent name.

Referenced by setUp(), and test().

◆ TEST_BACK_MSG_TYPE

final MessageType frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.TEST_BACK_MSG_TYPE = new MessageType ("Test backward message")
staticprivate

The type of the test backward message.

◆ TEST_FWD_MSG_TYPE

final MessageType frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.TEST_FWD_MSG_TYPE = new MessageType ("Test forward message")
staticprivate

The type of the test forward message.

◆ useTCP

final boolean frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.useTCP
private

Whether to use TCP pipes.

Referenced by SecureCircularRoutingTest(), and setUp().


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