|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlio.individuals.Individual
lio.individuals.BitChain
public class BitChain
This class implements those individuals coded with a chain of bits.
Field Summary |
---|
Fields inherited from class lio.individuals.Individual |
---|
evaluated, maxSize, size, value |
Constructor Summary | |
---|---|
BitChain(BitChain oldBitChain)
Create a new instance of BitChain from another object |
|
BitChain(int pSize)
Creates a new instance (full of 0s) with the specified size. |
|
BitChain(int[] pChain)
Creates a new instance of BitChain 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 BitChain[] |
intToIndividual(int[][] pSample)
Static method which allows building an array of individuals 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 BitChain(int[] pChain)
pChain
- chain of bits that represents the individual.public BitChain(int pSize)
public BitChain(BitChain oldBitChain)
oldBitChain
- object from which values are takenMethod Detail |
---|
public int[] getCopyOfElements()
public int[] getElements()
public void setElements(int[] elements)
elements
- Array of integers that code the individual.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 Individual
public java.lang.Object clone()
Individual
clone
in class Individual
public static BitChain[] intToIndividual(int[][] 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 |