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

Best first iterator for the combination of a VehicleRoutingSpace with a collection of sum constraints. More...

Inheritance diagram for frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator:

Public Member Functions

 BestFirstIterator (VehicleRoutingSpace< U > vrpSpace, List< UtilitySolutionSpace< AddableInteger, U > > spaces, String[] variablesOrder, String ownVariable)
 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 ()

Protected Member Functions

void combineVRPAndSum ()
 Method to combine the nandAssignment and the packetAssignment in the currentAssignment variable.

Protected Attributes

HashMap< String, Integer > variablePointer
 For each variable its position in the assignment array.

Private Member Functions

void iter ()
 Method used to iterate over the assignments in a best first order.
void iterateSumVars ()
 Iterate of the possible combinations of NAND variables.

Private Attributes

AddableInteger[] currentSolution
 The current solution.
currentUtility
 The utility of the current solution.
String[] vehicleRoutingVariables
 The variables occuring in the VRP problem.
String[] sumVariables
 The variables occuring in the sum constraints.
boolean hasVehicleRoutingProblem
 true when this space contains a VRP space, and false otherwise
boolean hasSumVariables
 true when this space contrains sum variables, and false otherwise
Iterator< AddableInteger, U > vehicleIterBestFirst
 An iterator over the VRP space.
int nbrSolsLeft
 The number of solutions left.
int nbrSumSolsLeft
 The number of possible assignments for the sum variables left.
int nbrSumSols
 the total number of possible assignments to the sum variables
int nbrSumVariables
 The total number of sum variables.
int nbrVRPvariables
 The total number of VRP variables.
AddableInteger one = new AddableInteger(1)
 Domain value 1.
AddableInteger zero = new AddableInteger(0)
 Domain value 0.
AddableInteger[] sumAssignment
 The current assignment to the sum variables.
AddableInteger[] vrpAssignment
 The current assignment to the VRP variables.
int ownVariableAssignmentVRPIndex
 The index of the own variable in the list of variables for the VRP problem.
zeroUtil
 The zero utility.

Detailed Description

Best first iterator for the combination of a VehicleRoutingSpace with a collection of sum constraints.

Author
Brammert Ottens, 28 apr 2010

Constructor & Destructor Documentation

◆ BestFirstIterator()

frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.BestFirstIterator ( VehicleRoutingSpace< U > vrpSpace,
List< UtilitySolutionSpace< AddableInteger, U > > spaces,
String[] variablesOrder,
String ownVariable )

Member Function Documentation

◆ combineVRPAndSum()

void frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.combineVRPAndSum ( )
protected

Method to combine the nandAssignment and the packetAssignment in the currentAssignment variable.

Author
Brammert Ottens, 25 nov 2009

References currentSolution, sumAssignment, sumVariables, variablePointer, vehicleRoutingVariables, and vrpAssignment.

Referenced by iter().

◆ getCurrentSolution()

◆ getCurrentUtility() [1/2]

◆ getCurrentUtility() [2/2]

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

◆ getDomains()

◆ getNbrSolutions()

◆ getVariablesOrder()

◆ hasNext()

◆ iter()

void frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.iter ( )
private

Method used to iterate over the assignments in a best first order.

Author
Brammert Ottens, 28 apr 2010

References combineVRPAndSum(), currentUtility, hasSumVariables, hasVehicleRoutingProblem, iterateSumVars(), nbrSolsLeft, nbrSumSols, nbrSumSolsLeft, one, ownVariableAssignmentVRPIndex, sumAssignment, vehicleIterBestFirst, vrpAssignment, and zero.

Referenced by nextSolution(), and nextUtility().

Here is the call graph for this function:

◆ iterateSumVars()

void frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.iterateSumVars ( )
private

Iterate of the possible combinations of NAND variables.

References nbrSumSolsLeft, nbrSumVariables, one, sumAssignment, and zero.

Referenced by iter().

◆ maximalCut()

◆ nextSolution()

◆ nextUtility() [1/2]

◆ nextUtility() [2/2]

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

◆ setCurrentUtility()

◆ update()

Member Data Documentation

◆ currentSolution

AddableInteger [] frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.currentSolution
private

The current solution.

Referenced by BestFirstIterator(), combineVRPAndSum(), getCurrentSolution(), and nextSolution().

◆ currentUtility

U frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.currentUtility
private

The utility of the current solution.

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

◆ hasSumVariables

boolean frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.hasSumVariables
private

true when this space contrains sum variables, and false otherwise

Referenced by BestFirstIterator(), and iter().

◆ hasVehicleRoutingProblem

boolean frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.hasVehicleRoutingProblem
private

true when this space contains a VRP space, and false otherwise

Referenced by BestFirstIterator(), and iter().

◆ nbrSolsLeft

int frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.nbrSolsLeft
private

The number of solutions left.

Referenced by BestFirstIterator(), and iter().

◆ nbrSumSols

int frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.nbrSumSols
private

the total number of possible assignments to the sum variables

Referenced by iter().

◆ nbrSumSolsLeft

int frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.nbrSumSolsLeft
private

The number of possible assignments for the sum variables left.

Referenced by BestFirstIterator(), iter(), and iterateSumVars().

◆ nbrSumVariables

int frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.nbrSumVariables
private

The total number of sum variables.

Referenced by BestFirstIterator(), and iterateSumVars().

◆ nbrVRPvariables

int frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.nbrVRPvariables
private

The total number of VRP variables.

Referenced by BestFirstIterator().

◆ one

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

Domain value 1.

Referenced by BestFirstIterator(), iter(), and iterateSumVars().

◆ ownVariableAssignmentVRPIndex

int frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.ownVariableAssignmentVRPIndex
private

The index of the own variable in the list of variables for the VRP problem.

Referenced by BestFirstIterator(), and iter().

◆ sumAssignment

AddableInteger [] frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.sumAssignment
private

The current assignment to the sum variables.

Referenced by BestFirstIterator(), combineVRPAndSum(), iter(), and iterateSumVars().

◆ sumVariables

String [] frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.sumVariables
private

The variables occuring in the sum constraints.

Referenced by BestFirstIterator(), and combineVRPAndSum().

◆ variablePointer

HashMap<String, Integer> frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.variablePointer
protected

For each variable its position in the assignment array.

Referenced by BestFirstIterator(), and combineVRPAndSum().

◆ vehicleIterBestFirst

Iterator<AddableInteger, U> frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.vehicleIterBestFirst
private

An iterator over the VRP space.

Referenced by BestFirstIterator(), and iter().

◆ vehicleRoutingVariables

String [] frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.vehicleRoutingVariables
private

The variables occuring in the VRP problem.

Referenced by BestFirstIterator(), and combineVRPAndSum().

◆ vrpAssignment

AddableInteger [] frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.vrpAssignment
private

The current assignment to the VRP variables.

Referenced by BestFirstIterator(), combineVRPAndSum(), and iter().

◆ zero

AddableInteger frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.zero = new AddableInteger(0)
private

Domain value 0.

Referenced by iter(), and iterateSumVars().

◆ zeroUtil

U frodo2.solutionSpaces.vehiclerouting.CompoundSpace< U extends Addable< U > >.BestFirstIterator.zeroUtil
private

The zero utility.

Referenced by BestFirstIterator(), and maximalCut().


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