Package org.opt4j.core.genotype
Class DoubleBounds
- java.lang.Object
-
- org.opt4j.core.genotype.DoubleBounds
-
- All Implemented Interfaces:
Bounds<java.lang.Double>
public class DoubleBounds extends java.lang.Object implements Bounds<java.lang.Double>
TheDoubleBounds
is an implementation of theBounds
for theDoubleGenotype
that accepts arrays as well as lists as bounds.
-
-
Constructor Summary
Constructors Constructor Description DoubleBounds(double[] lower, double[] upper)
Constructs aDoubleBounds
with arrays.DoubleBounds(java.util.List<java.lang.Double> lower, java.util.List<java.lang.Double> upper)
Constructs aDoubleBounds
with lists.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Double
getLowerBound(int index)
Returns the lower bound for thei
-th element.java.lang.Double
getUpperBound(int index)
Returns the upper bound for thei
-th element.
-
-
-
Constructor Detail
-
DoubleBounds
public DoubleBounds(double[] lower, double[] upper)
Constructs aDoubleBounds
with arrays.- Parameters:
lower
- the lower boundsupper
- the upper bounds
-
DoubleBounds
public DoubleBounds(java.util.List<java.lang.Double> lower, java.util.List<java.lang.Double> upper)
Constructs aDoubleBounds
with lists.- Parameters:
lower
- the lower boundsupper
- the upper bounds
-
-
Method Detail
-
getLowerBound
public java.lang.Double getLowerBound(int index)
Description copied from interface:Bounds
Returns the lower bound for thei
-th element.- Specified by:
getLowerBound
in interfaceBounds<java.lang.Double>
- Parameters:
index
- thei
-th element- Returns:
- the lower bound of the
i
-th element
-
getUpperBound
public java.lang.Double getUpperBound(int index)
Description copied from interface:Bounds
Returns the upper bound for thei
-th element.- Specified by:
getUpperBound
in interfaceBounds<java.lang.Double>
- Parameters:
index
- thei
-th element- Returns:
- the upper bound of the
i
-th element
-
-