java.lang.Object
java.lang.Record
io.jenetics.engine.EvolutionDurations
- Record Components:
offspringSelectionDuration
- the duration needed for selecting the offspring populationsurvivorsSelectionDuration
- the duration needed for selecting the survivor 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
- All Implemented Interfaces:
Serializable
,Comparable<EvolutionDurations>
public record EvolutionDurations(Duration offspringSelectionDuration, Duration survivorsSelectionDuration, Duration offspringAlterDuration, Duration offspringFilterDuration, Duration survivorFilterDuration, Duration evaluationDuration, Duration evolveDuration)
extends Record
implements Comparable<EvolutionDurations>, Serializable
This class contains timing information about one evolution step.
- Since:
- 3.0
- Version:
- 7.0
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final EvolutionDurations
Constant for zero evolution durations. -
Constructor Summary
ConstructorDescriptionEvolutionDurations
(Duration offspringSelectionDuration, Duration survivorsSelectionDuration, Duration offspringAlterDuration, Duration offspringFilterDuration, Duration survivorFilterDuration, Duration evaluationDuration, Duration evolveDuration) Creates an instance of aEvolutionDurations
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(EvolutionDurations other) Compares two durations objects.final boolean
Indicates whether some other object is "equal to" this one.Returns the value of theevaluationDuration
record component.Returns the value of theevolveDuration
record component.final int
hashCode()
Returns a hash code value for this object.Returns the value of theoffspringAlterDuration
record component.Returns the value of theoffspringFilterDuration
record component.Returns the value of theoffspringSelectionDuration
record component.plus
(EvolutionDurations other) Returns a copy of this duration with the specified duration added.Returns the value of thesurvivorFilterDuration
record component.Returns the value of thesurvivorsSelectionDuration
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
ZERO
Constant for zero evolution durations.
-
-
Constructor Details
-
EvolutionDurations
public EvolutionDurations(Duration offspringSelectionDuration, Duration survivorsSelectionDuration, Duration offspringAlterDuration, Duration offspringFilterDuration, Duration survivorFilterDuration, Duration evaluationDuration, Duration evolveDuration) Creates an instance of aEvolutionDurations
record class.- Parameters:
offspringSelectionDuration
- the value for theoffspringSelectionDuration
record componentsurvivorsSelectionDuration
- the value for thesurvivorsSelectionDuration
record componentoffspringAlterDuration
- the value for theoffspringAlterDuration
record componentoffspringFilterDuration
- the value for theoffspringFilterDuration
record componentsurvivorFilterDuration
- the value for thesurvivorFilterDuration
record componentevaluationDuration
- the value for theevaluationDuration
record componentevolveDuration
- the value for theevolveDuration
record component
-
-
Method Details
-
plus
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
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:
- an integer smaller/equal/greater than zero if the
evolveDuration()
property ofthis
object is smaller/equal/greater than the corresponding property of theother
project.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
offspringSelectionDuration
Returns the value of theoffspringSelectionDuration
record component.- Returns:
- the value of the
offspringSelectionDuration
record component
-
survivorsSelectionDuration
Returns the value of thesurvivorsSelectionDuration
record component.- Returns:
- the value of the
survivorsSelectionDuration
record component
-
offspringAlterDuration
Returns the value of theoffspringAlterDuration
record component.- Returns:
- the value of the
offspringAlterDuration
record component
-
offspringFilterDuration
Returns the value of theoffspringFilterDuration
record component.- Returns:
- the value of the
offspringFilterDuration
record component
-
survivorFilterDuration
Returns the value of thesurvivorFilterDuration
record component.- Returns:
- the value of the
survivorFilterDuration
record component
-
evaluationDuration
Returns the value of theevaluationDuration
record component.- Returns:
- the value of the
evaluationDuration
record component
-
evolveDuration
Returns the value of theevolveDuration
record component.- Returns:
- the value of the
evolveDuration
record component
-