|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--Chromosome
Chromosome representation of vehicle routes.
| Constructor Summary | |
Chromosome(int length)
Creates a chromosome with customers randomly distributed. |
|
Chromosome(int[] gene)
Creates a chromosome based on an already defined array of customers. |
|
Chromosome(java.util.Vector genes)
Creates a chromosome based on an already defined Vector of customers. |
|
| Method Summary | |
int |
getGene(int i)
Gets the gene at a certain location within the chromosome. |
int |
getSize()
|
void |
swap(int i,
int j)
Swaps two genes in a chromosome. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public Chromosome(int length)
length - Number of customers.public Chromosome(int[] gene)
gene - Array of customers reperesented as ints.public Chromosome(java.util.Vector genes)
genes - Vector of customers represented as Integers.| Method Detail |
public void swap(int i,
int j)
i - First gene to be swapped.j - Second gene to be swapped.public int getGene(int i)
i - Location within the chromosome.
public int getSize()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||