QDpy
Loading...
Searching...
No Matches
qdpy.algorithms.sampling.SampledFitness Class Reference
Inheritance diagram for qdpy.algorithms.sampling.SampledFitness:
qdpy.phenotype.Fitness qdpy.phenotype.Score qdpy.phenotype.FitnessLike qdpy.phenotype.ScoreLike qdpy.phenotype.ScoreLike

Public Member Functions

None reset (self)
Sequence[FitnessValuesLike] samples (self)
int nb_samples (self)
None add_sample (self, sample)
None merge (self, other)
Public Member Functions inherited from qdpy.phenotype.Fitness
 __setstate__ (self, state)
 Verify that a snapshot stores unweighted objective values.
ScoreValuesLike weighted_values (self, ScoreValuesLike weights)
bool valid (self)
Public Member Functions inherited from qdpy.phenotype.Score
bool dominates (self, Any other, Any obj=slice(None), Optional[ScoreValuesLike] weights=None)

Static Protected Attributes

List _samples [FitnessValuesLike]
 nb_samples: int

Detailed Description

Keep individual fitness observations and expose their mean as Fitness.

Setting values appends a raw observation. Dominance applies comparison
weights to the aggregate. Changing weights leaves the observations
unchanged. Reset before gathering an independent estimate.

Definition at line 57 of file sampling.py.

Member Function Documentation

◆ add_sample()

None qdpy.algorithms.sampling.SampledFitness.add_sample ( self,
sample )
Add a nonempty raw objective vector and refresh the aggregate.

Definition at line 104 of file sampling.py.

◆ merge()

None qdpy.algorithms.sampling.SampledFitness.merge ( self,
other )
Append the observations from another sampled fitness and recompute the aggregate.

Definition at line 114 of file sampling.py.

◆ nb_samples()

int qdpy.algorithms.sampling.SampledFitness.nb_samples ( self)
Number of contributing fitness observations.

Definition at line 100 of file sampling.py.

◆ reset()

None qdpy.algorithms.sampling.SampledFitness.reset ( self)
Clear the recorded samples and invalidate the aggregate fitness.

Reimplemented from qdpy.phenotype.Score.

Definition at line 78 of file sampling.py.

◆ samples()

Sequence[FitnessValuesLike] qdpy.algorithms.sampling.SampledFitness.samples ( self)
Return a new list containing the raw objective observations.

Definition at line 95 of file sampling.py.


The documentation for this class was generated from the following file: