Table of Contents

Class NSGAIIAfterTrialStrategy

Namespace
OptunaSharp.Samplers.Nsgaii
Assembly
OptunaSharp.dll

The default after-trial strategy of NSGAIISampler. Port of optuna/samplers/nsgaii/_after_trial_strategy.py: NSGAIIAfterTrialStrategy.

Examines whether the trial result is valid in terms of constraints and stores the results in the study's system attributes (only when a constraints_func is configured).

public class NSGAIIAfterTrialStrategy
Inheritance
NSGAIIAfterTrialStrategy
Inherited Members

Constructors

NSGAIIAfterTrialStrategy(Func<FrozenTrial, IEnumerable<double>>?)

Configures optional legacy constraint evaluation after an individual finishes.

public NSGAIIAfterTrialStrategy(Func<FrozenTrial, IEnumerable<double>>? constraintsFunc = null)

Parameters

constraintsFunc Func<FrozenTrial, IEnumerable<double>>

Optional legacy callback returning constraint values; positive values violate a constraint.

Methods

Call(Study, FrozenTrial, TrialState, IReadOnlyList<double>?)

Carry out the after-trial process of default NSGA-II (Python call).

public void Call(Study study, FrozenTrial trial, TrialState state, IReadOnlyList<double>? values = null)

Parameters

study Study

Study supplying trial history, objective directions, and storage.

trial FrozenTrial

Trial snapshot being examined; copy its contents before modifying them.

state TrialState

Terminal trial state being recorded.

values IReadOnlyList<double>

Objective values in study order, or null when no final values are available.

Exceptions

ValueError

The configured constraint callback returns NaN.

Exception

The configured constraint callback or storage provider fails; its exception propagates.