choco.kernel.solver
Class Solution

java.lang.Object
  extended by choco.kernel.solver.Solution

public class Solution
extends Object

A class storing a state of the model


Field Summary
protected  int[] intVarValues
          data storage for values of search variables
protected  MeasuresBean measures
           
static int NULL
           
protected  int objectiveIntValue
           
protected  double objectiveRealValue
           
protected  RealInterval[] realVarValues
           
protected  int[][] setVarValues
           
protected  Solver solver
          the solver owning the solution
 
Constructor Summary
Solution(Solver solver)
          Constructor
 
Method Summary
 int getIntValue(int varIndex)
          Accessor to the value of a variable in a solution
 IMeasures getMeasures()
           
 int getObjectiveValue()
           
 RealInterval getRealValue(int varIndex)
           
 int[] getSetValue(int varIndex)
           
 Solver getSolver()
           
 void recordIntObjective(int objectiveIntValue)
           
 void recordIntValue(int intVarIndex, int intVarValue)
           
 void recordIntValues()
           
 void recordRealObjective(double objectiveRealValue)
           
 void recordRealValue(int realVarIndex, RealInterval realVarValue)
           
 void recordRealValues()
           
 void recordSearchMeasures(ISearchMeasures measures)
           
 void recordSetValue(int setVarIndex, int[] setVarValue)
           
 void recordSetValues()
           
 void recordSolutionCount(int solutionCount)
           
 void setSolver(Solver s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final int NULL
See Also:
Constant Field Values

solver

protected Solver solver
the solver owning the solution


intVarValues

protected int[] intVarValues
data storage for values of search variables


realVarValues

protected RealInterval[] realVarValues

setVarValues

protected int[][] setVarValues

objectiveIntValue

protected int objectiveIntValue

objectiveRealValue

protected double objectiveRealValue

measures

protected final MeasuresBean measures
Constructor Detail

Solution

public Solution(Solver solver)
Constructor

Parameters:
solver - the model owning the solution
Method Detail

setSolver

public void setSolver(Solver s)

getSolver

public Solver getSolver()

getMeasures

public final IMeasures getMeasures()

getObjectiveValue

public final int getObjectiveValue()

recordSolutionCount

public final void recordSolutionCount(int solutionCount)

recordIntValues

public final void recordIntValues()

recordSetValues

public final void recordSetValues()

recordRealValues

public final void recordRealValues()

recordIntValue

public final void recordIntValue(int intVarIndex,
                                 int intVarValue)

recordSetValue

public final void recordSetValue(int setVarIndex,
                                 int[] setVarValue)

recordRealValue

public final void recordRealValue(int realVarIndex,
                                  RealInterval realVarValue)

recordIntObjective

public final void recordIntObjective(int objectiveIntValue)

recordRealObjective

public final void recordRealObjective(double objectiveRealValue)

recordSearchMeasures

public final void recordSearchMeasures(ISearchMeasures measures)

getIntValue

public final int getIntValue(int varIndex)
Accessor to the value of a variable in a solution

Parameters:
varIndex - the index of the variable among all variables of the model
Returns:
its value (whenever it is instantiated in the solution), or Integer.MAX_VALUE otherwise

getSetValue

public final int[] getSetValue(int varIndex)

getRealValue

public final RealInterval getRealValue(int varIndex)


Copyright © 2012. All Rights Reserved.