Stopping Criteria
The pycnp.stop module provides stopping criteria for controlling when the memetic algorithm terminates.
- class StoppingCriterion
Protocol for algorithm stopping criteria.
- class MaxIterations(max_iterations: int)[source]
A stopping criterion based on the maximum number of iterations.
The algorithm stops when the number of iterations reaches a predefined limit.
- class MaxRuntime(max_runtime_in_sec: float)[source]
A stopping criterion based on the maximum allowed runtime.
The algorithm stops when the elapsed time since initialization exceeds a predefined limit.
- class NoImprovement(max_idle_iterations: int)[source]
A stopping criterion based on the number of iterations without improvement.
The algorithm stops if the best objective value has not improved for a specified number of consecutive iterations.