Package xal.extension.solver
Class Variable
java.lang.Object
xal.extension.solver.Variable
Variable describes a parameter that may be varied by the solver. It specifies
a name, an initial guess and upper and lower limits.
- Author:
- ky6, t6p
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected double
the initial value/guess assigned to the variableprotected double
the lowest value that can be assigned to the variableprotected final String
the name of the variableprotected double
the highest value that can be assigned to the variable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopyWithInitialValue
(double initialValue) Copy this variable but substitute the specified initial value for this variable's initial value.double
Get the initial value (i.e. initial guess).double
Get the lowest value that can be assigned to this variable.getName()
Get this variable's name.double
Get the highest value that can be assigned to this variable.void
setInitialValue
(double initialValue) void
setLowerLimit
(double lowerLimit) void
setUpperLimit
(double upperLimit) toString()
A string for displaying a variable.
-
Field Details
-
name
the name of the variable -
initialValue
protected double initialValuethe initial value/guess assigned to the variable -
lowerLimit
protected double lowerLimitthe lowest value that can be assigned to the variable -
upperLimit
protected double upperLimitthe highest value that can be assigned to the variable
-
-
Constructor Details
-
Variable
Creates a new instance of Variable.- Parameters:
initialValue
- the initial first guess for the variable (e.g. starting point)name
- the name to assign to the variablelowerLimit
- the lowest value that should be assigned to the variableupperLimit
- the highest value that should be assigned to the variable
-
-
Method Details
-
copyWithInitialValue
Copy this variable but substitute the specified initial value for this variable's initial value.- Parameters:
initialValue
- initial value to use for the new variable- Returns:
- new variable with the same properties as this instance but substituting the specified initial value
-
getName
Get this variable's name.- Returns:
- this variable's name
-
getInitialValue
public double getInitialValue()Get the initial value (i.e. initial guess).- Returns:
- the initial value
-
getLowerLimit
public double getLowerLimit()Get the lowest value that can be assigned to this variable.- Returns:
- the lower limit
-
getUpperLimit
public double getUpperLimit()Get the highest value that can be assigned to this variable.- Returns:
- the upper limit
-
setInitialValue
public void setInitialValue(double initialValue) -
setLowerLimit
public void setLowerLimit(double lowerLimit) -
setUpperLimit
public void setUpperLimit(double upperLimit) -
toString
A string for displaying a variable. The string consist of a title, an initial value, a lower limit and an upper limit.
-