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

A solution iterator for a scalar space. More...

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

Public Member Functions

 ScalarBasicSpaceIter (U utility, U infeasibleUtil, U skippedUtil)
 Constructor.
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 ()

Protected Member Functions

 ScalarBasicSpaceIter ()
 Empty constructor.
 ScalarBasicSpaceIter (U utility, String[] variables, V[][] domains, V[] assignment, U infeasibleUtil, U skippedUtil)
 Constructor.
void init (U utility, String[] variables, V[][] domains, V[] assignment)
 Helper method called by the constructor.
void iter ()
 Moves to the next solution.

Protected Attributes

utility
 Current utility value.
V[] solution
 Current variable assignments.
long nbrSolLeft = 1
 The number of solutions left to iterate over.
skippedUtil
 The utility value that should be skipped, if any.
inf
 The infeasible utility.

Private Attributes

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 nbrSols = 1
 The total number of solutions to iterate over.

Detailed Description

A solution iterator for a scalar space.

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

Constructor & Destructor Documentation

◆ ScalarBasicSpaceIter() [1/3]

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

Empty constructor.

◆ ScalarBasicSpaceIter() [2/3]

frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.ScalarBasicSpaceIter ( U utility,
U infeasibleUtil,
U skippedUtil )

Constructor.

Parameters
utilitythe utility value
infeasibleUtilthe infeasible utility
skippedUtilthe utility value that should be skipped, if any

References skippedUtil, and utility.

◆ ScalarBasicSpaceIter() [3/3]

frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.ScalarBasicSpaceIter ( U utility,
String[] variables,
V domains[][],
V[] assignment,
U infeasibleUtil,
U skippedUtil )
protected

Constructor.

Parameters
utilitythe utility value
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()
infeasibleUtilthe infeasible utility
skippedUtilthe utility value that should be skipped, if any

References domains, init(), skippedUtil, utility, and variables.

Here is the call graph for this function:

Member Function Documentation

◆ getCurrentSolution()

V[] frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< 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 >.

◆ getCurrentUtility()

◆ getDomains()

◆ getNbrSolutions()

◆ getVariablesOrder()

◆ hasNext()

◆ init()

void frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.init ( U utility,
String[] variables,
V domains[][],
V[] assignment )
protected

Helper method called by the constructor.

Parameters
utilitythe utility value
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()

References domains, init(), nbrSolLeft, nbrVars, solution, utility, valIndexes, and variables.

Referenced by init(), and ScalarBasicSpaceIter().

Here is the call graph for this function:

◆ iter()

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

Moves to the next solution.

References solution, and valIndexes.

Referenced by nextSolution(), and nextUtility().

◆ nextSolution()

V[] frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< 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 iter().

Referenced by frodo2.benchmarks.party.PartyGame.encodeProblem(), and frodo2.solutionSpaces.JaCoP.JaCoPutilSpace< V extends Addable< V > >.readExternal().

Here is the call graph for this function:

◆ nextUtility()

◆ setCurrentUtility()

void frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< 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 >.

◆ update()

Member Data Documentation

◆ domains

V [][] frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.domains
private

The variables' domains.

Referenced by init(), and ScalarBasicSpaceIter().

◆ inf

U frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.inf
protected

The infeasible utility.

◆ nbrSolLeft

long frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.nbrSolLeft = 1
protected

The number of solutions left to iterate over.

Referenced by init().

◆ nbrSols

long frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.nbrSols = 1
private

The total number of solutions to iterate over.

◆ nbrVars

int frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.nbrVars
private

The number of variables.

Referenced by init().

◆ skippedUtil

U frodo2.solutionSpaces.hypercube.ScalarBasicSpaceIter< V extends Addable< V >, U extends Serializable >.skippedUtil
protected

The utility value that should be skipped, if any.

Referenced by ScalarBasicSpaceIter(), and ScalarBasicSpaceIter().

◆ solution

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

Current variable assignments.

Referenced by init(), and iter().

◆ utility

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

Current utility value.

Referenced by init(), ScalarBasicSpaceIter(), and ScalarBasicSpaceIter().

◆ valIndexes

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

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

Referenced by init(), and iter().

◆ variables

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

The order of iteration over the variables.

Referenced by init(), and ScalarBasicSpaceIter().


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