choco.search
Class TimeLimit

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

public class TimeLimit
extends AbstractGlobalSearchLimit


Field Summary
protected  long starth
           
 
Fields inherited from class choco.search.AbstractGlobalSearchLimit
nb, nbMax, nbTot, solver, unit
 
Fields inherited from class choco.AbstractEntity
hook, problem
 
Constructor Summary
TimeLimit(AbstractGlobalSearchSolver theSolver, int theLimit)
           
 
Method Summary
 boolean endNode(AbstractGlobalSearchSolver solver)
          notify the limit object whenever the search closes a node in the search tree
 boolean newNode(AbstractGlobalSearchSolver solver)
          notify the limit object whenever a new node is created in the search tree
 void reset(boolean first)
          resets the limit (the counter run from now on)
 
Methods inherited from class choco.search.AbstractGlobalSearchLimit
getNb, getNbMax, getNbTot, pretty, setNbMax
 
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.Entity
getProblem
 

Field Detail

starth

protected long starth
Constructor Detail

TimeLimit

public TimeLimit(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
Overrides:
reset in class AbstractGlobalSearchLimit
Parameters:
first - true for the very first initialization, false for subsequent ones

newNode

public boolean newNode(AbstractGlobalSearchSolver solver)
Description copied from interface: IGlobalSearchLimit
notify the limit object whenever a new node is created in the search tree

Parameters:
solver - the controller of the search exploration, managing the limit
Returns:
true if the limit accepts the creation of the new node, false otherwise

endNode

public boolean endNode(AbstractGlobalSearchSolver solver)
Description copied from interface: IGlobalSearchLimit
notify the limit object whenever the search closes a node in the search tree

Parameters:
solver - the controller of the search exploration, managing the limit
Returns:
true if the limit accepts the death of the new node, false otherwise