problems.dyn¶
Includes modified code from pymoo.
Sources:
Licensed under the Apache License, Version 2.0. Original copyright and license terms are preserved.
Classes¶
DynamicApplProblem ¶
DynamicApplProblem(
nt: int,
taut: int,
t0: int = 50,
tau: int = 1,
time: float | None = None,
**kwargs,
)
Bases: DynamicProblem
Dynamic optimization problem for real-world applications.
This class defines dynamic optimization problems that model practical, real-world scenarios where the problem characteristics change systematically over time.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nt | int | Severity of change. Controls how significantly the problem changes at each change point. Higher values indicate more substantial changes in problem characteristics. | required |
taut | int | Frequency of change. Specifies how often (in generations) the problem undergoes changes. Lower values mean more frequent changes. | required |
t0 | int | The first change occurs after t0 generations, by default 50. That is, the generation at which a change occurs is (t0+1), (t0+taut+1), etc. This allows for an initial stabilization period before the first change. | 50 |
tau | int | Current simulation time counter (in generations), by default 1. | 1 |
time | float | Explicit simulation time value (overrides calculated time), by default None. Used for manual time control in specific scenarios. | None |
**kwargs | dict | Additional keyword arguments passed to the parent Problem class. | {} |
Attributes:
| Name | Type | Description |
|---|---|---|
tau | int | Current simulation time counter in generations. |
nt | int | Severity of change at each change point. |
taut | int | Frequency of change between consecutive changes. |
t0 | int | Initial stabilization period before first change occurs. |
Notes
This class models real-world dynamic scenarios where:
- Changes occur at predictable intervals (every
tautgenerations) - Change severity is controlled by
ntparameter - Initial period
t0allows for system stabilization
Source code in pydmoo/problems/dyn.py
Functions¶
update_to_next_time ¶
Advance problem to the next significant time step.
Returns:
| Type | Description |
|---|---|
elapsed: The actual time units advanced | |
Source code in pydmoo/problems/dyn.py
DynamicProblem ¶
Bases: Problem, ABC
Abstract base class for dynamic optimization problems.
DynamicTestProblem ¶
Bases: DynamicProblem
Dynamic optimization problem for testing and benchmarking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
nt | int | Severity of change. Controls how significantly the problem changes at each change point. Higher values indicate more substantial changes in problem characteristics. | required |
taut | int | Frequency of change. Specifies how often (in generations) the problem undergoes changes. Lower values mean more frequent changes. | required |
t0 | int | The first change occurs after t0 generations, by default 50. That is, the generation at which a change occurs is (t0+1), (t0+taut+1), etc. This allows for an initial stabilization period before the first change. | 50 |
tau | int | Current simulation time counter (in generations), by default 1. | 1 |
time | float | Explicit simulation time value (overrides calculated time), by default None. Used for manual time control in specific scenarios. | None |
add_time_perturbation | bool | If True, adds perturbations to the time calculation, by default False. | False |
**kwargs | dict | Additional keyword arguments passed to the parent Problem class. | {} |
Attributes:
| Name | Type | Description |
|---|---|---|
tau | int | Current simulation time counter in generations. |
nt | int | Severity of change at each change point. |
taut | int | Frequency of change between consecutive changes. |
t0 | int | Initial stabilization period before first change occurs. |
add_time_perturbation | bool | Flag indicating whether to add stochastic perturbations. |
Notes
This class is designed for testing scenarios where:
- Changes occur at predictable intervals (every
tautgenerations) - Change severity is controlled by
ntparameter - Initial period
t0allows for system stabilization - Stochastic perturbations can be added for more complex testing
- Reproducibility is important for benchmarking
Source code in pydmoo/problems/dyn.py
Attributes¶
time property writable ¶
Time.
Notes
The discrete time \(t\) is defined as follows:
Here, \(\pi_{\tau}\) is given by:
This formulation introduces a dynamic environment with an irregular change pattern. When \(\pi_{\tau} = 0\), the time variation reduces to the commonly used form with a regular change pattern:
In the above expressions, \(\tau\) denotes the generation counter, \(n_t\) controls the severity of change, and \(\tau_t\) represents the number of generations per time step.
Functions¶
update_to_next_time ¶
Advance problem to the next significant time step.
Returns:
| Type | Description |
|---|---|
elapsed: The actual time units advanced | |
Source code in pydmoo/problems/dyn.py
TimeSimulation ¶
Bases: Callback
Callback for simulating time evolution in dynamic optimization problems.
Handles time-linkage properties and time step updates.
Functions¶
update ¶
Update method called at each algorithm iteration.