FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst Class Reference

Best first iterator. More...

Inheritance diagram for frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst:

Public Member Functions

 VRPiteratorBestFirst (String[] variables, AddableInteger[][] domains, VehicleRoutingSpace< U > space)
 Constructor.
 VRPiteratorBestFirst (String[] variables, AddableInteger[][] domains, VehicleRoutingSpace< U > space, String[] fixedVariables, AddableInteger[] fixedValues)
 Constructor.
getCurrentUtility ()
getCurrentUtility (U bound, final boolean minimize)
nextUtility ()
nextUtility (U bound, final boolean minimize)
void setCurrentUtility (U util)
AddableInteger[] getCurrentSolution ()
AddableInteger[][] getDomains ()
long getNbrSolutions ()
String[] getVariablesOrder ()
boolean hasNext ()
AddableInteger[] nextSolution ()
void update ()
maximalCut ()

Private Member Functions

void iter ()
 Generates the next solution.

Private Attributes

String[] variables
 Variables over which to iterate.
boolean[] fixed
 For each variable, when true, it's value is fixed.
AddableInteger[][] domains
 The domains for the iteration variables.
AddableInteger[] currentSolution
 The current solution.
currentUtility
 The utility of the current solution.
PriorityQueue< CustomerAssignment< U > > orderedAssignments
 The set of assignments already.
HashSet< CustomerAssignment< U > > alreadyGenerated
 Map of already generated assignments.
AddableInteger one = new AddableInteger(1)
 All variables are binary, and will be either 0 or 1.
VehicleRoutingSpace< U > space
 The space over which we are iterating.
long numberOfSolutionsLeft
 The number of solutions left to iterate over.
final long nbrSolutions
 The total number of solutions.

Detailed Description

Best first iterator.

The best solution is the one where no customer is served.

The generator is based on the idea that a solution serving a set of customers A will always be better than any solution whose set of customers is a proper superset of A. Thus, whenever a solution s is released, a new set of solutions is generated, based on s, where a customer is added.

Author
Brammert Ottens, 28 apr 2010

Constructor & Destructor Documentation

◆ VRPiteratorBestFirst() [1/2]

frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.VRPiteratorBestFirst ( String[] variables,
AddableInteger domains[][],
VehicleRoutingSpace< U > space )

Constructor.

Parameters
variablesvariables over which to iterate
domainsdomains for the iteration variables
spacethe space over which to iterate

References alreadyGenerated, domains, fixed, numberOfSolutionsLeft, orderedAssignments, space, variables, and frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VehicleRoutingSpace().

Here is the call graph for this function:

◆ VRPiteratorBestFirst() [2/2]

frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.VRPiteratorBestFirst ( String[] variables,
AddableInteger domains[][],
VehicleRoutingSpace< U > space,
String[] fixedVariables,
AddableInteger[] fixedValues )

Constructor.

Parameters
variablesvariables over which to iterate
domainsdomains for the iteration variables
spacethe space over which to iterate
fixedVariablesthe variables who's values should be fixed
fixedValuesthe values of the fixed variables

References alreadyGenerated, domains, fixed, numberOfSolutionsLeft, orderedAssignments, space, variables, and frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VehicleRoutingSpace().

Here is the call graph for this function:

Member Function Documentation

◆ getCurrentSolution()

◆ getCurrentUtility() [1/2]

◆ getCurrentUtility() [2/2]

U frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.getCurrentUtility ( U bound,
final boolean minimize )

◆ getDomains()

◆ getNbrSolutions()

◆ getVariablesOrder()

◆ hasNext()

◆ iter()

◆ maximalCut()

◆ nextSolution()

◆ nextUtility() [1/2]

◆ nextUtility() [2/2]

U frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.nextUtility ( U bound,
final boolean minimize )

◆ setCurrentUtility()

◆ update()

Member Data Documentation

◆ alreadyGenerated

HashSet<CustomerAssignment<U> > frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.alreadyGenerated
private

Map of already generated assignments.

Referenced by iter(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().

◆ currentSolution

AddableInteger [] frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.currentSolution
private

The current solution.

Referenced by getCurrentSolution(), iter(), nextSolution(), and nextUtility().

◆ currentUtility

U frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.currentUtility
private

The utility of the current solution.

Referenced by getCurrentUtility(), iter(), and nextUtility().

◆ domains

AddableInteger [][] frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.domains
private

The domains for the iteration variables.

Referenced by getDomains(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().

◆ fixed

boolean [] frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.fixed
private

For each variable, when true, it's value is fixed.

Referenced by iter(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().

◆ nbrSolutions

final long frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.nbrSolutions
private

The total number of solutions.

◆ numberOfSolutionsLeft

long frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.numberOfSolutionsLeft
private

The number of solutions left to iterate over.

Referenced by iter(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().

◆ one

AddableInteger frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.one = new AddableInteger(1)
private

All variables are binary, and will be either 0 or 1.

Referenced by iter().

◆ orderedAssignments

PriorityQueue<CustomerAssignment<U> > frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.orderedAssignments
private

The set of assignments already.

Referenced by iter(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().

◆ space

VehicleRoutingSpace<U> frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.space
private

The space over which we are iterating.

Referenced by iter(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().

◆ variables

String [] frodo2.solutionSpaces.vehiclerouting.VehicleRoutingSpace< U extends Addable< U > >.VRPiteratorBestFirst.variables
private

Variables over which to iterate.

Referenced by getVariablesOrder(), VRPiteratorBestFirst(), and VRPiteratorBestFirst().


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