|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
The listener that checks the messages sent by the UTILpropagation listeners. More...

Public Member Functions | |
| Listener (boolean useTCP, boolean useXML, Element parameters, Class< ? extends StatsReporter > listenerClass, boolean withAnonymVars) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException | |
| Constructor that tests the UTIL propagation protocol on a random DFS. | |
| void | waitForOutputs () |
| Waits for the outputs of the module and checks their validity. | |
| Collection< MessageType > | getMsgTypes () |
| Listens to the outputs of the UTIL propagation protocol. | |
| void | notifyIn (Message msg) |
| void | setQueue (Queue queue) |
| Does nothing. | |
| 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 | setUpPrelimModules (Queue queue, DCOPProblemInterface< AddableInteger, U > subProblem) |
| Sets up modules that are necessary for the module under test to work. | |
| void | checkOutput () |
| Checks that the output of the module is correct. | |
| Hypercube< AddableInteger, U > | simulateUTIL (String var) |
| Simulates UTIL propagation on the subtree rooted at the input variable, while checking separators. | |
Protected Attributes | |
| Integer | nbrMsgsRemaining |
| The number of output messages remaining to be received from the UTIL propagation protocol. | |
| 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, UtilitySolutionSpace< AddableInteger, U > > | hypercubes |
| For each variable, the constraint it is responsible for enforcing. | |
| UTILpropagation< AddableInteger, U > | statsGatherer |
| The stats gatherer. | |
| XCSPparser< AddableInteger, U > | parser |
| The parser for the problem. | |
Private Attributes | |
| U | 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, QueueOutputPipeInterface > | pipes |
| 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. | |
The listener that checks the messages sent by the UTILpropagation listeners.
| frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener | ( | boolean | useTCP, |
| boolean | useXML, | ||
| Element | parameters, | ||
| Class< ? extends StatsReporter > | listenerClass, | ||
| boolean | withAnonymVars ) throws IOException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, ClassNotFoundException |
Constructor that tests the UTIL propagation protocol on a random DFS.
| useTCP | true whether TCP pipes should be used instead of QueueIOPipes |
| useXML | whether we should use the constructor that takes in XML elements or the manual constructor |
| parameters | the parameters for the module under test |
| listenerClass | the class of the listener under test |
| withAnonymVars | true if anonymous variables should be taken into account when parsing the problem |
| IOException | if the method fails to create pipes |
| NoSuchMethodException | if the UTILpropagation class does not have a public constructor that takes in a ProblemInterface and a JDOM Element |
| InvocationTargetException | if the UTILpropagation constructor throws an exception |
| IllegalAccessException | if the UTILpropagation class does not have a public constructor that takes in a ProblemInterface and a JDOM Element |
| InstantiationException | if the instantiation of UTILpropagation failed |
| IllegalArgumentException | if an error occurs in passing arguments to the constructor of UTILpropagation |
| ClassNotFoundException | if the utility class is unknown |
References frodo2.communication.Queue.addIncomingMessagePolicy(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.computeDFS(), frodo2.algorithms.test.AllTests.createQueueNetwork(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.dfs, frodo2.algorithms.test.AllTests.generateProblem(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAgents(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getAllVars(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomain(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getDomClass(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getOwners(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getProbabilitySpacePerRandVar(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getRandVars(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), frodo2.solutionSpaces.ProblemInterface< V extends Addable< V >, U extends Addable< U > >.getUtilClass(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getVarScopes(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.graph, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.maximize, myQueue, nbrMsgsRemaining, frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.OPT_UTIL_MSG_TYPE, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.parameters, parser, pipes, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.queues, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.separators, frodo2.communication.Queue.setProblem(), setUpPrelimModules(), frodo2.algorithms.AbstractProblem< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.sign, spaces, frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, statsGatherer, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.useTCP, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.useXML, and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.utilClass.

|
protected |
Checks that the output of the module is correct.
References frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.dfs, frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.getUtility(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.graph, optTotalUtil, and simulateUTIL().
Referenced by waitForOutputs().

| Collection< MessageType > frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.getMsgTypes | ( | ) |
Listens to the outputs of the UTIL propagation protocol.
Implements frodo2.communication.MessageListener< T >.
| void frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.notifyIn | ( | Message | msg | ) |
Implements frodo2.communication.IncomingMsgPolicyInterface< T >.
References frodo2.communication.MessageType.equals(), notifyIn(), and frodo2.algorithms.dpop.UTILpropagation< Val extends Addable< Val >, U extends Addable< U > >.SEPARATOR_MSG_TYPE.
Referenced by notifyIn().

| void frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.setQueue | ( | Queue | queue | ) |
Does nothing.
Implements frodo2.communication.MessageListener< T >.
|
protected |
Sets up modules that are necessary for the module under test to work.
| queue | the queue to which the modules should be added |
| subProblem | the corresponding agent's subproblem |
Referenced by Listener().
|
protected |
Simulates UTIL propagation on the subtree rooted at the input variable, while checking separators.
| var | root variable |
References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.blindProject(), frodo2.solutionSpaces.hypercube.Hypercube< V extends Addable< V >, U extends Addable< U > >.clone(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.dfs, hypercubes, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.maximize, parser, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.separators, and simulateUTIL().
Referenced by checkOutput(), and simulateUTIL().

| void frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.waitForOutputs | ( | ) |
Waits for the outputs of the module and checks their validity.
References checkOutput(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.dfs, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.graph, hypercubes, myQueue, nbrMsgsRemaining, pipes, frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.queues, spaces, and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.startUTIL().
Referenced by frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.test().

|
protected |
Used to wake up the test thread when all agents have finished.
|
protected |
Used to make the test thread wait.
|
protected |
For each variable, the constraint it is responsible for enforcing.
Referenced by simulateUTIL(), and waitForOutputs().
|
private |
The Listener's own queue.
Referenced by Listener(), and waitForOutputs().
|
protected |
The number of output messages remaining to be received from the UTIL propagation protocol.
Referenced by Listener(), and waitForOutputs().
|
private |
Optimal, total utility across all connected components.
Referenced by checkOutput().
|
private |
Used to synchronize access to optTotalUtil, which can be null.
|
protected |
The parser for the problem.
Referenced by Listener(), and simulateUTIL().
|
private |
The pipes of the queue network, indexed by agent name.
Referenced by Listener(), and waitForOutputs().
|
private |
The constraints in the problem.
Referenced by Listener(), and waitForOutputs().
|
protected |
The stats gatherer.
Referenced by Listener().