Package io.jenetics.engine
Class EvolutionDurations
- java.lang.Object
-
- io.jenetics.engine.EvolutionDurations
-
- All Implemented Interfaces:
Serializable
,Comparable<EvolutionDurations>
public final class EvolutionDurations extends Object implements Comparable<EvolutionDurations>, Serializable
This class contains timing information about one evolution step.- Since:
- 3.0
- Version:
- 6.0
- Author:
- Franz Wilhelmstötter
- See Also:
- Serialized Form
- Implementation Note:
- This class is immutable and thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description static EvolutionDurations
ZERO
Constant for zero evolution durations.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(EvolutionDurations other)
Compares two durations objects.boolean
equals(Object obj)
Duration
evaluationDuration()
Return the duration needed for evaluating the fitness function of the new individuals.Duration
evolveDuration()
Return the duration needed for the whole evolve step.int
hashCode()
static EvolutionDurations
of(Duration offspringSelectionDuration, Duration survivorsSelectionDuration, Duration offspringAlterDuration, Duration offspringFilterDuration, Duration survivorFilterDuration, Duration evaluationDuration, Duration evolveDuration)
Return an newEvolutionDurations
object with the given values.Duration
offspringAlterDuration()
Return the duration needed for altering the offspring population.Duration
offspringFilterDuration()
Return the duration needed for removing and replacing invalid offspring individuals.Duration
offspringSelectionDuration()
Return the duration needed for selecting the offspring population.EvolutionDurations
plus(EvolutionDurations other)
Returns a copy of this duration with the specified duration added.Duration
survivorFilterDuration()
Return the duration needed for removing and replacing old and invalid survivor individuals.Duration
survivorsSelectionDuration()
Return the duration needed for selecting the survivors population.
-
-
-
Field Detail
-
ZERO
public static final EvolutionDurations ZERO
Constant for zero evolution durations.
-
-
Method Detail
-
offspringSelectionDuration
public Duration offspringSelectionDuration()
Return the duration needed for selecting the offspring population.- Returns:
- the duration needed for selecting the offspring population
-
survivorsSelectionDuration
public Duration survivorsSelectionDuration()
Return the duration needed for selecting the survivors population.- Returns:
- the duration needed for selecting the survivors population
-
offspringAlterDuration
public Duration offspringAlterDuration()
Return the duration needed for altering the offspring population.- Returns:
- the duration needed for altering the offspring population
-
offspringFilterDuration
public Duration offspringFilterDuration()
Return the duration needed for removing and replacing invalid offspring individuals.- Returns:
- the duration needed for removing and replacing invalid offspring individuals
-
survivorFilterDuration
public Duration survivorFilterDuration()
Return the duration needed for removing and replacing old and invalid survivor individuals.- Returns:
- the duration needed for removing and replacing old and invalid survivor individuals
-
evaluationDuration
public Duration evaluationDuration()
Return the duration needed for evaluating the fitness function of the new individuals.- Returns:
- the duration needed for evaluating the fitness function of the new individuals
-
evolveDuration
public Duration evolveDuration()
Return the duration needed for the whole evolve step.- Returns:
- the duration needed for the whole evolve step
-
plus
public EvolutionDurations plus(EvolutionDurations other)
Returns a copy of this duration with the specified duration added.This instance is immutable and unaffected by this method call.
- Parameters:
other
- the duration to add- Returns:
- a
EvolutionDurations
based on this duration with the specified duration added - Throws:
NullPointerException
- if theother
duration isnull
ArithmeticException
- if numeric overflow occurs
-
compareTo
public int compareTo(EvolutionDurations other)
Compares two durations objects. Only theevolveDuration()
property is taken into account for the comparison.- Specified by:
compareTo
in interfaceComparable<EvolutionDurations>
- Parameters:
other
- the other durations object this object is compared with- Returns:
- a integer smaller/equal/greater than 0 if the
evolveDuration()
property ofthis
object is smaller/equal/greater than the corresponding property of theother
project.
-
of
public static EvolutionDurations of(Duration offspringSelectionDuration, Duration survivorsSelectionDuration, Duration offspringAlterDuration, Duration offspringFilterDuration, Duration survivorFilterDuration, Duration evaluationDuration, Duration evolveDuration)
Return an newEvolutionDurations
object with the given values.- Parameters:
offspringSelectionDuration
- the duration needed for selecting the offspring populationsurvivorsSelectionDuration
- the duration needed for selecting the survivors populationoffspringAlterDuration
- the duration needed for altering the offspring populationoffspringFilterDuration
- the duration needed for removing and replacing invalid offspring individualssurvivorFilterDuration
- the duration needed for removing and replacing old and invalid survivor individualsevaluationDuration
- the duration needed for evaluating the fitness function of the new individualsevolveDuration
- the duration needed for the whole evolve step- Returns:
- an new durations object
- Throws:
NullPointerException
- if one of the arguments isnull
-
-