Package evo.search.io.entities
Class Configuration
- java.lang.Object
-
- evo.search.io.entities.Configuration
-
- All Implemented Interfaces:
XmlEntity<Configuration>
,Serializable
,Cloneable
public class Configuration extends Object implements Cloneable, XmlEntity<Configuration>, Serializable
Environment configuration for the evolution.- See Also:
Evolution.run()
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Configuration.ConfigurationBuilder
-
Constructor Summary
Constructors Constructor Description Configuration()
Configuration(String version, String name, int limit, int positions, List<Double> distances, List<DiscreteGene> treasures, Evolution.Fitness fitness, List<? extends DiscreteAlterer> alterers, io.jenetics.Selector<DiscreteGene,Double> selector, int offspring, int population, boolean chooseWithoutPermutation, double distanceMutationDelta)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Configuration.ConfigurationBuilder
builder()
protected boolean
canEqual(Object other)
Configuration
clone()
boolean
equals(Object o)
boolean
geneSequenceValidator(io.jenetics.util.ISeq<DiscreteGene> geneSequence)
Validator for a sequence ofDiscreteGene
s.io.jenetics.Genotype<DiscreteGene>
genotypeFactory()
Shuffle a new chromosome withDiscreteGene
s from the distance list.List<? extends DiscreteAlterer>
getAlterers()
List of alterers used during theEvolution
's mutation phase.double
getDistanceMutationDelta()
Value of maximum distance change during the mutation.List<Double>
getDistances()
Input distances to choose a permutation from.Evolution.Fitness
getFitness()
Fitness method used to evaluate the individuals.int
getLimit()
Last execution limit for the evolution method.String
getName()
The configurations name.int
getOffspring()
Amount of offspring individuals.int
getPopulation()
Population size.int
getPositions()
The amount of positions available for theDiscreteGene
s.io.jenetics.Selector<DiscreteGene,Double>
getSelector()
Selection method for offspring.List<DiscreteGene>
getTreasures()
List of treasureDiscreteGene
s to search for.String
getVersion()
Version for configuration compatibility checks.int
hashCode()
boolean
isChooseWithoutPermutation()
State of whether to choose the distances in a permutation during the shuffle of new individuals.Configuration
parse(org.dom4j.Element rootElement)
Parse aElement
and return the entity.org.dom4j.Element
serialize()
Serialize the entity into aElement
.void
setAlterers(List<? extends DiscreteAlterer> alterers)
List of alterers used during theEvolution
's mutation phase.void
setChooseWithoutPermutation(boolean chooseWithoutPermutation)
State of whether to choose the distances in a permutation during the shuffle of new individuals.void
setDistanceMutationDelta(double distanceMutationDelta)
Value of maximum distance change during the mutation.void
setDistances(List<Double> distances)
Input distances to choose a permutation from.void
setFitness(Evolution.Fitness fitness)
Fitness method used to evaluate the individuals.void
setLimit(int limit)
Last execution limit for the evolution method.void
setName(String name)
The configurations name.void
setOffspring(int offspring)
Amount of offspring individuals.void
setPopulation(int population)
Population size.void
setPositions(int positions)
The amount of positions available for theDiscreteGene
s.void
setSelector(io.jenetics.Selector<DiscreteGene,Double> selector)
Selection method for offspring.void
setTreasures(List<DiscreteGene> treasures)
List of treasureDiscreteGene
s to search for.void
setVersion(String version)
Version for configuration compatibility checks.String
toString()
-
-
-
Constructor Detail
-
Configuration
public Configuration()
-
Configuration
public Configuration(String version, String name, int limit, int positions, List<Double> distances, List<DiscreteGene> treasures, Evolution.Fitness fitness, List<? extends DiscreteAlterer> alterers, io.jenetics.Selector<DiscreteGene,Double> selector, int offspring, int population, boolean chooseWithoutPermutation, double distanceMutationDelta)
-
-
Method Detail
-
clone
public Configuration clone()
-
parse
public Configuration parse(org.dom4j.Element rootElement)
Description copied from interface:XmlEntity
Parse aElement
and return the entity.- Specified by:
parse
in interfaceXmlEntity<Configuration>
- Parameters:
rootElement
- element to parse- Returns:
- parsed entity
-
serialize
public org.dom4j.Element serialize()
Description copied from interface:XmlEntity
Serialize the entity into aElement
.- Specified by:
serialize
in interfaceXmlEntity<Configuration>
- Returns:
- serialized document
-
genotypeFactory
public io.jenetics.Genotype<DiscreteGene> genotypeFactory()
Shuffle a new chromosome withDiscreteGene
s from the distance list.- Returns:
- shuffled chromosome from distance list
-
geneSequenceValidator
public boolean geneSequenceValidator(io.jenetics.util.ISeq<DiscreteGene> geneSequence)
Validator for a sequence ofDiscreteGene
s.- Parameters:
geneSequence
- sequence of genes to validate- Returns:
- whether the gene sequence is valid or not
-
builder
public static Configuration.ConfigurationBuilder builder()
-
getVersion
public String getVersion()
Version for configuration compatibility checks.
-
getName
public String getName()
The configurations name.
-
getLimit
public int getLimit()
Last execution limit for the evolution method.
-
getPositions
public int getPositions()
The amount of positions available for theDiscreteGene
s.
-
getDistances
public List<Double> getDistances()
Input distances to choose a permutation from. Forms singleDiscreteGene
chromosomes.
-
getTreasures
public List<DiscreteGene> getTreasures()
List of treasureDiscreteGene
s to search for.
-
getFitness
public Evolution.Fitness getFitness()
Fitness method used to evaluate the individuals.- See Also:
Evolution.Fitness
-
getAlterers
public List<? extends DiscreteAlterer> getAlterers()
List of alterers used during theEvolution
's mutation phase.
-
getSelector
public io.jenetics.Selector<DiscreteGene,Double> getSelector()
Selection method for offspring.
-
getOffspring
public int getOffspring()
Amount of offspring individuals. Has to be less or equal thanpopulation
.
-
getPopulation
public int getPopulation()
Population size.
-
isChooseWithoutPermutation
public boolean isChooseWithoutPermutation()
State of whether to choose the distances in a permutation during the shuffle of new individuals.- See Also:
DiscreteGene.newInstance()
-
getDistanceMutationDelta
public double getDistanceMutationDelta()
Value of maximum distance change during the mutation.- See Also:
DistanceMutator
-
setVersion
public void setVersion(String version)
Version for configuration compatibility checks.
-
setName
public void setName(String name)
The configurations name.
-
setLimit
public void setLimit(int limit)
Last execution limit for the evolution method.
-
setPositions
public void setPositions(int positions)
The amount of positions available for theDiscreteGene
s.
-
setDistances
public void setDistances(List<Double> distances)
Input distances to choose a permutation from. Forms singleDiscreteGene
chromosomes.
-
setTreasures
public void setTreasures(List<DiscreteGene> treasures)
List of treasureDiscreteGene
s to search for.
-
setFitness
public void setFitness(Evolution.Fitness fitness)
Fitness method used to evaluate the individuals.- See Also:
Evolution.Fitness
-
setAlterers
public void setAlterers(List<? extends DiscreteAlterer> alterers)
List of alterers used during theEvolution
's mutation phase.
-
setSelector
public void setSelector(io.jenetics.Selector<DiscreteGene,Double> selector)
Selection method for offspring.
-
setOffspring
public void setOffspring(int offspring)
Amount of offspring individuals. Has to be less or equal thanpopulation
.
-
setPopulation
public void setPopulation(int population)
Population size.
-
setChooseWithoutPermutation
public void setChooseWithoutPermutation(boolean chooseWithoutPermutation)
State of whether to choose the distances in a permutation during the shuffle of new individuals.- See Also:
DiscreteGene.newInstance()
-
setDistanceMutationDelta
public void setDistanceMutationDelta(double distanceMutationDelta)
Value of maximum distance change during the mutation.- See Also:
DistanceMutator
-
canEqual
protected boolean canEqual(Object other)
-
-