src/GenFx.Components/Lists/ListEntity.cs
/// <summary>
/// Initializes the component to ensure its readiness for algorithm execution.
/// </summary>
/// <param name="algorithm">The algorithm that is to use this component.</param>
Initializes the component to ensure its readiness for algorithm execution.
Initializes the component to ensure its readiness for algorithm execution .
public override void Initialize(GeneticAlgorithm algorithm)
        {
            base.Initialize(algorithm);
            int initialCount = this.GetInitialLength();
            this.genes = new List<TItem?>(initialCount);
            for (int i = 0; i < initialCount; i++)
            {
#pragma warning disable CS8653 
                this.genes.Add(default);
#pragma warning restore CS8653 
            }
        }
public override void Initialize ( GeneticAlgorithm algorithm ) { base . Initialize ( algorithm ) ; int initialCount = this . GetInitialLength ( ) ; this . genes = new List < TItem ? > ( initialCount ) ; for ( int i = 0 ; i < initialCount ; i ++ ) { pragma warning disable CS8653 this . genes . Add ( default ) ; pragma warning restore CS8653 } }
Initializes the component to ensure its readiness for algorithm execution.
Initializes the component to ensure its readiness for algorithm execution .
// A default expression introduces a null value for a type parameter. // A default expression introduces a null value for a type parameter.
algorithm
GeneticAlgorithm
The algorithm that is to use this component.
The algorithm that is to use this component .