Module org.cicirello.chips_n_salsa
Interface RealValued
- All Known Implementing Classes:
BoundedRealVector
,CauchyMutation
,GaussianMutation
,RealVector
,SingleReal
,UndoableCauchyMutation
,UndoableGaussianMutation
,UndoableUniformMutation
,UniformMutation
public interface RealValued
An interface to define the parameters to a function, where the function parameters are
represented as type double (i.e., as double precision floating point numbers). Classes
implementing this interface may be applicable for real-valued function optimization problems.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
get
(int i) Accesses the current value of a specified parameter.int
length()
Gets the number of parameters.default void
set
(double[] values) Sets all values from an array (copies values from the array).void
set
(int i, double value) Sets a function parameter to a specified value.double[]
toArray
(double[] values) Accesses the current values of all of the parameters.
-
Method Details
-
length
int length()Gets the number of parameters.- Returns:
- The number of parameters for this function.
-
get
double get(int i) Accesses the current value of a specified parameter.- Parameters:
i
- The parameter to get.- Returns:
- The current value of the i-th parameter.
- Throws:
ArrayIndexOutOfBoundsException
- if i < 0 or i ≥ length().
-
toArray
double[] toArray(double[] values) Accesses the current values of all of the parameters.- Parameters:
values
- An array to hold the result. If values is null or if values.length is not equal to this.length(), then a new array is constructed for the result.- Returns:
- An array containing the current values of all of the parameters.
-
set
void set(int i, double value) Sets a function parameter to a specified value.- Parameters:
i
- The parameter to set.value
- The new value for the i-th parameter.- Throws:
ArrayIndexOutOfBoundsException
- if i < 0 or i ≥ length().
-
set
default void set(double[] values) Sets all values from an array (copies values from the array).- Parameters:
values
- an array of new values
-