|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlio.individuals.Individual
lio.individuals.ContChain
public class ContChain
This class is used to manage individuals represented by an array of double.
Field Summary | |
---|---|
protected double[] |
mChain
Array which contains the elements |
Fields inherited from class lio.individuals.Individual |
---|
evaluated, maxSize, size, value |
Constructor Summary | |
---|---|
ContChain(double[] pChain)
Creates a new instance of ContChain from an array of double. |
|
ContChain(int pSize)
Creates a new instance of permutation using the positions as values. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones an individual. |
static ContChain[] |
doubleToIndividual(double[][] pSample)
Static method which allows building an array of ContChain from a matrix of double. |
double |
get(int pos)
Returns the value stored in position pos. |
double[] |
getCopyOfElements()
Returns a copy of the elements which form the individual. |
double[] |
getElements()
Returns a reference to the elements which form the individual. |
void |
set(int pos,
double value)
Fixes de value of element in position. |
void |
setElements(double[] elements)
Sets the elements of a individual from an array of integer. |
java.lang.String |
toString()
String representation of the individual. |
Methods inherited from class lio.individuals.Individual |
---|
change, compareTo, getMaxSize, getSize, isEvaluated, setMaxSize, setSize, setValue, value |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected double[] mChain
Constructor Detail |
---|
public ContChain(double[] pChain)
pChain
- Array of integers containing the permutation.public ContChain(int pSize)
pSize
- size of the permutation.Method Detail |
---|
public double[] getElements()
public double[] getCopyOfElements()
public void setElements(double[] elements)
elements
- Array of double that code the individual.public double get(int pos)
pos
- Position whose value is required.
public void set(int pos, double value)
pos
- Position whose value must be changed.public java.lang.String toString()
toString
in class Individual
public java.lang.Object clone()
Individual
clone
in class Individual
public static ContChain[] doubleToIndividual(double[][] pSample)
pSample
- Two dimension matrix containing the values for the individuals.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |