|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlio.individuals.Individual
lio.individuals.Permutation
public class Permutation
This class is used to manage individuals composed by a chain of binary values.
| Field Summary |
|---|
| Fields inherited from class lio.individuals.Individual |
|---|
evaluated, maxSize, size, value |
| Constructor Summary | |
|---|---|
Permutation(int pSize)
Creates a new instance of permutation using the positions as values. |
|
Permutation(int[] pChain)
Creates a new instance of Permutation from an array of integers. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones an individual. |
int |
get(int pos)
Returns the value stored in position pos. |
int[] |
getCopyOfElements()
Returns a copy of the elements which form the individual. |
int[] |
getElements()
Returns a reference to the elements which form the individual. |
static Permutation[] |
intToIndividual(int[][] pSample)
Static method which allows building an array of permutations from a matrix of integer. |
void |
set(int pos,
int value)
Fixes element value in this position. |
void |
setElements(int[] 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 |
| Constructor Detail |
|---|
public Permutation(int[] pChain)
pChain - Array of integers containing the permutation.public Permutation(int pSize)
pSize - size of the permutation.| Method Detail |
|---|
public void setElements(int[] elements)
elements - Array of integers that code the individual.public int[] getCopyOfElements()
public int[] getElements()
public int get(int pos)
pos - Position whose value is required.
public void set(int pos,
int value)
pos - Position whose value must be changed.value - for this position.public java.lang.String toString()
toString in class Individualpublic static Permutation[] intToIndividual(int[][] pSample)
pSample - Two dimension matrix containing the values for the
individuals.
public java.lang.Object clone()
Individual
clone in class Individual
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||