FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > > Class Template Reference

A wrapper around a JaCoP DepthFirstSearch that is used to run this search in a new thread. More...

Inheritance diagram for frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >:

Public Member Functions

 JaCoPiterSearch (StoreCloneable store, IntVarCloneable[] vars, IntVarCloneable[] projectedVars, IntVarCloneable costVar, IntVarCloneable valuationVar, Lock lock, Condition nextAsked, Condition nextDelivered, V infeasibleValuation)
 Constructor.
IntVarCloneable[] getVariables ()
void run ()
void setSolution (int[] lastSolution, V lastValuation)
 The method used by the SolutionListener to record the last solution found.
int[] getSolution ()
 The method used by the iterator to get the last solution found.
getValuation ()
 The method used by the iterator to get the valuation of last solution found.
getUtility ()
 The method used by the iterator to get the utility of last solution found.
getCost ()
 The method used by the iterator to get the cost of last solution found.
void setNewBound (int newBound)
 The method used by the iterator to set the new bound on the cost variable.
int getCurrentBound ()
 The method used by the SolutionLIstener to get the current bound on the cost variable.

Package Attributes

DepthFirstSearch< IntVarCloneablesearch
 JaCoP's search strategy.

Private Attributes

StoreCloneable store
 The JaCoP store.
IntVarCloneable[] vars
 The JaCoP variables.
IntVarCloneable[] projectedVars
 The JaCoP variables whose projection has been requested.
IntVarCloneable costVar
 The cost variable.
IntVarCloneable valuationVar
 The valuation variable.
int[] solution
 The last solution found.
valuation
 The valuation of the last solution found.
final V infeasibleValuation
 The infeasible valuation.
int currentBound
 The current bound on the cost variable.
Lock lock
 The lock used to ensure that only a single thread is running at a time.
Condition nextAsked
 The condition used to signal this thread to continue the search until a next solution is found.
Condition nextDelivered
 The condition used to signal the main thread that a new solution has been found and has been delivered.

Detailed Description

A wrapper around a JaCoP DepthFirstSearch that is used to run this search in a new thread.

Author
Arnaud Jutzeler, Thomas Leaute
Parameters
<V>The class used for valuations

Constructor & Destructor Documentation

◆ JaCoPiterSearch()

frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.JaCoPiterSearch ( StoreCloneable store,
IntVarCloneable[] vars,
IntVarCloneable[] projectedVars,
IntVarCloneable costVar,
IntVarCloneable valuationVar,
Lock lock,
Condition nextAsked,
Condition nextDelivered,
V infeasibleValuation )

Constructor.

Parameters
storeThe JaCoP store
varsThe variables over which we iterate
projectedVarsThe variable whose projection has been requested
costVarThe cost variable
valuationVarThe valuation variable
lockThe lock that guarantees the mutual exclusion in the execution of the search thread and the iterator thread
nextAskedThe condition used to signal the search to continue the search
nextDeliveredThe condition used to signal the iterator thread that a new solution has been found
infeasibleValuationThe infeasible valuation

References costVar, infeasibleValuation, lock, nextAsked, nextDelivered, projectedVars, store, valuationVar, and vars.

Member Function Documentation

◆ getCost()

V frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.getCost ( )

The method used by the iterator to get the cost of last solution found.

Returns
the cost of the last solution found

◆ getCurrentBound()

int frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.getCurrentBound ( )

The method used by the SolutionLIstener to get the current bound on the cost variable.

Returns
the current bound on the cost variable

References currentBound.

Referenced by frodo2.solutionSpaces.JaCoP.IterSolutionListener< V extends Addable< V > >.executeAfterConsistency().

◆ getSolution()

int[] frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.getSolution ( )

The method used by the iterator to get the last solution found.

Returns
the last solution found

References solution.

◆ getUtility()

V frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.getUtility ( )

The method used by the iterator to get the utility of last solution found.

Returns
the utility of the last solution found

◆ getValuation()

V frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.getValuation ( )

The method used by the iterator to get the valuation of last solution found.

Returns
the valuation of the last solution found

References valuation.

◆ getVariables()

Returns
the variables

References vars.

◆ run()

void frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.run ( )
See also
java.lang.Runnable#run()

References costVar, lock, nextAsked, nextDelivered, search, store, and valuationVar.

◆ setNewBound()

void frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.setNewBound ( int newBound)

The method used by the iterator to set the new bound on the cost variable.

Parameters
newBoundThe new bound on the cost variable

Referenced by frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIter2< V extends Addable< V > >.nextUtility().

◆ setSolution()

void frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.setSolution ( int[] lastSolution,
V lastValuation )

The method used by the SolutionListener to record the last solution found.

Parameters
lastSolutionThe last solution
lastValuationThe valuation of the last solution

Member Data Documentation

◆ costVar

The cost variable.

Referenced by JaCoPiterSearch(), and run().

◆ currentBound

int frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.currentBound
private

The current bound on the cost variable.

Referenced by getCurrentBound().

◆ infeasibleValuation

final V frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.infeasibleValuation
private

The infeasible valuation.

Referenced by JaCoPiterSearch().

◆ lock

Lock frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.lock
private

The lock used to ensure that only a single thread is running at a time.

Referenced by JaCoPiterSearch(), and run().

◆ nextAsked

Condition frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.nextAsked
private

The condition used to signal this thread to continue the search until a next solution is found.

Referenced by JaCoPiterSearch(), and run().

◆ nextDelivered

Condition frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.nextDelivered
private

The condition used to signal the main thread that a new solution has been found and has been delivered.

Referenced by JaCoPiterSearch(), and run().

◆ projectedVars

IntVarCloneable [] frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.projectedVars
private

The JaCoP variables whose projection has been requested.

Referenced by JaCoPiterSearch().

◆ search

DepthFirstSearch<IntVarCloneable> frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.search
package

JaCoP's search strategy.

Referenced by run().

◆ solution

int [] frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.solution
private

The last solution found.

Referenced by getSolution().

◆ store

The JaCoP store.

Referenced by JaCoPiterSearch(), and run().

◆ valuation

V frodo2.solutionSpaces.JaCoP.JaCoPiterSearch< V extends Addable< V > >.valuation
private

The valuation of the last solution found.

Referenced by getValuation().

◆ valuationVar

The valuation variable.

Referenced by JaCoPiterSearch(), and run().

◆ vars

The JaCoP variables.

Referenced by getVariables(), and JaCoPiterSearch().


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