Package xal.extension.solver
Class SatisfactionCurve
java.lang.Object
xal.extension.solver.SatisfactionCurve
Collection of satisfaction curve functions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
acceleratingSatisfaction
(double value, double minValue, double maxValue, double endSlope) Generate a satisfaction curve which accelerates and ends with the specified slopestatic double
deceleratingSatisfaction
(double value, double minValue, double maxValue, double startSlope) Generate a satisfaction curve which decelerates and begins with the specified slopestatic double
exponentialSatisfaction
(double value, double tolerance) Generate the exponential satisfaction for a given value and tolerancestatic double
inverseRisingSatisfaction
(double value, double tolerance) Generate a satisfaction based on an inverse function 1 - a / ( a + |x| )static double
inverseSatisfaction
(double value, double tolerance) Generate a satisfaction based on an inverse function a / ( a + |x| )static double
inverseSquareRisingSatisfaction
(double value, double tolerance) Generate a satisfaction based on an inverse square function 1 - a / ( a + x^2 )static double
inverseSquareSatisfaction
(double value, double tolerance) Generate a satisfaction based on an inverse square function a / ( a + x^2 )static double
linearFallingSatisfaction
(double value, double minValue, double maxValue) Generate a linear satisfaction curve which has zero at the bottom end and 1 at the top endstatic double
linearRisingSatisfaction
(double value, double minValue, double maxValue) Generate a linear satisfaction curve which has zero at the bottom end and 1 at the top endstatic double
sCurveSatisfactionWithCenterAndSlope
(double value, double center, double slope) Generate a satisfaction based on an S-Curve that extends from negative to positive infinity satisfaction = 1/2 + a ( x - x0 ) / ( 1 + 2a|x - x0| )
-
Constructor Details
-
SatisfactionCurve
protected SatisfactionCurve()Constructor
-
-
Method Details
-
exponentialSatisfaction
public static double exponentialSatisfaction(double value, double tolerance) Generate the exponential satisfaction for a given value and tolerance- Parameters:
value
- the value to testtolerance
- the tolerance corresponding to 90% satisfaction
-
inverseSatisfaction
public static double inverseSatisfaction(double value, double tolerance) Generate a satisfaction based on an inverse function a / ( a + |x| )- Parameters:
value
- the value to testtolerance
- the tolerance corresponding to 90% satisfaction
-
inverseRisingSatisfaction
public static double inverseRisingSatisfaction(double value, double tolerance) Generate a satisfaction based on an inverse function 1 - a / ( a + |x| )- Parameters:
value
- the value to testtolerance
- the tolerance corresponding to 90% satisfaction
-
inverseSquareSatisfaction
public static double inverseSquareSatisfaction(double value, double tolerance) Generate a satisfaction based on an inverse square function a / ( a + x^2 )- Parameters:
value
- the value to testtolerance
- the tolerance corresponding to 90% satisfaction
-
inverseSquareRisingSatisfaction
public static double inverseSquareRisingSatisfaction(double value, double tolerance) Generate a satisfaction based on an inverse square function 1 - a / ( a + x^2 )- Parameters:
value
- the value to testtolerance
- the tolerance corresponding to 90% satisfaction
-
sCurveSatisfactionWithCenterAndSlope
public static double sCurveSatisfactionWithCenterAndSlope(double value, double center, double slope) Generate a satisfaction based on an S-Curve that extends from negative to positive infinity satisfaction = 1/2 + a ( x - x0 ) / ( 1 + 2a|x - x0| )- Parameters:
value
- the value to testcenter
- the center value of the satisfaction curveslope
- the slope of the satisfaction curve at the center
-
linearRisingSatisfaction
public static double linearRisingSatisfaction(double value, double minValue, double maxValue) Generate a linear satisfaction curve which has zero at the bottom end and 1 at the top end- Parameters:
value
- the value to testminValue
- the minimum valuemaxValue
- the maximum value
-
linearFallingSatisfaction
public static double linearFallingSatisfaction(double value, double minValue, double maxValue) Generate a linear satisfaction curve which has zero at the bottom end and 1 at the top end- Parameters:
value
- the value to testminValue
- the minimum valuemaxValue
- the maximum value
-
acceleratingSatisfaction
public static double acceleratingSatisfaction(double value, double minValue, double maxValue, double endSlope) Generate a satisfaction curve which accelerates and ends with the specified slope- Parameters:
value
- the value to testminValue
- the minimum valuemaxValue
- the maximum valueendSlope
- the slope at the end point
-
deceleratingSatisfaction
public static double deceleratingSatisfaction(double value, double minValue, double maxValue, double startSlope) Generate a satisfaction curve which decelerates and begins with the specified slope- Parameters:
value
- the value to testminValue
- the minimum valuemaxValue
- the maximum valuestartSlope
- the slope at the start point
-