public abstract class Individual<I extends Individual>
extends java.lang.Object
implements java.lang.Comparable<I>
DeltaIndividual
Modifier and Type | Field and Description |
---|---|
protected double[] |
badnessComponents |
Reference |
ref |
java.util.concurrent.locks.ReadWriteLock |
rwLock |
Modifier and Type | Method and Description |
---|---|
abstract double |
calculateOverlap()
Calculates the overlap of all Blocks (PlacementNodes).
|
int |
compareTo(I other)
Method to compare the badness with another individual.
|
abstract void |
copyFrom(I other)
Method to copy the genes (Blocks) and badness from another Individual.
|
abstract void |
deriveFrom(I mom,
I dad,
java.util.Random rand)
Method to do a crossover of two genomes and write the result to the Individual's genome.
|
double |
distance() |
abstract double |
distance(I other) |
abstract void |
evaluate() |
double |
getBadness()
Method to return the evaluated "un-fitness" of the Individual.
|
double[] |
getBadnessComponents() |
abstract double |
getBoundingBoxArea()
Method to calculate the bounding box area of the Blocks.
|
double |
getHash() |
double[] |
getHashes() |
abstract double |
getNetLength() |
double |
getRotHash() |
abstract double |
getSemiperimeterLength()
Method to calculate the semiperimeter of the bounding box of the Blocks.
|
double |
getSize() |
double |
getXHash() |
double |
getYHash() |
abstract void |
mutate(java.util.Random rand) |
abstract void |
reboot(java.util.Random rand) |
void |
setBadness(double[] otherComponents) |
void |
setProgress(double p) |
abstract void |
writeToPlacement(java.util.List<PlacementFrame.PlacementNode> nodesToPlace) |
protected double[] badnessComponents
public java.util.concurrent.locks.ReadWriteLock rwLock
public Reference ref
public abstract void evaluate()
public abstract void reboot(java.util.Random rand)
public double distance()
public void setProgress(double p)
public double getSize()
public abstract double distance(I other)
public abstract void writeToPlacement(java.util.List<PlacementFrame.PlacementNode> nodesToPlace)
public int compareTo(I other)
compareTo
in interface java.lang.Comparable<I extends Individual>
other
- The Individual to be used as a reference.public abstract void copyFrom(I other)
other
- The Individual to be cloned.public abstract void mutate(java.util.Random rand)
public abstract void deriveFrom(I mom, I dad, java.util.Random rand)
mom
- One donor of genes.dad
- The other donor of genes.public abstract double calculateOverlap()
public abstract double getBoundingBoxArea()
public abstract double getSemiperimeterLength()
public abstract double getNetLength()
public double[] getBadnessComponents()
public double getBadness()
public void setBadness(double[] otherComponents)
public double getXHash()
public double getYHash()
public double getRotHash()
public double[] getHashes()
public double getHash()