Packages

class RecursionDepthStrategy extends DepthFirstStrategy

Strategies that refine lazily to a fixed recursion depth, as defined in ComponentCollection. That is, they refine any component belonging to a problem for which the recursion depth associated with that subproblem is at most the depth given.

This strategy has the advantage that it guarantees no need for backtracking, because components are never visited more than once. This is made possible by the fact that the depth of a component is known at the time of expansion; i.e. it cannot change. However, this strategy is not universal: it may fail when a model uses a recursive process for which the associated component collection fails to increment the depth. For example, if one uses a recursive model without Chain function memoization and uses a SelectiveIncrementingCollection, the collection will not increment the depth at so-called recursive calls. A RecursionDepthStrategy running on such a model will fail to terminate.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. RecursionDepthStrategy
  2. DepthFirstStrategy
  3. RefiningStrategy
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new RecursionDepthStrategy(problem: Problem, initialComponents: Traversable[ProblemComponent[_]], maxDepth: Int = Int.MaxValue)

    problem

    Problem to refine.

    initialComponents

    Components from which to begin the bottom-up refining process. Often, these are the set of targets and evidence elements of a top-level problem. Refining proceeds by recursively refining the arguments of a component before generating the range of the component. This continues until the maximum recursion depth is reached.

    maxDepth

    Nonnegative maximum recursion depth for recursive subproblems. Defaults to Int.MaxValue for expansion of the entire model (does not terminate on infinite models).

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def checkArg[T](element: Element[T]): ProblemComponent[T]

    Get the problem component associated with an element.

    Get the problem component associated with an element. This may involve adding the element to the collection if a problem component has not yet been created.

    element

    Element for which to return a problem component.

    Definition Classes
    RecursionDepthStrategyDepthFirstStrategy
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val collection: ComponentCollection
    Definition Classes
    RefiningStrategy
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def execute(): Unit

    Refine in place using this strategy.

    Refine in place using this strategy. This will recursively mark as unsolved any problems whose solutions are no longer applicable as a result of refinement. This also marks problem components as fully enumerated or refined where applicable.

    Definition Classes
    DepthFirstStrategyRefiningStrategy
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def generateRange(comp: ProblemComponent[_]): Unit

    Process a component by generating its range, if it is not already fully enumerated.

    Process a component by generating its range, if it is not already fully enumerated. After calling this method, it may be necessary to check if the component is fully enumerated or refined.

    comp

    Component to process.

    Definition Classes
    RefiningStrategy
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  15. val initialComponents: Traversable[ProblemComponent[_]]
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. def markProblemsUnsolved(problems: Set[Problem]): Unit

    Recursively marks as unsolved any problem whose solution could have changed as a result of refinement by this strategy or any of its recursively generated strategies.

    Recursively marks as unsolved any problem whose solution could have changed as a result of refinement by this strategy or any of its recursively generated strategies.

    Attributes
    protected
    Definition Classes
    RefiningStrategy
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  21. def process[V](comp: ProblemComponent[V]): Unit

    Generate the range for the given component.

    Generate the range for the given component. Mark it as fully refined or enumerated if applicable.

    comp

    Component to process. This should not be called on a component we previously processed, including fully refined components.

    Definition Classes
    DepthFirstStrategy
  22. def processAtomic[V](atomicComp: AtomicComponent[V]): Unit

    Generate the range for the given atomic component.

    Generate the range for the given atomic component. Mark it as fully refined or enumerated if applicable.

    atomicComp

    Atomic component to process. This should not be called on a component we previously processed, including fully refined components.

    Definition Classes
    DepthFirstStrategy
  23. def processChain[P, V](chainComp: ChainComponent[P, V]): Unit

    Generate the range for the given Chain component.

    Generate the range for the given Chain component. Mark it as fully refined or enumerated if applicable.

    chainComp

    Chain component to process. This should not be called on a component we previously processed, including fully refined components.

    Definition Classes
    RecursionDepthStrategyDepthFirstStrategy
  24. def processMakeArray[V](maComp: MakeArrayComponent[V]): Unit

    Generate the range for the given MakeArray component.

    Generate the range for the given MakeArray component. Mark it as fully refined or enumerated if applicable.

    maComp

    MakeArray component to process. This should not be called on a component we previously processed, including fully refined components.

    Definition Classes
    RecursionDepthStrategyDepthFirstStrategy
  25. def recursionDepth(problem: Problem): Int

    Get the recursion depth associated with a problem, according to the collection.

    Get the recursion depth associated with a problem, according to the collection.

    Attributes
    protected
  26. def refine(comp: ProblemComponent[_]): Unit

    Refine a single problem component by recursively refining components on which it depends, then generating the range for each component.

    Refine a single problem component by recursively refining components on which it depends, then generating the range for each component. This guarantees that when ranges are created, all components on which a component depends will have been processed.

    As a rule, this method never works in the other direction. If component B depends (directly or indirectly) on component A, then calling decompose on A will never recursively call decompose on component B. This is to avoid infinite loops, and to guarantee that the range of A does not unpredictably change in the middle of a call to decompose A.

    Once the range has been created, the component will be added to the set done, and (if applicable) the component is marked as fully enumerated or refined.

    comp

    Component to refine. This strategy never refines a component more than once, so if the component is fully refined or in the set done, this method does nothing.

    Definition Classes
    DepthFirstStrategy
  27. def shouldRefine(comp: ProblemComponent[_]): Boolean

    Decide if this strategy should refine the given problem component.

    Decide if this strategy should refine the given problem component. This is usually based on the refinement status of the component and the components on which it depends. This check should not depend on the set done; such a check is performed separately.

    comp

    Component to consider refining.

    returns

    True if and only if this strategy should refine the argument.

    Definition Classes
    RecursionDepthStrategyDepthFirstStrategy
  28. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DepthFirstStrategy

Inherited from RefiningStrategy

Inherited from AnyRef

Inherited from Any

Ungrouped