deferred class ABSTRACT_BACKTRACKING_ALTERNATIVE
Summary
Abstract realisation of an alternative iterator for the ABSTRACT_BACKTRACKING
The ABSTRACT_BACKTRACKING uses the fields continuation and top_sequence to record its exploration state and calls the feature 'next_alternative' to let the current object choose how to continue the exploration.
Direct parents
Inherit list: ABSTRACT_BACKTRACKING_POOLABLE
Known children
Inherit list: BACKTRACKING_ALTERNATIVE, BACKTRACKING_ALTERNATIVE_LIST
Overview
Features
{ABSTRACT_BACKTRACKING_POOL, ABSTRACT_BACKTRACKING}
  • previous: ABSTRACT_BACKTRACKING_ALTERNATIVE
    For the linked stack of alternatives.
{ABSTRACT_BACKTRACKING}
{ANY}
  • release
    Called by ABSTRACT_BACKTRACKING to release current instance to the pool.
  • get_twin: ABSTRACT_BACKTRACKING_ALTERNATIVE
    Return a twin of current from the pool
  • pool: ABSTRACT_BACKTRACKING_POOL[ABSTRACT_BACKTRACKING_ALTERNATIVE]
    The pool that will record Current
{ABSTRACT_BACKTRACKING_POOL}
previous: ABSTRACT_BACKTRACKING_ALTERNATIVE
writable attribute
For the linked stack of alternatives.
Managed by ABSTRACT_BACKTRACKING.
writable attribute
The sequence to continue after a success in exploration of the current alternative.
Managed by ABSTRACT_BACKTRACKING.
set_continuation (value: ABSTRACT_BACKTRACKING_SEQUENCE)
effective procedure
ensure
writable attribute
Record of the top of the stack of sequence to restore the state of the exploration after that all alternatives were explored.
Managed by ABSTRACT_BACKTRACKING.
set_top_sequence (value: ABSTRACT_BACKTRACKING_SEQUENCE)
effective procedure
ensure
next_alternative (explorer: ABSTRACT_BACKTRACKING)
deferred procedure
Called by ABSTRACT_BACKTRACKING to let the current object switch to the next alternative to explore.
Two actions must be performed by that feature:
  - make iteration actions and then call
     'continue_alternative' if iteration is not ended
     and that current object must be called again to
     switch to an other alternative or else call
     'pop_alternative' if this is the last alternative
     to be explored.
  - select the state to be evaluated or
     call 'continue' or call 'backtrack'.
require
  • is_on_top: Current = explorer.top_alternative
release
effective procedure
{ANY}
Called by ABSTRACT_BACKTRACKING to release current instance to the pool.
require
get_twin: ABSTRACT_BACKTRACKING_ALTERNATIVE
effective function
{ANY}
Return a twin of current from the pool
require ensure
pool: ABSTRACT_BACKTRACKING_POOL[ABSTRACT_BACKTRACKING_ALTERNATIVE]
deferred function
{ANY}
The pool that will record Current
Internal link used by the pool to chain its poolable items.
Technical note: to give more freedom for further usages of 'pool_link' it is not defined with type anchorage.
set_pool_link (other: ABSTRACT_BACKTRACKING_POOLABLE)
effective procedure
Set 'pool_link' to 'other'
ensure