FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener Class Reference

The listener that checks the messages sent by the UTILpropagation and VALUEpropagation listeners. More...

Inheritance diagram for frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener:

Public Member Functions

 Listener (boolean useTCP, boolean useXML, Class< ? extends IncomingMsgPolicyInterface< MessageType > > UTILpropClass, Class< ? extends IncomingMsgPolicyInterface< MessageType > > VALUEpropClass, boolean withAnonymVars) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
 Constructor that tests the UTIL and VALUE propagation protocols on a random DFS.
Collection< MessageTypegetMsgTypes ()
 Listens to the outputs of the UTIL and VALUE propagation protocols.
void notifyIn (Message msg)
void setQueue (Queue queue)
 Does nothing.
void getStatsFromQueue (Queue queue)
void setSilent (boolean silent)
void reset ()
Public Member Functions inherited from frodo2.communication.IncomingMsgPolicyInterface< T >
default void notifyIn (Message msg, Object toAgent)
 Notifies the listener of an incoming message.

Protected Member Functions

void checkOutput ()
 Checks that the output of the module is correct.
Hypercube< AddableInteger, U > simulateUTILslice (String var)
 Simulates UTIL propagation on the subtree rooted at the input variable, doing slices instead of projections.

Protected Attributes

Map< String, UtilitySolutionSpace< AddableInteger, U > > hypercubes
 For each variable, the constraint it is responsible for enforcing.
XCSPparser< AddableInteger, U > parser
 The parser for the problem.

Private Member Functions

void waitForOutputs ()
 Waits for the outputs of the module and checks their validity.

Private Attributes

optTotalUtil
 Optimal, total utility across all connected components.
Object optTotalUtil_lock = new Object ()
 Used to synchronize access to optTotalUtil, which can be null.
Map< String, QueueOutputPipeInterfacepipes
 The pipes of the queue network, indexed by agent name.
Queue myQueue
 The Listener's own queue.
List< ? extends UtilitySolutionSpace< AddableInteger, U > > spaces
 The constraints in the problem.
SolutionCollector< AddableInteger, U > solCollector
 The statistics gatherer.

Detailed Description

The listener that checks the messages sent by the UTILpropagation and VALUEpropagation listeners.

Constructor & Destructor Documentation

◆ Listener()

frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener ( boolean useTCP,
boolean useXML,
Class< ? extends IncomingMsgPolicyInterface< MessageType > > UTILpropClass,
Class< ? extends IncomingMsgPolicyInterface< MessageType > > VALUEpropClass,
boolean withAnonymVars ) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException

Constructor that tests the UTIL and VALUE propagation protocols on a random DFS.

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
UTILpropClassthe class of the UTIL propagation module under test
VALUEpropClassthe class of the VALUE propagation module under test
withAnonymVarsif true, variables without owners are taken into account
Exceptions
IOExceptionif the method fails to create pipes
NoSuchMethodExceptionif the VALUEpropagation class does not have a public constructor that takes in a ProblemInterface and a JDOM Element
InvocationTargetExceptionif the VALUEpropagation constructor throws an exception
IllegalAccessExceptionif the VALUEpropagation class does not have a public constructor that takes in a ProblemInterface and a JDOM Element
InstantiationExceptionwould be thrown if VALUEpropagation were abstract
IllegalArgumentExceptionif the VALUEpropagation constructor does not take the proper arguments

References frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.computeDFS(), frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.dfs, frodo2.algorithms.test.AllTests.generateProblem(), getStatsFromQueue(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.graph, frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.maximize, myQueue, frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.nbrMsgsRemaining, parser, pipes, frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.queues, frodo2.communication.Queue.setProblem(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), solCollector, spaces, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.useTCP, frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.useXML, and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.utilClass.

Here is the call graph for this function:

Member Function Documentation

◆ checkOutput()

◆ getMsgTypes()

◆ getStatsFromQueue()

◆ notifyIn()

◆ reset()

◆ setQueue()

◆ setSilent()

void frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.setSilent ( boolean silent)

◆ simulateUTILslice()

Hypercube< AddableInteger, U > frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.simulateUTILslice ( String var)
protected

Simulates UTIL propagation on the subtree rooted at the input variable, doing slices instead of projections.

Parameters
varroot variable
Returns
the UTIL message that the input variable sends to its parent (if any)

References frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.dfs, hypercubes, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.optAssignments, parser, simulateUTILslice(), and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.slice().

Referenced by checkOutput(), and simulateUTILslice().

Here is the call graph for this function:

◆ waitForOutputs()

Member Data Documentation

◆ hypercubes

Map< String, UtilitySolutionSpace<AddableInteger, U> > frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.hypercubes
protected

For each variable, the constraint it is responsible for enforcing.

Referenced by simulateUTILslice(), and waitForOutputs().

◆ myQueue

Queue frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.myQueue
private

The Listener's own queue.

Referenced by Listener(), and waitForOutputs().

◆ optTotalUtil

U frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.optTotalUtil
private

Optimal, total utility across all connected components.

Referenced by checkOutput().

◆ optTotalUtil_lock

Object frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.optTotalUtil_lock = new Object ()
private

Used to synchronize access to optTotalUtil, which can be null.

◆ parser

XCSPparser<AddableInteger, U> frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.parser
protected

The parser for the problem.

Referenced by Listener(), and simulateUTILslice().

◆ pipes

Map<String, QueueOutputPipeInterface> frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.pipes
private

The pipes of the queue network, indexed by agent name.

Referenced by Listener(), and waitForOutputs().

◆ solCollector

The statistics gatherer.

Referenced by Listener().

◆ spaces

List< ? extends UtilitySolutionSpace<AddableInteger, U> > frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.spaces
private

The constraints in the problem.

Referenced by Listener(), and waitForOutputs().


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