choco.kernel.solver.search
Class AbstractSearchStrategy

java.lang.Object
  extended by choco.kernel.solver.search.AbstractSearchStrategy
All Implemented Interfaces:
ISolutionMeasures
Direct Known Subclasses:
AbstractGlobalSearchStrategy

public abstract class AbstractSearchStrategy
extends Object
implements ISolutionMeasures

An abstract class handling the control for solving a model


Field Summary
protected static Logger LOGGER
          an object for logging trace statements
protected  int nbSolutions
          count of the solutions found during search
protected  ISolutionPool solutionPool
           
 Solver solver
          The (optimization or decision) model to which the entity belongs.
 
Constructor Summary
AbstractSearchStrategy(Solver solver)
           
 
Method Summary
 boolean existsSolution()
          indicates if the search find at least one solution.
 int getSolutionCount()
          Get the solution count of the measure
 ISolutionPool getSolutionPool()
           
 Solver getSolver()
          Retrieves the solver of the entity
 List<Solution> getStoredSolutions()
           
 void recordSolution()
          recording the current state as a solution stores information from the current state in the next solution of the model note: only instantiated variables are recorded in the Solution object either all variables or a user-defined subset of them are recorded this may erase a soolution that was previously stored in the ith position this may also increase the size of the pb.solutions vector.
 void resetSolutions()
           
 void restoreBestSolution()
           
 void setSolutionPool(ISolutionPool solutionPool)
          a null argument cancel the solution recording.
 void writeSolution(Solution sol)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER
an object for logging trace statements


solver

public final Solver solver
The (optimization or decision) model to which the entity belongs.


solutionPool

protected ISolutionPool solutionPool

nbSolutions

protected int nbSolutions
count of the solutions found during search

Constructor Detail

AbstractSearchStrategy

public AbstractSearchStrategy(Solver solver)
Method Detail

getSolver

public Solver getSolver()
Retrieves the solver of the entity


existsSolution

public final boolean existsSolution()
Description copied from interface: ISolutionMeasures
indicates if the search find at least one solution.

Specified by:
existsSolution in interface ISolutionMeasures

getSolutionCount

public final int getSolutionCount()
Description copied from interface: ISolutionMeasures
Get the solution count of the measure

Specified by:
getSolutionCount in interface ISolutionMeasures
Returns:
solution count

getSolutionPool

public final ISolutionPool getSolutionPool()

setSolutionPool

public final void setSolutionPool(ISolutionPool solutionPool)
a null argument cancel the solution recording.


resetSolutions

public final void resetSolutions()

recordSolution

public void recordSolution()
recording the current state as a solution stores information from the current state in the next solution of the model note: only instantiated variables are recorded in the Solution object either all variables or a user-defined subset of them are recorded this may erase a soolution that was previously stored in the ith position this may also increase the size of the pb.solutions vector.


writeSolution

public void writeSolution(Solution sol)

restoreBestSolution

public void restoreBestSolution()

getStoredSolutions

public final List<Solution> getStoredSolutions()


Copyright © 2012. All Rights Reserved.