|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
JUnit test for the class VALUEpropagation. More...

Classes | |
| class | Listener |
| The listener that checks the messages sent by the UTILpropagation and VALUEpropagation listeners. More... | |
Public Member Functions | |
| VALUEpropagationTest (boolean useTCP, boolean useXML, Class< U > utilClass) | |
| Constructor. | |
| void | test () throws Exception |
| Tests the UTIL and VALUE propagation protocols on a random graph. | |
Static Public Member Functions | |
| static TestSuite | suite () |
Protected Member Functions | |
| void | setUp () |
| void | tearDown () throws Exception |
| Ends all queues. | |
| Listener | newListenerInstance (boolean useTCP, boolean useXML) throws Exception |
| Creates a new Listener. | |
Protected Attributes | |
| Map< String, Queue > | queues = new HashMap<String, Queue> () |
| List of queues, indexed by agent name. | |
| RandGraphFactory.Graph | graph |
| Random graph used to generate a constraint graph. | |
| Map< String, DFSview< AddableInteger, U > > | dfs |
| The DFS corresponding to the random graph. | |
| boolean | maximize |
| Whether we should maximize or minimize. | |
| 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. | |
Private Attributes | |
| final int | maxNbrVars = 10 |
| Maximum number of variables in the random graph. | |
| final int | maxNbrEdges = 40 |
| Maximum number of edges in the random graph. | |
| final int | maxNbrAgents = 10 |
| Maximum number of agents. | |
| boolean | useTCP |
| Whether to use TCP pipes or shared memory pipes. | |
| boolean | useXML |
| Whether to use the XML-based constructor. | |
| Class< U > | utilClass |
| The class to use for utility values. | |
| Map< String, AddableInteger > | optAssignments |
| The optimal assignment to each variable. | |
JUnit test for the class VALUEpropagation.
| <U> | the type used for utility values |
| frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.VALUEpropagationTest | ( | boolean | useTCP, |
| boolean | useXML, | ||
| Class< U > | utilClass ) |
|
protected |
Creates a new Listener.
| 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 |
| Exception | if an error occurs |
Reimplemented in frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.
References newListenerInstance(), useTCP, and useXML.
Referenced by newListenerInstance(), and test().

|
protected |
Reimplemented in frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.
References frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maximize, maxNbrAgents, maxNbrEdges, maxNbrVars, and optAssignments.

|
static |
Reimplemented in frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.
References VALUEpropagationTest().
Referenced by frodo2.algorithms.dpop.test.AllTestsDPOP.suite().

|
protected |
Ends all queues.
Reimplemented in frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.
References dfs, graph, optAssignments, and queues.
| void frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.test | ( | ) | throws Exception |
Tests the UTIL and VALUE propagation protocols on a random graph.
| Exception | if an error occurs |
References newListenerInstance(), useTCP, useXML, and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().

|
protected |
The DFS corresponding to the random graph.
Referenced by frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.Listener.simulateUTILslice(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.simulateUTILslice(), tearDown(), and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
protected |
Used to wake up the test thread when all agents have finished.
Referenced by frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
protected |
Used to make the test thread wait.
Referenced by frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
protected |
Random graph used to generate a constraint graph.
Referenced by frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.setUp(), setUp(), tearDown(), and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
protected |
Whether we should maximize or minimize.
Referenced by frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.setUp(), setUp(), and VALUEpropagationTest().
|
private |
Maximum number of agents.
Referenced by setUp().
|
private |
Maximum number of edges in the random graph.
Referenced by setUp().
|
private |
|
protected |
The number of output messages remaining to be received from the UTIL propagation protocol.
Referenced by frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
private |
The optimal assignment to each variable.
Referenced by setUp(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.simulateUTILslice(), and tearDown().
|
protected |
List of queues, indexed by agent name.
Referenced by frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), tearDown(), and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
private |
Whether to use TCP pipes or shared memory pipes.
Referenced by frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.newListenerInstance(), newListenerInstance(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.ParamVALUEtest(), test(), and VALUEpropagationTest().
|
private |
Whether to use the XML-based constructor.
Referenced by frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.newListenerInstance(), newListenerInstance(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.ParamVALUEtest(), test(), and VALUEpropagationTest().
|
private |
The class to use for utility values.
Referenced by frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.ParamVALUEtest(), and VALUEpropagationTest().