public class DeltaIndividual extends Individual<DeltaIndividual>
Population
Modifier and Type | Field and Description |
---|---|
java.util.List<Block> |
blocks |
badnessComponents, ref, rwLock
Modifier and Type | Method and Description |
---|---|
double |
calculateOverlap()
Calculates the overlap of the complete placement.
|
double |
calculateSpread() |
int |
compareTo(DeltaIndividual other)
Method to compare the badness with another individual.
|
void |
copyFrom(DeltaIndividual other)
Method to copy the genes (Blocks) and badness from another Individual.
|
void |
deriveFrom(DeltaIndividual mom,
DeltaIndividual dad,
java.util.Random rand)
Method to do a crossover of two genomes and write the result to the Individual's genome.
|
double |
distance() |
double |
distance(DeltaIndividual other) |
void |
evaluate()
Evaluate the individual by calculating an estimate of the network length and
the overlap area between PlacementNodes or Delta-blocks.
|
double |
getBadness()
Method to return the evaluated "un-fitness" of the Individual.
|
double |
getBoundingBoxArea()
Method to calculate the bounding box area of the Blocks.
|
double |
getHash() |
double[] |
getHashes() |
double |
getNetLength() |
double |
getRotHash() |
double |
getSemiperimeterLength()
Method to calculate the semiperimeter of the bounding box of the Blocks.
|
double |
getSize() |
double |
getXHash() |
double |
getYHash() |
Block |
insertBlock(java.util.Random rand,
int nodeNr,
boolean mutation)
Method to fetch a node from the reference and insert a corresponding
block into the list of deltas.
|
void |
mutate(java.util.Random rand)
Method to mutate a random amount of Blocks.
|
double |
old_calculateOverlap() |
void |
prepareForTest() |
void |
reboot(java.util.Random rand) |
void |
setBadness(double[] otherComponents) |
void |
setProgress(double p) |
void |
swapBlocks(java.util.Random rand)
Method to randomly swap the position of 2 blocks.
|
void |
writeToPlacement(java.util.List<PlacementFrame.PlacementNode> nodesToPlace) |
getBadnessComponents
public java.util.List<Block> blocks
public void reboot(java.util.Random rand)
reboot
in class Individual<DeltaIndividual>
public void prepareForTest()
public void setProgress(double p)
setProgress
in class Individual<DeltaIndividual>
public void writeToPlacement(java.util.List<PlacementFrame.PlacementNode> nodesToPlace)
writeToPlacement
in class Individual<DeltaIndividual>
public int compareTo(DeltaIndividual other)
compareTo
in interface java.lang.Comparable<DeltaIndividual>
compareTo
in class Individual<DeltaIndividual>
other
- The Individual to be used as a reference.public void copyFrom(DeltaIndividual other)
copyFrom
in class Individual<DeltaIndividual>
other
- The Individual to be cloned.public void deriveFrom(DeltaIndividual mom, DeltaIndividual dad, java.util.Random rand)
deriveFrom
in class Individual<DeltaIndividual>
mom
- One donor of genes.dad
- The other donor of genes.public double distance(DeltaIndividual other)
distance
in class Individual<DeltaIndividual>
public double distance()
distance
in class Individual<DeltaIndividual>
public void swapBlocks(java.util.Random rand)
public Block insertBlock(java.util.Random rand, int nodeNr, boolean mutation)
public void mutate(java.util.Random rand)
mutate
in class Individual<DeltaIndividual>
public double calculateOverlap()
calculateOverlap
in class Individual<DeltaIndividual>
public double old_calculateOverlap()
public double getBoundingBoxArea()
getBoundingBoxArea
in class Individual<DeltaIndividual>
public double getSemiperimeterLength()
getSemiperimeterLength
in class Individual<DeltaIndividual>
public double getNetLength()
getNetLength
in class Individual<DeltaIndividual>
public void evaluate()
evaluate
in class Individual<DeltaIndividual>
public double getSize()
getSize
in class Individual<DeltaIndividual>
public double getBadness()
getBadness
in class Individual<DeltaIndividual>
public double calculateSpread()
public void setBadness(double[] otherComponents)
setBadness
in class Individual<DeltaIndividual>
public double getXHash()
getXHash
in class Individual<DeltaIndividual>
public double getYHash()
getYHash
in class Individual<DeltaIndividual>
public double getRotHash()
getRotHash
in class Individual<DeltaIndividual>
public double getHash()
getHash
in class Individual<DeltaIndividual>
public double[] getHashes()
getHashes
in class Individual<DeltaIndividual>