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

Classes | |
| class | Listener |
| The listener that checks the messages sent by the UTILpropagation listeners. More... | |
Public Member Functions | |
| UTILpropagationTest (String method) | |
| Constructor that instantiates a test only for the input method. | |
| UTILpropagationTest (boolean useTCP, boolean useXML, Class< U > utilClass, boolean minNCCCs) | |
| Constructor. | |
| void | testComputeDFS () |
| A test method that tests the test helper method computeDFS(). | |
| void | test () throws Exception |
| Tests the UTIL propagation protocol on a random graph. | |
Static Public Member Functions | |
| static TestSuite | suite () |
| static< V extends Addable< V > U extends Addable< U > Map< String, DFSview< V, U > > | computeDFS (Graph graph, DCOPProblemInterface< V, U > problem) |
| static< V extends Addable< V > U extends Addable< U > Map< String, DFSview< V, U > > | computeDFS (Graph graph, DCOPProblemInterface< V, U > problem, boolean withSharedVars) |
| static< U extends Addable< U > Map< String, UtilitySolutionSpace< AddableInteger, U > > | startUTIL (RandGraphFactory.Graph graph, Map< String, DFSview< AddableInteger, U > > dfs, Map< String, Queue > queues, List< ? extends UtilitySolutionSpace< AddableInteger, U > > constraints) |
| Sends messages to the queues to initiate the UTIL propagation. | |
Protected Member Functions | |
| void | setUp () |
| void | tearDown () throws Exception |
| Ends all queues. | |
| Listener | newListenerInstance (boolean useTCP, boolean useXML, Element parameters) throws Exception |
| Creates a new Listener. | |
Protected 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. | |
| RandGraphFactory.Graph | graph |
| Random graph used to generate a constraint graph. | |
| Map< String, DFSview< AddableInteger, U > > | dfs |
| The DFS corresponding to the random graph. | |
| Element | parameters |
| The parameters for the module under test. | |
| boolean | maximize |
| Whether we should maximize or minimize. | |
| int | sign = 0 |
| The desired sign for the utilities (if 0, utilities can be either sign). | |
Private Attributes | |
| Map< String, Queue > | queues |
| List of queues, indexed by agent name. | |
| Map< String, String[] > | separators |
| For each variable, the list of variables in its separator. | |
| 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. | |
| boolean | minNCCCs |
| Whether to optimize runtime or constraint checks. | |
JUnit test for the class UTILpropagation.
| <U> | the type used for utility values |
| frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.UTILpropagationTest | ( | String | method | ) |
Constructor that instantiates a test only for the input method.
| method | test method |
Referenced by suite().
| frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.UTILpropagationTest | ( | boolean | useTCP, |
| boolean | useXML, | ||
| Class< U > | utilClass, | ||
| boolean | minNCCCs ) |
|
static |
References computeDFS(), and graph.
Referenced by computeDFS(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.adopt.test.testADOPT.setUp(), frodo2.algorithms.adopt.test.testPreprocessing.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.setUp(), frodo2.algorithms.dpop.stochastic.test.SamplingPhaseTest.setUp(), frodo2.algorithms.duct.tests.NormalizeInfTest.setUp(), frodo2.algorithms.duct.tests.NormalizeTest.setUp(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.setUp(), and testComputeDFS().

|
static |
References frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.addChild(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.addPseudoChild(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.addPseudoParent(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getAllPseudoChildren(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getChildren(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getOwner(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSolutionSpaces(), graph, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.setParent(), and frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.setSpaces().

|
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 |
| parameters | the parameters for the module under test |
| Exception | if an error occurs |
Reimplemented in frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >, and frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.
References parameters, useTCP, and useXML.
Referenced by test().
|
protected |
Reimplemented in frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >, and frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.
References frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, maxNbrVars, minNCCCs, parameters, and useXML.

|
static |
Sends messages to the queues to initiate the UTIL propagation.
| <U> | the type used for utility values |
| graph | the constraint graph |
| dfs | the corresponding DFS (for each node in the graph, the relationships of this node) |
| queues | the array of queues, indexed by the names of the clusters in the graph |
| constraints | the hypercubes in the problem definition |
References dfs, frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getAllPseudoChildren(), frodo2.algorithms.varOrdering.dfs.DFSgeneration< V extends Addable< V >, U extends Addable< U > >.DFSview< V extends Addable< V >, U extends Addable< U > >.getChildren(), graph, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), queues, frodo2.communication.Queue.sendMessageToSelf(), and frodo2.algorithms.AgentInterface< V extends Addable< V > >.START_AGENT.
Referenced by frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.waitForOutputs(), and frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().

|
static |
Reimplemented in frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >, and frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.
References UTILpropagationTest().
Referenced by frodo2.algorithms.dpop.test.AllTestsDPOP.suite().

|
protected |
Ends all queues.
References dfs, graph, parameters, queues, and separators.
| void frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.test | ( | ) | throws Exception |
Tests the UTIL propagation protocol on a random graph.
| Exception | if an error occurs |
References newListenerInstance(), useTCP, useXML, and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().

| void frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.testComputeDFS | ( | ) |
A test method that tests the test helper method computeDFS().
References frodo2.algorithms.varOrdering.dfs.tests.DFSgenerationTest.checkDFS(), computeDFS(), dfs, frodo2.algorithms.test.AllTests.generateProblem(), graph, maximize, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.setUtilClass(), sign, and testComputeDFS().
Referenced by testComputeDFS().

|
protected |
The DFS corresponding to the random graph.
Referenced by frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.simulateUTIL(), startUTIL(), tearDown(), testComputeDFS(), and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
protected |
Random graph used to generate a constraint graph.
Referenced by frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.Listener.checkOutput(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.checkOutput(), computeDFS(), computeDFS(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.setUp(), setUp(), startUTIL(), tearDown(), testComputeDFS(), and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
protected |
Whether we should maximize or minimize.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.checkOutput(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.simulateUTIL(), testComputeDFS(), and UTILpropagationTest().
|
protected |
Maximum number of agents.
Referenced by setUp().
|
protected |
Maximum number of edges in the random graph.
Referenced by setUp().
|
protected |
|
private |
Whether to optimize runtime or constraint checks.
Referenced by setUp(), and UTILpropagationTest().
|
protected |
The parameters for the module under test.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.checkOutput(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.newListenerInstance(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.newListenerInstance(), newListenerInstance(), setUp(), and tearDown().
|
private |
List of queues, indexed by agent name.
Referenced by frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), startUTIL(), tearDown(), and frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.waitForOutputs().
|
private |
For each variable, the list of variables in its separator.
Referenced by frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.simulateUTIL(), and tearDown().
|
protected |
The desired sign for the utilities (if 0, utilities can be either sign).
Referenced by frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), and testComputeDFS().
|
private |
Whether to use TCP pipes or shared memory pipes.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.ExpectedUTILtest(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.newListenerInstance(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.newListenerInstance(), newListenerInstance(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.ParamUTILtest(), test(), and UTILpropagationTest().
|
private |
Whether to use the XML-based constructor.
Referenced by frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.ExpectedUTILtest(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.newListenerInstance(), frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.newListenerInstance(), newListenerInstance(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.ParamUTILtest(), setUp(), test(), and UTILpropagationTest().
|
private |
The class to use for utility values.
Referenced by frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.Listener.Listener(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.ParamUTILtest(), and UTILpropagationTest().