src/GenFx.Wpf/ViewModels/ExecutionPanelViewModel.cs
/// <summary>
/// Handles the event when the associated <see cref="GeneticAlgorithm"/> has evaluted the fitness of a generation.
/// </summary>
/// <param name="sender">Sender of the event.</param>
/// <param name="e">The <see cref="EnvironmentFitnessEvaluatedEventArgs"/> associated with the event.</param>
Handles the event when the associated  has evaluted the fitness of a generation.
Handles the event when the associated has evaluted the fitness of a generation .
private void GeneticAlgorithm_FitnessEvaluated(object? sender, EnvironmentFitnessEvaluatedEventArgs e)
        {
            if (this.context.ExecutionState == ExecutionState.PausePending ||
                this.context.ExecutionState == ExecutionState.IdlePending)
            {
                e.Cancel = true;
                if (this.context.ExecutionState == ExecutionState.PausePending)
                {
                    this.context.ExecutionState = ExecutionState.Paused;
                }
                else
                {
                    this.context.ExecutionState = ExecutionState.Idle;
                    this.UnsubscribeFromAlgorithmEvents();
                }
            }
        }
private void GeneticAlgorithm_FitnessEvaluated ( object ? sender , EnvironmentFitnessEvaluatedEventArgs e ) { if ( this . context . ExecutionState == ExecutionState . PausePending || this . context . ExecutionState == ExecutionState . IdlePending ) { e . Cancel = true ; if ( this . context . ExecutionState == ExecutionState . PausePending ) { this . context . ExecutionState = ExecutionState . Paused ; } else { this . context . ExecutionState = ExecutionState . Idle ; this . UnsubscribeFromAlgorithmEvents ( ) ; } } }
Handles the event when the associated  has evaluted the fitness of a generation.
Handles the event when the associated has evaluted the fitness of a generation .
sender
object?
Sender of the event.
Sender of the event .
e
EnvironmentFitnessEvaluatedEventArgs
The  associated with the event.
The associated with the event .