Class ExerciseStrategy<TState>
An early-exercise strategy stepped along a path: at each of its relevant times it is told the state, and at each exercise time it says whether to exercise.
[WorkingType]
public abstract class ExerciseStrategy<TState>
Type Parameters
TStateThe state the strategy reads.
- Inheritance
-
ExerciseStrategy<TState>
- Derived
- Inherited Members
Remarks
A working type and an extension point: Reset() and NextStep(TState) change it, Exercise(TState) may change its scratch, and it isn't thread-safe; a holder steps its own Clone().
Constructors
ExerciseStrategy()
protected ExerciseStrategy()
Methods
Clone()
A deep copy of the strategy, its state included.
public abstract ExerciseStrategy<TState> Clone()
Returns
- ExerciseStrategy<TState>
The copy.
Exercise(TState)
Whether to exercise in the given state, at the current exercise time.
public abstract bool Exercise(TState currentState)
Parameters
currentStateTStateThe state.
Returns
ExerciseTimes()
The times at which the strategy can exercise.
public abstract ImmutableArray<double> ExerciseTimes()
Returns
- ImmutableArray<double>
The exercise times.
NextStep(TState)
Moves the strategy to its next relevant time, in the given state.
public abstract void NextStep(TState currentState)
Parameters
currentStateTStateThe state.
RelevantTimes()
The times at which the strategy is told the state: the exercise times and any it reads.
public abstract ImmutableArray<double> RelevantTimes()
Returns
- ImmutableArray<double>
The relevant times.
Reset()
Puts the strategy at the start of a path.
public abstract void Reset()