src/GenFx.Components/Lists/VariableSinglePointCrossoverOperator.cs
/// <summary>
/// Replaces the elements in <paramref name="entity"/>, starting at <paramref name="targetCrossoverLocus"/>,
/// with the elements located in <paramref name="sourceElements"/> starting at <paramref name="sourceCrossoverLocus"/>.
/// </summary>
/// <param name="entity"><see cref="ListEntityBase"/> whose bits are to be replaced.</param>
/// <param name="sourceElements">List of elements to replace with.</param>
/// <param name="targetCrossoverLocus">Element position at which to begin replacement.</param>
/// <param name="sourceCrossoverLocus">Element position of the source elements to begin copying from.</param>
Replaces the elements in , starting at ,
with the elements located in  starting at .
Replaces the elements in starting at with the elements located in starting at .
private static void ReplaceBits(ListEntityBase entity, List<object?> sourceElements, int targetCrossoverLocus, int sourceCrossoverLocus)
        {
            entity.Length = targetCrossoverLocus + sourceElements.Count - sourceCrossoverLocus;
            for (int sourceBitIndex = sourceCrossoverLocus, targetBitIndex = targetCrossoverLocus; sourceBitIndex < sourceElements.Count; sourceBitIndex++, targetBitIndex++)
            {
                entity.SetValue(targetBitIndex, sourceElements[sourceBitIndex]);
            }
        }
private static void ReplaceBits ( ListEntityBase entity , List < object ? > sourceElements , int targetCrossoverLocus , int sourceCrossoverLocus ) { entity . Length = targetCrossoverLocus + sourceElements . Count - sourceCrossoverLocus ; for ( int sourceBitIndex = sourceCrossoverLocus , targetBitIndex = targetCrossoverLocus ; sourceBitIndex < sourceElements . Count ; sourceBitIndex ++ , targetBitIndex ++ ) { entity . SetValue ( targetBitIndex , sourceElements [ sourceBitIndex ] ) ; } }
Replaces the elements in , starting at ,
with the elements located in  starting at .
Replaces the elements in starting at with the elements located in starting at .
entity
ListEntityBase
whose bits are to be replaced.
whose bits are to be replaced .
sourceElements
List<object?>
List of elements to replace with.
List of elements to replace with .
targetCrossoverLocus
int
Element position at which to begin replacement.
Element position at which to begin replacement .
sourceCrossoverLocus
int
Element position of the source elements to begin copying from.
Element position of the source elements to begin copying from .