Class AbstractExercise

java.lang.Object
net.finmath.modelling.AbstractExercise
All Implemented Interfaces:
Exercise
Direct Known Subclasses:
AmericanExercise, BermudanExercise, EuropeanExercise

public abstract class AbstractExercise extends Object implements Exercise
Base class for exercise specifications.
Author:
Alessandro Gnoatto
  • Field Details

    • TIME_TOLERANCE

      protected static final double TIME_TOLERANCE
      The 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: Exercise
      Returns the maturity of the contract in running time.
      Specified by:
      getMaturity in interface Exercise
      Returns:
      The maturity.
    • getExerciseTimes

      public double[] getExerciseTimes()
      Description copied from interface: Exercise
      Returns 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:
      getExerciseTimes in interface Exercise
      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.