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

A solution iterator in best first order for JaCoPutilSpace. More...

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

Public Member Functions

 JaCoPutilSpaceIterBestFirst (JaCoPutilSpace< V > space, final boolean maximize)
 Constructor.
maximalCut ()
getCurrentUtility (V bound, boolean minimize)
nextUtility (V bound, boolean minimize)
getCurrentUtility ()
nextUtility ()
void setCurrentUtility (V valuation)
AddableInteger[] getCurrentSolution ()
AddableInteger[][] getDomains ()
long getNbrSolutions ()
String[] getVariablesOrder ()
boolean hasNext ()
AddableInteger[] nextSolution ()
void update ()
Public Member Functions inherited from frodo2.solutionSpaces.UtilitySolutionSpace< V extends Addable< V >, U extends Addable< U > >.SparseIterator< V, U >
nextUtility (U bound, boolean minimize)
 Returns the next solution strictly better than the input bound.
getCurrentUtility (U bound, boolean minimize)
Public Member Functions inherited from frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.SparseIterator< V, U >
void setCurrentUtility (U util)
 Sets the utility of the current solution.

Protected Attributes

JaCoPutilSpace< V > space
 The JaCoPutilSpace we are iterating over.
SolutionListener< IntVar > solListener
 The solution listener for solutions with current valuation.
int solListenerIndex
 The index of the current solution in the solutions listener.
long nbrSolLeft
 The number of solutions left to iterate over.
long nbrSols
 The total number of solutions to iterate over.
AddableInteger[] assignments
 Current variable assignments.
valuation
 Current valuation.

Private Member Functions

void iter ()
 Moves to the next solution.
searchBestUtility (V bound)
 Search the next best valuation after the one given in argument.
int getNumberOfFeasibleSolutions ()
 Search the number of feasible solutions in this space.
SolutionListener< IntVar > searchAllSolutions (V valuation)
 Search for all solutions with the given valuation.

Private Attributes

StoreCloneable store
 The JaCoP Store.
final boolean maximize
 the order or the iteration

Detailed Description

A solution iterator in best first order for JaCoPutilSpace.

Author
Arnaud Jutzeler, Thomas Leaute
Parameters
<V>the type used for valuations

Constructor & Destructor Documentation

◆ JaCoPutilSpaceIterBestFirst()

Constructor.

Parameters
spacethe JaCoPutilSpace to iterate over
maximizetrue when valuations are to be ordered decreasingly, and false otherwise

References getNumberOfFeasibleSolutions(), maximize, searchAllSolutions(), searchBestUtility(), space, and valuation.

Here is the call graph for this function:

Member Function Documentation

◆ getCurrentSolution()

See also
frodo2.solutionSpaces.BasicUtilitySolutionSpace.Iterator.getCurrentSolution()
Warning
Returns a pointer to an internal data structure that will be modified by subsequent calls to next().

Implements frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.SparseIterator< V >.

References assignments.

◆ getCurrentUtility() [1/2]

◆ getCurrentUtility() [2/2]

V frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.getCurrentUtility ( V bound,
boolean minimize )
See also
Iterator.getCurrentUtility(java.lang.Object, boolean)
Todo
Auto-generated method stub

◆ getDomains()

◆ getNbrSolutions()

◆ getNumberOfFeasibleSolutions()

int frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.getNumberOfFeasibleSolutions ( )
private

Search the number of feasible solutions in this space.

Returns
the number of feasible solutions
Bug
Name clash in case the user defined a variable with this name

References space, and store.

Referenced by JaCoPutilSpaceIterBestFirst().

◆ getVariablesOrder()

◆ hasNext()

◆ iter()

void frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.iter ( )
private

Moves to the next solution.

References nbrSolLeft, searchAllSolutions(), searchBestUtility(), solListener, solListenerIndex, space, and valuation.

Referenced by nextSolution(), and nextUtility().

Here is the call graph for this function:

◆ maximalCut()

◆ nextSolution()

See also
frodo2.solutionSpaces.BasicUtilitySolutionSpace.Iterator.nextSolution()
Warning
Returns a pointer to an internal data structure that will be modified by subsequent calls to next().

Implements frodo2.solutionSpaces.SolutionSpace< V extends Addable< V > >.SparseIterator< V >.

References assignments, and iter().

Here is the call graph for this function:

◆ nextUtility() [1/2]

◆ nextUtility() [2/2]

V frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.nextUtility ( V bound,
boolean minimize )
See also
Iterator.nextUtility(java.lang.Object, boolean)
Todo
Auto-generated method stub

◆ searchAllSolutions()

SolutionListener< IntVar > frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.searchAllSolutions ( V valuation)
private

Search for all solutions with the given valuation.

Parameters
valuationthe valuation
Returns
a JaCoP SolutionListener that contains all the solutions with the specified valuation
Bug
Projected variables are not being projected; the resulting solution list might contain two solutions that only differ on the projected variables, which should not happen

References frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.defaultValuation, frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.getProjectedVars(), space, store, and valuation.

Referenced by iter(), and JaCoPutilSpaceIterBestFirst().

Here is the call graph for this function:

◆ searchBestUtility()

V frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.searchBestUtility ( V bound)
private

Search the next best valuation after the one given in argument.

Parameters
boundthe valuation bound
Returns
the best valuation below the given bound
Warning
the domain of the valuation variable in the store is pruned in a persistent way.
Bug
Name clash in case the user defined a variable with this name
Todo
Changes are made to the current store level, and are never backtracked
Bug
Name clash in case the user defined a variable with this name

References frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.defaultValuation, frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.imposeConstraints(), frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.infeasibleValuation, frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.isConsistent, maximize, space, store, and valuation.

Referenced by iter(), and JaCoPutilSpaceIterBestFirst().

Here is the call graph for this function:

◆ setCurrentUtility()

void frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.setCurrentUtility ( V valuation)
See also
frodo2.solutionSpaces.BasicUtilitySolutionSpace.Iterator.setCurrentUtility(java.lang.Object)
Todo
Auto-generated method stub

References valuation.

◆ update()

Member Data Documentation

◆ assignments

Current variable assignments.

Referenced by getCurrentSolution(), and nextSolution().

◆ maximize

final boolean frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.maximize
private

the order or the iteration

Referenced by JaCoPutilSpaceIterBestFirst(), and searchBestUtility().

◆ nbrSolLeft

long frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.nbrSolLeft
protected

The number of solutions left to iterate over.

Referenced by iter().

◆ nbrSols

long frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.nbrSols
protected

The total number of solutions to iterate over.

Referenced by getNbrSolutions().

◆ solListener

SolutionListener<IntVar> frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.solListener
protected

The solution listener for solutions with current valuation.

Referenced by iter().

◆ solListenerIndex

int frodo2.solutionSpaces.JaCoP.JaCoPutilSpaceIterBestFirst< V extends Addable< V > >.solListenerIndex
protected

The index of the current solution in the solutions listener.

Referenced by iter().

◆ space

◆ store

◆ valuation


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