Population<TSolution, TCandidate> Class

Represents a population of candidates for optimization.

Definition

Namespace: Numerics.NET.Optimization
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.0
C#
public abstract class Population<TSolution, TCandidate> : IList<TCandidate>, 
	ICollection<TCandidate>, IEnumerable<TCandidate>, IEnumerable
where TCandidate : Object, ICandidate<TSolution>
Inheritance
Object  →  Population<TSolution, TCandidate>
Derived
Implements
ICollection<TCandidate>, IEnumerable<TCandidate>, IList<TCandidate>, IEnumerable

Type Parameters

TSolution
The type representing the solution (e.g., double[], string, etc.).
TCandidate
The type representing a candidate.

Constructors

Population<TSolution, TCandidate>Initializes a new instance of the Population<TSolution, TCandidate> class

Properties

Candidates Provides an enumerable of candidate proxies representing the population. Each candidate proxy provides read-only access to the underlying SoA data.
CountGets the number of elements contained in the ICollection<T>.
IsReadOnlyGets a value indicating whether the ICollection<T> is read-only.
ItemGets or sets the element at the specified index.
Solutions Gets the solutions of the population.
Values Gets the values of the population.

Methods

AddAdds an item to the ICollection<T>.
ClearRemoves all items from the ICollection<T>.
ComputeCoefficientOfVariation Computes a population-wide statistic, for example the coefficient of variation of the candidate values.
ContainsDetermines whether the ICollection<T> contains a specific value.
CopyToCopies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Diversity Computes the diversity of the population.
EqualsDetermines whether the specified object is equal to the current object.
(Inherited from Object)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
GetCandidate Gets a candidate at the specified index.
GetEnumeratorReturns an enumerator that iterates through the collection.
GetHashCodeServes as the default hash function.
(Inherited from Object)
GetTypeGets the Type of the current instance.
(Inherited from Object)
IndexOfDetermines the index of a specific item in the IList<T>.
InsertInserts an item to the IList<T> at the specified index.
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Migrate Performs a migration operation, moving candidates between subpopulations. This is intended for large-scale adjustments (e.g., in multi-swarm or island models).
RefreshNeighborhood Refreshes the local structure of the population (for example, updating neighborhood relationships). The exact behavior is algorithm-specific.
RemoveRemoves the first occurrence of a specific object from the ICollection<T>.
RemoveAtRemoves the IList<T> item at the specified index.
SetCandidate Sets a candidate at the specified index.
ToStringReturns a string that represents the current object.
(Inherited from Object)

Extension Methods

Group<TCandidate> Returns a grouping by the unique elements in a list.
(Defined by Grouping)
Group<TCandidate> Returns a grouping by the unique elements in a sequence.
(Defined by Grouping)
Group<TCandidate> Returns a grouping by the unique elements in a list using the specified comparer to determine equality.
(Defined by Grouping)
Group<TCandidate> Returns a grouping by the unique elements in a sequence using the specified comparer to determine equality.
(Defined by Grouping)
StandardDeviation<TCandidate> Returns the standard deviation of the elements of a sequence.
(Defined by Stats)
Sum<TCandidate> Computes the sum of the sequence of values.
(Defined by ArrayMath)
Sum<TCandidate, U> Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence.
(Defined by ArrayMath)
Sum<TCandidate, T2, U> Computes the sum of the sequence of values that are obtained by invoking a transform function on each pair of elements of the input sequences.
(Defined by ArrayMath)

See Also