FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.duct.tests.NormalizeInfTest Class Reference
Inheritance diagram for frodo2.algorithms.duct.tests.NormalizeInfTest:

Public Member Functions

 NormalizeInfTest (boolean useTCP)
void test () throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, ClassNotFoundException, InvocationTargetException
 Runs a random test.
void setQueue (Queue queue)
Collection< MessageTypegetMsgTypes ()
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 ()
static void startNormalization (RandGraphFactory.Graph graph, Map< String, DFSview< AddableInteger, AddableReal > > dfs, Map< String, Queue > queues)
 Sends messages to the queues to initiate O-DPOP.

Protected Member Functions

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

Protected Attributes

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< AddableInteger, AddableReal > > dfs
 The DFS corresponding to the random graph.
Document problem
 The problem to be solved.
DPOPsolver< AddableInteger, AddableRealsolver
 Solver used to calculate the optimal utility.
XCSPparser< AddableInteger, AddableRealparser
 The XCSP parser.
AddableReal optUtil
 The optimal utility reported by the UTILpropagation.
boolean useTCP
 Whether to use TCP or SharedMemory pipes.
Queue myQueue
 The queue this class listens to.

Private Attributes

final int maxNbrVars = 5
 Maximum number of variables in the random graph.
final int maxNbrEdges = 9
 Maximum number of edges in the random graph.
final int maxNbrAgents = 5
 Maximum number of agents.
HashMap< String, ArrayList< UtilitySolutionSpace< AddableInteger, AddableReal > > > spaces
 List of normalized spaces.

Detailed Description

Author
Brammert Ottens, 17 aug. 2011

Constructor & Destructor Documentation

◆ NormalizeInfTest()

frodo2.algorithms.duct.tests.NormalizeInfTest.NormalizeInfTest ( boolean useTCP)
Parameters
useTCPwhen true TCP pipes are used for communication, otherwise IO pipes

References useTCP.

Referenced by suite().

Member Function Documentation

◆ getMsgTypes()

◆ notifyIn()

◆ setQueue()

void frodo2.algorithms.duct.tests.NormalizeInfTest.setQueue ( Queue queue)

◆ setUp()

◆ startNormalization()

void frodo2.algorithms.duct.tests.NormalizeInfTest.startNormalization ( RandGraphFactory.Graph graph,
Map< String, DFSview< AddableInteger, AddableReal > > dfs,
Map< String, Queue > queues )
static

Sends messages to the queues to initiate O-DPOP.

Parameters
graphthe constraint graph
dfsthe corresponding DFS (for each node in the graph, the relationships of this node)
queuesthe array of queues, indexed by the names of the clusters in the graph

References dfs, graph, queues, frodo2.communication.Queue.sendMessageToSelf(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.

Referenced by test().

Here is the call graph for this function:

◆ suite()

TestSuite frodo2.algorithms.duct.tests.NormalizeInfTest.suite ( )
static
Returns
the test suite for this test

References NormalizeInfTest().

Referenced by frodo2.algorithms.duct.tests.AllTestsDUCT.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.duct.tests.NormalizeInfTest.tearDown ( ) throws Exception
protected
See also
junit.framework.TestCase#tearDown()

References dfs, graph, and queues.

◆ test()

void frodo2.algorithms.duct.tests.NormalizeInfTest.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 the UTILpropagation constructor throws an exception

References frodo2.solutionSpaces.AddableReal.add(), frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.solutionSpaces.AddableReal.compareTo(), frodo2.algorithms.test.AllTests.createQueueNetwork(), dfs, frodo2.solutionSpaces.AddableReal.equals(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), graph, myQueue, nbrMsgsRemaining, nbrMsgsRemaining_lock, parameters, parser, problem, queues, frodo2.communication.Queue.setProblem(), spaces, startNormalization(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, test(), and useTCP.

Referenced by test().

Here is the call graph for this function:

Member Data Documentation

◆ dfs

Map<String, DFSview<AddableInteger, AddableReal> > frodo2.algorithms.duct.tests.NormalizeInfTest.dfs
protected

The DFS corresponding to the random graph.

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

◆ graph

RandGraphFactory.Graph frodo2.algorithms.duct.tests.NormalizeInfTest.graph
protected

Random graph used to generate a constraint graph.

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

◆ maxNbrAgents

final int frodo2.algorithms.duct.tests.NormalizeInfTest.maxNbrAgents = 5
private

Maximum number of agents.

Referenced by setUp().

◆ maxNbrEdges

final int frodo2.algorithms.duct.tests.NormalizeInfTest.maxNbrEdges = 9
private

Maximum number of edges in the random graph.

Referenced by setUp().

◆ maxNbrVars

final int frodo2.algorithms.duct.tests.NormalizeInfTest.maxNbrVars = 5
private

Maximum number of variables in the random graph.

Note
Must be at least 2.

Referenced by setUp().

◆ myQueue

Queue frodo2.algorithms.duct.tests.NormalizeInfTest.myQueue
protected

The queue this class listens to.

Referenced by test().

◆ nbrMsgsRemaining

int frodo2.algorithms.duct.tests.NormalizeInfTest.nbrMsgsRemaining
protected

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

Referenced by notifyIn(), and test().

◆ nbrMsgsRemaining_lock

final Object frodo2.algorithms.duct.tests.NormalizeInfTest.nbrMsgsRemaining_lock = new Object ()
protected

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 notifyIn(), and test().

◆ optUtil

AddableReal frodo2.algorithms.duct.tests.NormalizeInfTest.optUtil
protected

The optimal utility reported by the UTILpropagation.

◆ parameters

Element frodo2.algorithms.duct.tests.NormalizeInfTest.parameters
protected

The parameters for adopt.

Referenced by test().

◆ parser

XCSPparser<AddableInteger, AddableReal> frodo2.algorithms.duct.tests.NormalizeInfTest.parser
protected

The XCSP parser.

Referenced by setUp(), and test().

◆ problem

Document frodo2.algorithms.duct.tests.NormalizeInfTest.problem
protected

The problem to be solved.

Referenced by setUp(), and test().

◆ queues

Map<String, Queue> frodo2.algorithms.duct.tests.NormalizeInfTest.queues
protected

List of queues, indexed by agent name.

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

◆ solver

DPOPsolver<AddableInteger, AddableReal> frodo2.algorithms.duct.tests.NormalizeInfTest.solver
protected

Solver used to calculate the optimal utility.

Referenced by setUp().

◆ spaces

HashMap<String, ArrayList<UtilitySolutionSpace<AddableInteger, AddableReal> > > frodo2.algorithms.duct.tests.NormalizeInfTest.spaces
private

List of normalized spaces.

Referenced by notifyIn(), and test().

◆ useTCP

boolean frodo2.algorithms.duct.tests.NormalizeInfTest.useTCP
protected

Whether to use TCP or SharedMemory pipes.

Referenced by NormalizeInfTest(), and test().


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