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

A solution iterator for BasicHypercubes. More...

Inheritance diagram for frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >:

Public Member Functions

long getNbrSolutions ()
V[] nextSolution ()
nextUtility ()
V[] getCurrentSolution ()
getCurrentUtility ()
void setCurrentUtility (U util)
 Sets the utility of the current solution.
String[] getVariablesOrder ()
V[][] getDomains ()
boolean hasNext ()
void update ()
String toString ()

Protected Member Functions

 BasicHypercubeIter ()
 Empty constructor.
 BasicHypercubeIter (BasicHypercube< V, U > space, V[] assignment, U skippedUtil)
 Constructor.
 BasicHypercubeIter (final BasicHypercube< V, U > space, final String[] variables, final V[][] domains, final V[] assignment, U skippedUtil)
 Constructor.
 BasicHypercubeIter (BasicHypercube< V, U > space, String[] varOrder, V[] assignment, U skippedUtil)
 Constructor.
int iter ()
 Moves to the next solution.

Protected Attributes

U[] utilities
 The space's utility array.
utility
 Current utility value.
int utilIndex
 The index of the current utility value in the utility array.
int[][] steps
 For each variable:
V[] solution
 Current variable assignments.
BasicHypercube< V, U > space
 The BasicHypercube we are iterating over.
String[] variables
 The order of iteration over the variables.
int nbrVars
 The number of variables.
V[][] domains
 The variables' domains.
int[] valIndexes
 For each variable, the index in its domain of the current assignment.
long nbrSolLeft
 The number of solutions left to iterate over.
long nbrSols
 The total number of solutions to iterate over.

Private Attributes

skippedUtil
 The utility value that is skipped in sparse iterator mode.

Detailed Description

A solution iterator for BasicHypercubes.

Author
Thomas Leaute
Parameters
<V>the type used for variable values
<U>the type used for utility values

Constructor & Destructor Documentation

◆ BasicHypercubeIter() [1/4]

frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.BasicHypercubeIter ( )
protected

Empty constructor.

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ BasicHypercubeIter() [2/4]

frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.BasicHypercubeIter ( BasicHypercube< V, U > space,
V[] assignment,
U skippedUtil )
protected

Constructor.

Parameters
spacethe BasicHypercube to iterate over
assignmentAn array that will be used as the output of nextSolution()
skippedUtilThe utility value to skip, if any

References BasicHypercubeIter(), domains, nbrVars, skippedUtil, solution, space, steps, utilIndex, and valIndexes.

Here is the call graph for this function:

◆ BasicHypercubeIter() [3/4]

frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.BasicHypercubeIter ( final BasicHypercube< V, U > space,
final String[] variables,
final V domains[][],
final V[] assignment,
U skippedUtil )
protected

Constructor.

Parameters
spacethe BasicHypercube to iterate over
variablesthe variables to iterate over; may include variables not in the space
domainsthe variables' domains
assignmentAn array that will be used as the output of nextSolution()
skippedUtilThe utility value that should be skipped, if any
Warning
The input array of variables must contain all of the space's variables, and the input domains must be sub-domains of the space's.

References BasicHypercubeIter(), domains, nbrSolLeft, nbrVars, skippedUtil, solution, space, steps, utilIndex, valIndexes, and variables.

Here is the call graph for this function:

◆ BasicHypercubeIter() [4/4]

frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.BasicHypercubeIter ( BasicHypercube< V, U > space,
String[] varOrder,
V[] assignment,
U skippedUtil )
protected

Constructor.

Parameters
spacethe BasicHypercube to iterate over
varOrderthe order of iteration of the variables
assignmentAn array that will be used as the output of nextSolution()
skippedUtilThe utility value to skip, if any
Warning
The input array of variables must contain exactly all of the space's variables.

References BasicHypercubeIter(), nbrVars, skippedUtil, solution, space, steps, utilIndex, valIndexes, and variables.

Here is the call graph for this function:

Member Function Documentation

◆ getCurrentSolution()

V[] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.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 >.

Referenced by getCurrentUtility().

◆ getCurrentUtility()

◆ getDomains()

◆ getNbrSolutions()

◆ getVariablesOrder()

◆ hasNext()

◆ iter()

int frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.iter ( )
protected

Moves to the next solution.

Returns
the new utilIndex

Referenced by nextSolution(), and nextUtility().

◆ nextSolution()

V[] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.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 frodo2.solutionSpaces.hypercube.BasicHypercube< V extends Addable< V >, U extends Serializable >.incrNCCCs(), iter(), and space.

Here is the call graph for this function:

◆ nextUtility()

◆ setCurrentUtility()

void frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.setCurrentUtility ( U util)

Sets the utility of the current solution.

Parameters
utilthe new utility

Implements frodo2.solutionSpaces.BasicUtilitySolutionSpace< V extends Addable< V >, U extends Serializable >.SparseIterator< V, U >.

◆ toString()

String frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.toString ( )
See also
java.lang.Object#toString()

◆ update()

Member Data Documentation

◆ domains

V [][] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.domains
protected

The variables' domains.

Referenced by BasicHypercubeIter(), and BasicHypercubeIter().

◆ nbrSolLeft

long frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.nbrSolLeft
protected

The number of solutions left to iterate over.

Referenced by BasicHypercubeIter().

◆ nbrSols

long frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.nbrSols
protected

The total number of solutions to iterate over.

◆ nbrVars

int frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.nbrVars
protected

The number of variables.

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ skippedUtil

U frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.skippedUtil
private

The utility value that is skipped in sparse iterator mode.

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ solution

V [] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.solution
protected

Current variable assignments.

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ space

BasicHypercube<V, U> frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.space
protected

◆ steps

int [][] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.steps
protected

For each variable:

  • the first entry is the incremental step when changing from the last value back to the first
  • entry i is the incremental step in the space's utility array when changing the variable's value from value at index i - 1 to value at index i (in the input domain array)

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ utilIndex

int frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.utilIndex
protected

The index of the current utility value in the utility array.

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ utilities

U [] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.utilities
protected

The space's utility array.

◆ utility

U frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.utility
protected

Current utility value.

◆ valIndexes

int [] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.valIndexes
protected

For each variable, the index in its domain of the current assignment.

Referenced by BasicHypercubeIter(), BasicHypercubeIter(), and BasicHypercubeIter().

◆ variables

String [] frodo2.solutionSpaces.hypercube.BasicHypercubeIter< V extends Addable< V >, U extends Serializable >.variables
protected

The order of iteration over the variables.

Referenced by BasicHypercubeIter(), and BasicHypercubeIter().


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