FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.adopt.test.testPreprocessing Class Reference

JUnit tests for the Preprocessing module. More...

Inheritance diagram for frodo2.algorithms.adopt.test.testPreprocessing:

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, AddableIntegercalculateDP1 (String variable, List< ? extends UtilitySolutionSpace< AddableInteger, AddableInteger > > spaces)
 Centrally calculate the DP1 heuristics.
UtilitySolutionSpace< AddableInteger, AddableIntegercalculateDP2 (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, Queuequeues
 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, AddableIntegerparser
 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.

Detailed Description

JUnit tests for the Preprocessing module.

Author
Brammert Ottens

Constructor & Destructor Documentation

◆ testPreprocessing()

frodo2.algorithms.adopt.test.testPreprocessing.testPreprocessing ( String method)

Constructor that instantiates a test only for the input method.

Parameters
methodtest method

Referenced by suite().

Member Function Documentation

◆ calculateDP1()

UtilitySolutionSpace< AddableInteger, AddableInteger > frodo2.algorithms.adopt.test.testPreprocessing.calculateDP1 ( String variable,
List< ? extends UtilitySolutionSpace< AddableInteger, AddableInteger > > spaces )
private

Centrally calculate the DP1 heuristics.

Author
Brammert Ottens, 20 mei 2009
Parameters
variableThe variable for which the heuristics must be calculated
spacesA list with all the constraints of the problem
Returns
A UtilitySolutionSpace containing the heuristic values

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().

Here is the call graph for this function:

◆ calculateDP2()

UtilitySolutionSpace< AddableInteger, AddableInteger > frodo2.algorithms.adopt.test.testPreprocessing.calculateDP2 ( String variable,
List< ? extends UtilitySolutionSpace< AddableInteger, AddableInteger > > spaces )
private

◆ setUp()

void frodo2.algorithms.adopt.test.testPreprocessing.setUp ( ) throws Exception
protected

◆ suite()

TestSuite frodo2.algorithms.adopt.test.testPreprocessing.suite ( )
static
Returns
the test suite for this test

References testPreprocessing().

Referenced by frodo2.algorithms.adopt.test.AllTestsADOPT.suite().

Here is the call graph for this function:

◆ tearDown()

void frodo2.algorithms.adopt.test.testPreprocessing.tearDown ( ) throws Exception
protected
See also
junit.framework.TestCase#tearDown()

References precalculated_h, and queues.

◆ testDP0Heuristic()

void frodo2.algorithms.adopt.test.testPreprocessing.testDP0Heuristic ( ) throws Exception

Test for the DP0 heuristic.

Author
Brammert Ottens, 19 mei 2009
Exceptions
Exceptionif an error occurs

References testRandom().

Here is the call graph for this function:

◆ testDP1Heuristic()

void frodo2.algorithms.adopt.test.testPreprocessing.testDP1Heuristic ( ) throws Exception

Test for the DP1 heuristic.

Author
Brammert Ottens, 20 mei 2009
Exceptions
Exceptionif an error occurs

References calculateDP1(), dfs, parser, and testRandom().

Here is the call graph for this function:

◆ testDP2Heuristic()

void frodo2.algorithms.adopt.test.testPreprocessing.testDP2Heuristic ( ) throws Exception

Test the heuristics for DP2.

Author
Brammert Ottens, 18 jun 2009
Exceptions
Exceptionif an error occurs

References calculateDP2(), dfs, parser, and testRandom().

Here is the call graph for this function:

◆ testRandom()

◆ testSimpleHeuristic()

void frodo2.algorithms.adopt.test.testPreprocessing.testSimpleHeuristic ( ) throws Exception

Test for the simple heuristic that only returns zeros.

Author
Brammert Ottens, 19 mei 2009
Exceptions
Exceptionif an error occurs

References testRandom().

Here is the call graph for this function:

Member Data Documentation

◆ counter

int frodo2.algorithms.adopt.test.testPreprocessing.counter
private

Counts the number of messages received.

Referenced by setUp(), and testRandom().

◆ dfs

Map< String, DFSview<AddableInteger, AddableInteger> > frodo2.algorithms.adopt.test.testPreprocessing.dfs
private

The DFS belonging to the problem.

Referenced by calculateDP1(), calculateDP2(), setUp(), testDP1Heuristic(), testDP2Heuristic(), and testRandom().

◆ domains

HashMap<String, AddableInteger[]> frodo2.algorithms.adopt.test.testPreprocessing.domains
package

◆ finished

final Condition frodo2.algorithms.adopt.test.testPreprocessing.finished = finished_lock.newCondition()
private

Used to wake up the test thread when all agents have finished.

◆ finished_lock

final ReentrantLock frodo2.algorithms.adopt.test.testPreprocessing.finished_lock = new ReentrantLock ()
private

Used to make the test thread wait.

◆ graph

Graph frodo2.algorithms.adopt.test.testPreprocessing.graph
private

The constraint graph of the problem.

Referenced by setUp(), and testRandom().

◆ maxNbrAgents

final int frodo2.algorithms.adopt.test.testPreprocessing.maxNbrAgents = 5
private

Maximum number of agents.

Referenced by setUp().

◆ maxNbrEdges

final int frodo2.algorithms.adopt.test.testPreprocessing.maxNbrEdges = 10
private

Maximum number of edges in the random graph.

Referenced by setUp().

◆ maxNbrVars

final int frodo2.algorithms.adopt.test.testPreprocessing.maxNbrVars = 5
private

Maximum number of variables in the random graph.

Note
Must be at least 2.

Referenced by setUp().

◆ parser

XCSPparser<AddableInteger, AddableInteger> frodo2.algorithms.adopt.test.testPreprocessing.parser
private

◆ precalculated_h

HashMap<String, UtilitySolutionSpace<AddableInteger, AddableInteger> > frodo2.algorithms.adopt.test.testPreprocessing.precalculated_h
private

The proper h values, calculated centrally.

Referenced by calculateDP1(), calculateDP2(), setUp(), and tearDown().

◆ queues

Map<String, Queue> frodo2.algorithms.adopt.test.testPreprocessing.queues
private

The queue we are listening to, indexed by agent name.

Referenced by tearDown(), and testRandom().

◆ variables

ArrayList<String> frodo2.algorithms.adopt.test.testPreprocessing.variables
package

A list variables.

Referenced by setUp(), and testRandom().


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