|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.optiloading.Chromosome
public class Chromosome
Chromosome class which stores properties of each chromosome and handles methods as creation, mutation and crossover.
Constructor Summary | |
---|---|
Chromosome()
Constructor which creates a new Chromosome using the full tank method. |
|
Chromosome(boolean chose)
Constructor which creates a new Chromosome using the random tank method. |
Method Summary | |
---|---|
java.lang.Object |
clone()
clone method is the overwritten method of the Object object which also copies the ArrayList of volumes. |
int |
compareTo(Chromosome c)
compareTo method is the overwritten method of the Object object which tells how two Chromosomes should be compared. |
void |
crossOverMean(Chromosome other)
crossOverMean method is used to perform a crossover where the the mean value of each tank volume is taken. |
void |
crossOverOnePoint(Chromosome other)
crossOverOnePoint method is used to perform a crossover where until a certain point we get volumes from this chromosome and from that point on combine them with volumes from the other chromosome. |
void |
crossOverTwoPoint(Chromosome other)
crossOverTwoPoint method is used to perform a crossover where we take volumes from the other chromosome from one point to another and put those volumes in between the values of the original chromosome. |
void |
crossOverUniform(Chromosome other)
crossOverUniform method is used to perform a crossover where the volume of a tank is randomly taken from this or the other chromosome, after which a correction is applied. |
float |
getBM()
getBM method is used to get the BM of the current Chromosome. |
float |
getDaft()
getDaft method is used to get the draught aft of the current Chromosome. |
float |
getDfwd()
getDfwd method is used to get the draught fwd of the current Chromosome. |
float |
getDynstab()
getDynstab method is used to get the area under 0-30 of the current Chromosome. |
float |
getFitness()
getFitness method is used to get the fitness value of the current Chromosome. |
float |
getFSC()
getFSC method is used to get the free surface correction of the current Chromosome. |
float |
getGM()
getGM method is used to get the GM value of the current Chromosome. |
float |
getTrim()
getTrim method is used to get the trim value of the current Chromosome. |
java.util.ArrayList<java.lang.Float> |
getVolumes()
getVolumes method is used to get the ArrayList of the volume values of the current Chromosome. |
void |
mutateRandom()
mutateRandom method subtracts a random value from one tank and add this value to another tank. |
void |
mutateSwitch()
mutateSwitch method randomly switches tank volumes and checks if the new solution is valid. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Chromosome()
public Chromosome(boolean chose)
chose
- Boolean value indicating that u want to use this method to create new chromosomes.Method Detail |
---|
public int compareTo(Chromosome c)
compareTo
in interface java.lang.Comparable<Chromosome>
c
- Chromosome object which is to be compared to this Chromosome object.public float getFitness()
public java.util.ArrayList<java.lang.Float> getVolumes()
public float getTrim()
public float getDfwd()
public float getDaft()
public float getGM()
public float getFSC()
public float getBM()
public float getDynstab()
public void crossOverMean(Chromosome other)
other
- Chromosome object to crossover with this Chromosome object.public void crossOverOnePoint(Chromosome other)
other
- Chromosome object to crossover with this Chromosome object.public void crossOverTwoPoint(Chromosome other)
other
- Chromosome object to crossover with this Chromosome object.public void crossOverUniform(Chromosome other)
other
- Chromosome object to crossover with this Chromosome object.public void mutateSwitch()
public void mutateRandom()
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |