choco.cp.solver.search
Class SearchLimitManager

java.lang.Object
  extended by choco.cp.solver.search.SearchLimitManager
All Implemented Interfaces:
IPretty, GlobalSearchLimitManager

public class SearchLimitManager
extends Object
implements GlobalSearchLimitManager


Field Summary
static Logger LOGGER
           
protected  AbstractGlobalSearchLimit restartLimit
           
protected  UniversalRestartStrategy restartStrategy
           
protected  AbstractGlobalSearchLimit restartStrategyLimit
           
protected  AbstractGlobalSearchLimit searchLimit
           
protected  AbstractGlobalSearchStrategy searchStrategy
           
 
Constructor Summary
SearchLimitManager(AbstractGlobalSearchStrategy searchStrategy)
           
 
Method Summary
 void cancelRestartStrategy()
          cancel the restart strategy.
 void endNode()
          notify the limit object whenever the search closes a node in the search tree
 void endTreeSearch()
           
 int getRestartCutoff()
           
 int getRestartFromStrategyCount()
          get the number of restarts caused by the restart strategy.
 AbstractGlobalSearchLimit getRestartLimit()
           
 UniversalRestartStrategy getRestartStrategy()
          get the restart strategy, if any.
 AbstractGlobalSearchLimit getRestartStrategyLimit()
           
 AbstractGlobalSearchLimit getSearchLimit()
           
 AbstractGlobalSearchStrategy getSearchStrategy()
           
 int getTimeCount()
          Get the time in milliseconds elapsed since the beginning of the search.
 void initialize()
          initialize the limit.
 void newNode()
          notify the limit object whenever a new node is created in the search tree
 boolean newRestart()
          notify the limit object whenever the search has been restarted.
 String pretty()
          pretty printing of the object.
 void reset()
          resets the limit (the counter run from now on)
 void setRestartLimit(AbstractGlobalSearchLimit restartLimit)
           
 void setRestartStrategy(UniversalRestartStrategy restartStrategy, AbstractGlobalSearchLimit restartStrategyLimit)
           
 void setSearchLimit(AbstractGlobalSearchLimit searchLimit)
           
 String toString()
           
protected  void updateTimeCount()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

public static final Logger LOGGER

searchStrategy

protected final AbstractGlobalSearchStrategy searchStrategy

restartLimit

protected AbstractGlobalSearchLimit restartLimit

searchLimit

protected AbstractGlobalSearchLimit searchLimit

restartStrategy

protected UniversalRestartStrategy restartStrategy

restartStrategyLimit

protected AbstractGlobalSearchLimit restartStrategyLimit
Constructor Detail

SearchLimitManager

public SearchLimitManager(AbstractGlobalSearchStrategy searchStrategy)
Method Detail

getRestartLimit

public final AbstractGlobalSearchLimit getRestartLimit()

getRestartStrategy

public final UniversalRestartStrategy getRestartStrategy()
Description copied from interface: GlobalSearchLimitManager
get the restart strategy, if any.

Specified by:
getRestartStrategy in interface GlobalSearchLimitManager

getRestartStrategyLimit

public final AbstractGlobalSearchLimit getRestartStrategyLimit()

setRestartLimit

public final void setRestartLimit(AbstractGlobalSearchLimit restartLimit)

getSearchLimit

public final AbstractGlobalSearchLimit getSearchLimit()

setSearchLimit

public final void setSearchLimit(AbstractGlobalSearchLimit searchLimit)

setRestartStrategy

public final void setRestartStrategy(UniversalRestartStrategy restartStrategy,
                                     AbstractGlobalSearchLimit restartStrategyLimit)

getRestartFromStrategyCount

public final int getRestartFromStrategyCount()
Description copied from interface: GlobalSearchLimitManager
get the number of restarts caused by the restart strategy.

Specified by:
getRestartFromStrategyCount in interface GlobalSearchLimitManager
Returns:

getRestartCutoff

public final int getRestartCutoff()

getTimeCount

public final int getTimeCount()
Get the time in milliseconds elapsed since the beginning of the search.

Specified by:
getTimeCount in interface GlobalSearchLimitManager

getSearchStrategy

public final AbstractGlobalSearchStrategy getSearchStrategy()
Specified by:
getSearchStrategy in interface GlobalSearchLimitManager
Returns:
strategy the controller of the search exploration, managing the limit

updateTimeCount

protected final void updateTimeCount()

initialize

public final void initialize()
Description copied from interface: GlobalSearchLimitManager
initialize the limit.

Specified by:
initialize in interface GlobalSearchLimitManager

reset

public final void reset()
Description copied from interface: GlobalSearchLimitManager
resets the limit (the counter run from now on)

Specified by:
reset in interface GlobalSearchLimitManager

endTreeSearch

public void endTreeSearch()
Specified by:
endTreeSearch in interface GlobalSearchLimitManager

newNode

public final void newNode()
                   throws ContradictionException
Description copied from interface: GlobalSearchLimitManager
notify the limit object whenever a new node is created in the search tree

Specified by:
newNode in interface GlobalSearchLimitManager
Throws:
ContradictionException - if the limit does not accept the creation of the new node.

endNode

public final void endNode()
                   throws ContradictionException
Description copied from interface: GlobalSearchLimitManager
notify the limit object whenever the search closes a node in the search tree

Specified by:
endNode in interface GlobalSearchLimitManager
Throws:
ContradictionException - if the limit does not accept the death of the node.

newRestart

public final boolean newRestart()
Description copied from interface: GlobalSearchLimitManager
notify the limit object whenever the search has been restarted. return true if the limit does stop the restart process.

Specified by:
newRestart in interface GlobalSearchLimitManager

cancelRestartStrategy

public final void cancelRestartStrategy()
Description copied from interface: GlobalSearchLimitManager
cancel the restart strategy.

Specified by:
cancelRestartStrategy in interface GlobalSearchLimitManager

toString

public String toString()
Overrides:
toString in class Object

pretty

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

Specified by:
pretty in interface IPretty
Returns:
a readable string representation of the object


Copyright © 2012. All Rights Reserved.