Class AbstractExercise
java.lang.Object
net.finmath.modelling.AbstractExercise
- All Implemented Interfaces:
Exercise
- Direct Known Subclasses:
AmericanExercise, BermudanExercise, EuropeanExercise
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final doubleThe time tolerance. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractExercise(double maturity, double[] exerciseTimes) Creates an exercise specification. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Returns the exercise times in running time.doubleReturns the maturity of the contract in running time.protected booleanisScheduledExerciseTime(double time) Helper to test whether a time coincides with one of the scheduled exercise times.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Exercise
isAmerican, isBermudan, isContinuousExercise, isEuropean, isExerciseAllowed
-
Field Details
-
TIME_TOLERANCE
protected static final double TIME_TOLERANCEThe time tolerance.- See Also:
-
-
Constructor Details
-
AbstractExercise
protected AbstractExercise(double maturity, double[] exerciseTimes) Creates an exercise specification.- Parameters:
maturity- The maturity.exerciseTimes- The exercise times in running time.
-
-
Method Details
-
getMaturity
public double getMaturity()Description copied from interface:ExerciseReturns the maturity of the contract in running time.- Specified by:
getMaturityin interfaceExercise- Returns:
- The maturity.
-
getExerciseTimes
public double[] getExerciseTimes()Description copied from interface:ExerciseReturns the exercise times in running time.For European exercise this is typically a singleton containing only the maturity. For American exercise this may also return only the maturity, since the exercise region is continuous and not represented by a finite list. For Bermudan exercise this returns the scheduled exercise dates.
- Specified by:
getExerciseTimesin interfaceExercise- Returns:
- The exercise times.
-
isScheduledExerciseTime
protected boolean isScheduledExerciseTime(double time) Helper to test whether a time coincides with one of the scheduled exercise times.- Parameters:
time- The running time.- Returns:
- True if the time matches one of the scheduled exercise times.
-