Enum Class RampCurve

java.lang.Object
java.lang.Enum<RampCurve>
org.mockserver.load.RampCurve
All Implemented Interfaces:
Serializable, Comparable<RampCurve>, Constable

public enum RampCurve extends Enum<RampCurve>
The interpolation curve used to ramp a value (virtual users or arrival rate) from a start setpoint to an end setpoint across a LoadStage as its progress p advances over [0, 1].

valueAt(double, double, double) is the single, pure, tested source of truth for the curve math so both the closed-model VU driver and the open-model arrival-rate scheduler interpolate identically. At the endpoints every curve is exact: valueAt(start,end,0)==start and valueAt(start,end,1)==end.

  • LINEARstart + (end-start)*p (constant slope).
  • QUADRATICstart + (end-start)*p*p (ease-in: slow then fast).
  • EXPONENTIALstart + (end-start) * (exp(K*p)-1)/(exp(K)-1) with K=4 (a steeper ease-in; this normalised form is exact at the endpoints and handles start=0 correctly).
  • Enum Constant Details

    • LINEAR

      public static final RampCurve LINEAR
    • QUADRATIC

      public static final RampCurve QUADRATIC
    • EXPONENTIAL

      public static final RampCurve EXPONENTIAL
  • Method Details

    • values

      public static RampCurve[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static RampCurve valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueAt

      public double valueAt(double start, double end, double p)
      Interpolate between start and end at progress p using this curve. p is clamped to [0, 1] so an over-run stage stays pinned at end.