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
FieldsModifier and TypeFieldDescriptionstatic final EvolutionDurationsConstant for zero evolution durations. -
Constructor Summary
ConstructorsConstructorDescriptionEvolutionDurations(Duration offspringSelectionDuration, Duration survivorsSelectionDuration, Duration offspringAlterDuration, Duration offspringFilterDuration, Duration survivorFilterDuration, Duration evaluationDuration, Duration evolveDuration) Creates an instance of aEvolutionDurationsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(EvolutionDurations other) Compares two durations objects.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theevaluationDurationrecord component.Returns the value of theevolveDurationrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theoffspringAlterDurationrecord component.Returns the value of theoffspringFilterDurationrecord component.Returns the value of theoffspringSelectionDurationrecord component.plus(EvolutionDurations other) Returns a copy of this duration with the specified duration added.Returns the value of thesurvivorFilterDurationrecord component.Returns the value of thesurvivorsSelectionDurationrecord component.final StringtoString()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 aEvolutionDurationsrecord class.- Parameters:
offspringSelectionDuration- the value for theoffspringSelectionDurationrecord componentsurvivorsSelectionDuration- the value for thesurvivorsSelectionDurationrecord componentoffspringAlterDuration- the value for theoffspringAlterDurationrecord componentoffspringFilterDuration- the value for theoffspringFilterDurationrecord componentsurvivorFilterDuration- the value for thesurvivorFilterDurationrecord componentevaluationDuration- the value for theevaluationDurationrecord componentevolveDuration- the value for theevolveDurationrecord 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
EvolutionDurationsbased on this duration with the specified duration added - Throws:
NullPointerException- if theotherduration isnullArithmeticException- if numeric overflow occurs
-
compareTo
Compares two durations objects. Only theevolveDuration()property is taken into account for the comparison.- Specified by:
compareToin 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 ofthisobject is smaller/equal/greater than the corresponding property of theotherproject.
-
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 theoffspringSelectionDurationrecord component.- Returns:
- the value of the
offspringSelectionDurationrecord component
-
survivorsSelectionDuration
Returns the value of thesurvivorsSelectionDurationrecord component.- Returns:
- the value of the
survivorsSelectionDurationrecord component
-
offspringAlterDuration
Returns the value of theoffspringAlterDurationrecord component.- Returns:
- the value of the
offspringAlterDurationrecord component
-
offspringFilterDuration
Returns the value of theoffspringFilterDurationrecord component.- Returns:
- the value of the
offspringFilterDurationrecord component
-
survivorFilterDuration
Returns the value of thesurvivorFilterDurationrecord component.- Returns:
- the value of the
survivorFilterDurationrecord component
-
evaluationDuration
Returns the value of theevaluationDurationrecord component.- Returns:
- the value of the
evaluationDurationrecord component
-
evolveDuration
Returns the value of theevolveDurationrecord component.- Returns:
- the value of the
evolveDurationrecord component
-