choco.search
Class AbstractGlobalSearchLimit

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.search.AbstractGlobalSearchLimit
All Implemented Interfaces:
Entity, IGlobalSearchLimit
Direct Known Subclasses:
NodeLimit, TimeLimit

public abstract class AbstractGlobalSearchLimit
extends AbstractEntity
implements IGlobalSearchLimit

An abstract class for limiting tree search (imposing conditions on depth, ...)


Field Summary
protected  int nb
          a counter who is limited to values below max
protected  int nbMax
          maximal value limitting the search exploration
protected  int nbTot
          counting for successive tree search
protected  AbstractGlobalSearchSolver solver
          the solver that delegates the limit checking task to such AbstractGlobalSearchLimit objects
protected  java.lang.String unit
          for pretty printing
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
AbstractGlobalSearchLimit(AbstractGlobalSearchSolver theSolver, int theLimit)
           
 
Method Summary
 int getNb()
          get the current counter
 int getNbMax()
           
 int getNbTot()
          get the total counter
 java.lang.String pretty()
          pretty printing of the object.
 void reset(boolean first)
          resets the limit (the counter run from now on)
 void setNbMax(int nbMax)
          Sets the limits
 
Methods inherited from class choco.AbstractEntity
getProblem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.search.IGlobalSearchLimit
endNode, newNode
 
Methods inherited from interface choco.Entity
getProblem
 

Field Detail

solver

protected AbstractGlobalSearchSolver solver
the solver that delegates the limit checking task to such AbstractGlobalSearchLimit objects


unit

protected java.lang.String unit
for pretty printing


nbMax

protected int nbMax
maximal value limitting the search exploration


nb

protected int nb
a counter who is limited to values below max


nbTot

protected int nbTot
counting for successive tree search

Constructor Detail

AbstractGlobalSearchLimit

public AbstractGlobalSearchLimit(AbstractGlobalSearchSolver theSolver,
                                 int theLimit)
Method Detail

reset

public void reset(boolean first)
Description copied from interface: IGlobalSearchLimit
resets the limit (the counter run from now on)

Specified by:
reset in interface IGlobalSearchLimit
Parameters:
first - true for the very first initialization, false for subsequent ones

pretty

public java.lang.String pretty()
Description copied from interface: Entity
pretty printing of the object. This String is not constant and may depend on the context.

Specified by:
pretty in interface Entity
Overrides:
pretty in class AbstractEntity
Returns:
a readable string representation of the object

getNb

public int getNb()
get the current counter


getNbTot

public int getNbTot()
get the total counter


getNbMax

public int getNbMax()
Returns:
the limit value

setNbMax

public void setNbMax(int nbMax)
Sets the limits

Parameters:
nbMax - new value of the limit