Interface ISearchMonitorFactory

  • All Superinterfaces:
    ISelf<Solver>
    All Known Subinterfaces:
    ISolver
    All Known Implementing Classes:
    Solver

    public interface ISearchMonitorFactory
    extends ISelf<Solver>
    Interface to define some search monitors to be used
    Author:
    Charles Prud'homme, Jean-Guillaume Fages
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default void attach​(Solution solution)
      Attach a solution recorder to this solver
      default void limitBacktrack​(long limit)
      Defines a limit over the number of backtracks allowed during the resolution.
      default void limitFail​(long limit)
      Defines a limit over the number of fails allowed during the resolution.
      default void limitNode​(long limit)
      Defines a limit on the number of nodes allowed in the tree search.
      default void limitSearch​(Criterion aStopCriterion)
      Limit the exploration of the search space with the help of a aStopCriterion.
      default void limitSolution​(long limit)
      Defines a limit over the number of solutions found during the resolution.
      default void limitTime​(long limit)
      Defines a limit over the run time.
      default void limitTime​(String duration)
      Defines a limit over the run time.
      default void setNoGoodRecordingFromRestarts()
      * Record nogoods from restart, that is, anytime the search restarts, a nogood is produced, based on the decision path, to prevent from scanning the same sub-search tree.
      default void setNoGoodRecordingFromSolutions​(IntVar... vars)
      Record nogoods from solution, that is, anytime a solution is found, a nogood is produced to prevent from finding the same solution later during the search.
      • Methods inherited from interface org.chocosolver.solver.ISelf

        ref
    • Method Detail

      • setNoGoodRecordingFromSolutions

        default void setNoGoodRecordingFromSolutions​(IntVar... vars)
        Record nogoods from solution, that is, anytime a solution is found, a nogood is produced to prevent from finding the same solution later during the search. vars are the decision variables (to reduce ng size).
        Parameters:
        vars - array of decision variables
      • setNoGoodRecordingFromRestarts

        default void setNoGoodRecordingFromRestarts()
        * Record nogoods from restart, that is, anytime the search restarts, a nogood is produced, based on the decision path, to prevent from scanning the same sub-search tree.
      • limitSearch

        default void limitSearch​(Criterion aStopCriterion)
        Limit the exploration of the search space with the help of a aStopCriterion. When the condition depicted in the criterion is met, the search stops.
        Parameters:
        aStopCriterion - the stop criterion which, when met, stops the search.
      • limitNode

        default void limitNode​(long limit)
        Defines a limit on the number of nodes allowed in the tree search. When the limit is reached, the resolution is stopped.
        Parameters:
        limit - maximal number of nodes to open
      • limitFail

        default void limitFail​(long limit)
        Defines a limit over the number of fails allowed during the resolution. WHen the limit is reached, the resolution is stopped.
        Parameters:
        limit - maximal number of fails
      • limitBacktrack

        default void limitBacktrack​(long limit)
        Defines a limit over the number of backtracks allowed during the resolution. WHen the limit is reached, the resolution is stopped.
        Parameters:
        limit - maximal number of backtracks
      • limitSolution

        default void limitSolution​(long limit)
        Defines a limit over the number of solutions found during the resolution. WHen the limit is reached, the resolution is stopped.
        Parameters:
        limit - maximal number of solutions
      • limitTime

        default void limitTime​(long limit)
        Defines a limit over the run time. When the limit is reached, the resolution is stopped.
        One must consider also SearchMonitorFactory.limitThreadTime(long), that runs the limit in a separated thread.
        Parameters:
        limit - maximal resolution time in millisecond
      • limitTime

        default void limitTime​(String duration)
        Defines a limit over the run time. When the limit is reached, the resolution is stopped.

        One must consider also SearchMonitorFactory.limitThreadTime(String), that runs the limit in a separated thread.

        Based on SearchMonitorFactory.convertInMilliseconds(String duration)

        Parameters:
        duration - a String which states the duration like "WWd XXh YYm ZZs".
        See Also:
        TimeUtils.convertInMilliseconds(String)
      • attach

        default void attach​(Solution solution)
        Attach a solution recorder to this solver
        Parameters:
        solution - solution object to be filled on solutions.