public class Variable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected double |
_initialValue
the initial value/guess assigned to the variable
|
protected double |
_lowerLimit
the lowest value that can be assigned to the variable
|
protected java.lang.String |
_name
the name of the variable
|
protected double |
_upperLimit
the highest value that can be assigned to the variable
|
Constructor and Description |
---|
Variable(java.lang.String name,
double initialValue,
double lowerLimit,
double upperLimit)
Creates a new instance of Variable.
|
Modifier and Type | Method and Description |
---|---|
Variable |
copyWithInitialValue(double initialValue)
Copy this variable but substitute the specified initial value for this variable's initial value.
|
double |
getInitialValue()
Get the initial value (i.e.
|
double |
getLowerLimit()
Get the lowest value that can be assigned to this variable.
|
java.lang.String |
getName()
Get this variable's name.
|
double |
getUpperLimit()
Get the highest value that can be assigned to this variable.
|
java.lang.String |
toString()
A string for displaying a variable.
|
protected final java.lang.String _name
protected final double _initialValue
protected final double _lowerLimit
protected final double _upperLimit
public Variable(java.lang.String name, double initialValue, double lowerLimit, double upperLimit)
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 variablepublic Variable copyWithInitialValue(double initialValue)
initialValue
- initial value to use for the new variablepublic java.lang.String getName()
public double getInitialValue()
public double getLowerLimit()
public double getUpperLimit()
public java.lang.String toString()
toString
in class java.lang.Object