|
FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
|
JUnit tests for the Preprocessing module. More...

Classes | |
| class | receiveLowerBounds |
| class | forwardHeuristicsMessage |
| This listener simply forwards all Heuristics messages to the central stats reporter. More... | |
Public Member Functions | |
| testPreprocessing (String method) | |
| Constructor that instantiates a test only for the input method. | |
| void | testSimpleHeuristic () throws Exception |
| Test for the simple heuristic that only returns zeros. | |
| void | testDP0Heuristic () throws Exception |
| Test for the DP0 heuristic. | |
| void | testDP1Heuristic () throws Exception |
| Test for the DP1 heuristic. | |
| void | testDP2Heuristic () throws Exception |
| Test the heuristics for DP2. | |
Static Public Member Functions | |
| static TestSuite | suite () |
Protected Member Functions | |
| void | setUp () throws Exception |
| void | tearDown () throws Exception |
Package Attributes | |
| ArrayList< String > | variables |
| A list variables. | |
| HashMap< String, AddableInteger[]> | domains |
| The domain of all the variables. | |
Private Member Functions | |
| void | testRandom (String heuristic) throws Exception |
Tests the Preprocessing listener with heuristic. | |
| UtilitySolutionSpace< AddableInteger, AddableInteger > | calculateDP1 (String variable, List< ? extends UtilitySolutionSpace< AddableInteger, AddableInteger > > spaces) |
| Centrally calculate the DP1 heuristics. | |
| UtilitySolutionSpace< AddableInteger, AddableInteger > | calculateDP2 (String variable, List< ? extends UtilitySolutionSpace< AddableInteger, AddableInteger > > spaces) |
| Pre calculates the h-values belonging to DP2. | |
Private Attributes | |
| final int | maxNbrVars = 5 |
| Maximum number of variables in the random graph. | |
| final int | maxNbrEdges = 10 |
| Maximum number of edges in the random graph. | |
| final int | maxNbrAgents = 5 |
| Maximum number of agents. | |
| Map< String, Queue > | queues |
| The queue we are listening to, indexed by agent name. | |
| 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. | |
| int | counter |
| Counts the number of messages received. | |
| XCSPparser< AddableInteger, AddableInteger > | parser |
| The random problem. | |
| Map< String, DFSview< AddableInteger, AddableInteger > > | dfs |
| The DFS belonging to the problem. | |
| Graph | graph |
| The constraint graph of the problem. | |
| HashMap< String, UtilitySolutionSpace< AddableInteger, AddableInteger > > | precalculated_h |
| The proper h values, calculated centrally. | |
JUnit tests for the Preprocessing module.
| frodo2.algorithms.adopt.test.testPreprocessing.testPreprocessing | ( | String | method | ) |
Constructor that instantiates a test only for the input method.
| method | test method |
Referenced by suite().
|
private |
Centrally calculate the DP1 heuristics.
| variable | The variable for which the heuristics must be calculated |
| spaces | A list with all the constraints of the problem |
References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.blindProject(), calculateDP1(), dfs, domains, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), parser, frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF, precalculated_h, and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.resolve().
Referenced by calculateDP1(), and testDP1Heuristic().

|
private |
Pre calculates the h-values belonging to DP2.
| variable | The variable for whom to calculate the value |
| spaces | The problem |
variable References frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.blindProject(), calculateDP2(), dfs, domains, frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.join(), parser, frodo2.solutionSpaces.AddableInteger.PlusInfinity.PLUS_INF, precalculated_h, and frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.resolve().
Referenced by calculateDP2(), and testDP2Heuristic().

|
protected |
References frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.computeDFS(), counter, dfs, domains, frodo2.algorithms.test.AllTests.generateProblem(), frodo2.algorithms.RandGraphFactory.getRandGraph(), graph, maxNbrAgents, maxNbrEdges, maxNbrVars, parser, precalculated_h, and variables.

|
static |
References testPreprocessing().
Referenced by frodo2.algorithms.adopt.test.AllTestsADOPT.suite().

|
protected |
References precalculated_h, and queues.
| void frodo2.algorithms.adopt.test.testPreprocessing.testDP0Heuristic | ( | ) | throws Exception |
Test for the DP0 heuristic.
| Exception | if an error occurs |
References testRandom().

| void frodo2.algorithms.adopt.test.testPreprocessing.testDP1Heuristic | ( | ) | throws Exception |
Test for the DP1 heuristic.
| Exception | if an error occurs |
References calculateDP1(), dfs, parser, and testRandom().

| void frodo2.algorithms.adopt.test.testPreprocessing.testDP2Heuristic | ( | ) | throws Exception |
Test the heuristics for DP2.
| Exception | if an error occurs |
References calculateDP2(), dfs, parser, and testRandom().

|
private |
Tests the Preprocessing listener with heuristic.
| heuristic | the heuristic to use in the test |
| Exception | if an error occurs |
References frodo2.communication.Queue.addIncomingMessagePolicy(), counter, frodo2.algorithms.test.AllTests.createQueueNetwork(), dfs, frodo2.communication.Queue.end(), frodo2.solutionSpaces.DCOPProblemInterface< V extends Addable< V >, U extends Addable< U > >.getSubProblem(), graph, frodo2.algorithms.XCSPparser< V extends Addable< V >, U extends Addable< U > >.parse(), parser, queues, frodo2.communication.Queue.sendMessageToSelf(), frodo2.communication.Queue.setProblem(), frodo2.algorithms.AgentInterface< V extends Addable< V > >.STATS_MONITOR, and variables.
Referenced by testDP0Heuristic(), testDP1Heuristic(), testDP2Heuristic(), and testSimpleHeuristic().

| void frodo2.algorithms.adopt.test.testPreprocessing.testSimpleHeuristic | ( | ) | throws Exception |
Test for the simple heuristic that only returns zeros.
| Exception | if an error occurs |
References testRandom().

|
private |
Counts the number of messages received.
Referenced by setUp(), and testRandom().
|
private |
The DFS belonging to the problem.
Referenced by calculateDP1(), calculateDP2(), setUp(), testDP1Heuristic(), testDP2Heuristic(), and testRandom().
|
package |
The domain of all the variables.
Referenced by calculateDP1(), calculateDP2(), frodo2.algorithms.adopt.test.testPreprocessing.receiveLowerBounds.notifyIn(), and setUp().
|
private |
Used to wake up the test thread when all agents have finished.
|
private |
Used to make the test thread wait.
|
private |
The constraint graph of the problem.
Referenced by setUp(), and testRandom().
|
private |
Maximum number of agents.
Referenced by setUp().
|
private |
Maximum number of edges in the random graph.
Referenced by setUp().
|
private |
|
private |
The random problem.
Referenced by calculateDP1(), calculateDP2(), setUp(), testDP1Heuristic(), testDP2Heuristic(), and testRandom().
|
private |
The proper h values, calculated centrally.
Referenced by calculateDP1(), calculateDP2(), setUp(), and tearDown().
|
private |
The queue we are listening to, indexed by agent name.
Referenced by tearDown(), and testRandom().
|
package |
A list variables.
Referenced by setUp(), and testRandom().