rtc-tools 2.9.0a1__tar.gz → 2.9.0a2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.github/workflows/ci.yml +29 -2
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/PKG-INFO +1 -1
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/debugging.rst +35 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/casadi_to_lp.py +54 -19
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/collocated_integrated_optimization_problem.py +91 -7
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/goal_programming_mixin.py +11 -8
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/goal_programming_mixin_base.py +19 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/min_abs_goal_programming_mixin.py +10 -8
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/optimization_problem.py +44 -12
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/single_pass_goal_programming_mixin.py +16 -6
- rtc_tools-2.9.0a2/tests/modelica/install_msl.mos +4 -0
- rtc_tools-2.9.0a2/tests/modelica/test_omc_conformance.py +270 -0
- rtc_tools-2.9.0a2/tests/optimization/test_constraint_names.py +179 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_export_lp.py +125 -0
- rtc_tools-2.9.0a2/tests/simulation/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tox.ini +5 -1
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.codecov.yml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.coveragerc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.git-blame-ignore-revs +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.github/actions/setup-python/action.yml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.pre-commit-config.yaml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/.readthedocs.yaml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/AUTHORS +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/CHARTER.md +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/CODE_OF_CONDUCT.md +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/CONTRIBUTING.md +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/COPYING +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/COPYING.LESSER +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/GOVERNANCE.md +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/README.md +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/Makefile +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/_static/external_links.js +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/_static/theme_overrides.css +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/conf.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/basic.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/cascading_channels.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/channel_pulse.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/channel_wave_damping.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/ensemble.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/fallback_options.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/goal_programming.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/integrator_delay.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/lookup_table.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/mixed_integer.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/pumped_hydropower_system.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization/step_response.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/optimization.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/basic_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/cascading_channels_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/channel_pulse_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/channel_wave_damping.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/ensemble_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/goal_programming_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/integrator_delay.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/lookup_table_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/mixed_integer_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/pumped_hydropower_system_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/pyplots/simulation_results.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/simulation/custom_equation.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/simulation/setpoint.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples/simulation.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/examples.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/getting-started.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/Aggregation_01.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/Lake-Hartwell-24012016.jpg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/PumpedStoragePlant_openmodelica.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/Woudagemaal.jpg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/basic_example_console.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/cascading_channels_omedit.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/channel_impulse_xs.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/channel_wave_damping_omedit.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/graig-coch-2117306_640.jpg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/integrator_delay_modelica.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/lavant-2976738_1280.jpg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/orifice_vs_pump_openmodelica.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/pont-du-gard-1742029_1280.jpg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/rtc-tools-horizontal-color.svg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/rtc-tools-horizontal-white.svg +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/simple_storage_openmodelica.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/single_channel.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/single_channel_hec-ras.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/validation/Downstream_150.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/images/validation/Upstream_150.png +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/index.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/literature.bib +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/make.bat +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/basics.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/csv_io.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/fews_io.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/forecast_uncertainty.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/goal_programming/converting_goals_to_constraints.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/goal_programming/goals.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/goal_programming/linearized_order.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/goal_programming/main_idea.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/goal_programming/minimize_absolute_value.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/homotopy.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/initial_state_estimation.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/linearization.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/lookup_tables.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/modelica_models.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/multi_objective.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/solver_configuration.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization/time_discretization.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/optimization.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/related-projects.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/simulation/basics.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/simulation/csv_io.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/simulation/fews_io.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/simulation.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/doc/time-series.rst +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/basic/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/basic/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/basic/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/basic/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/basic/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/basic/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/model/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/cascading_channels/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/HEC-RAS.zip +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/reference_output/HEC-RAS_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/reference_output/timeseries_export_inertial_wave.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/reference_output/timeseries_export_inertial_wave_semi_implicit.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/reference_output/timeseries_export_saint_venant.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/reference_output/timeseries_export_saint_venant_upwind.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_pulse/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/model/ExampleLocalControl.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/model/ExampleOptimization.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/model/PIDController.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/reference_output/timeseries_export_local_control.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/src/example_local_control.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/src/example_optimization.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/src/steady_state_initialization_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/channel_wave_damping/src/step_size_parameter_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/forecast1/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/forecast1/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/forecast1/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/forecast2/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/forecast2/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/forecast2/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/lookup_tables/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/lookup_tables/curvefit_options.ini +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/input/lookup_tables/storage_V.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/output/forecast1/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/output/forecast2/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/reference_output/forecast1/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/reference_output/forecast2/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/ensemble/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/fallback_option/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/fallback_option/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/fallback_option/src/example_with_gp.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/goal_programming/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/goal_programming/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/goal_programming/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/goal_programming/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/goal_programming/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/goal_programming/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/integrator_delay/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/integrator_delay/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/integrator_delay/input/timeseries_import_simulation.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/integrator_delay/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/integrator_delay/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/input/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/input/lookup_tables/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/input/lookup_tables/curvefit_options.ini +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/input/lookup_tables/storage_V.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/lookup_table/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/mixed_integer/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/mixed_integer/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/mixed_integer/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/mixed_integer/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/mixed_integer/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/mixed_integer/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/pumped_hydropower_system/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/pumped_hydropower_system/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/pumped_hydropower_system/model/PumpedStoragePlant.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/pumped_hydropower_system/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/pumped_hydropower_system/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/pumped_hydropower_system/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation/input/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation_with_custom_equations/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation_with_custom_equations/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation_with_custom_equations/model/SimpleModel.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation_with_custom_equations/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation_with_custom_equations/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/simulation_with_custom_equations/src/simple_model.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/single_reservoir/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/single_reservoir/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/single_reservoir/model/single_reservoir.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/single_reservoir/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/single_reservoir/reference_output/timeseries_export.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/single_reservoir/src/single_reservoir.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/step_response/input/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/step_response/input/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/step_response/model/Example.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/step_response/output/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/step_response/reference_output/timeseries_export_saint_venant.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/examples/step_response/src/example.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/pyproject.toml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/sonar-project.properties +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/alias_tools.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/caching.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/casadi_helpers.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/debug_check_helpers.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/_internal/ensemble_bounds_decorator.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/csv.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/interpolation/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/interpolation/bspline.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/interpolation/bspline1d.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/interpolation/bspline2d.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/netcdf.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/pi.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/rtc.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/data/storage.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/control_tree_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/csv_lookup_table_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/csv_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/homotopy_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/initial_state_estimation_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/io_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/linearization_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/linearized_order_goal_programming_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/modelica_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/netcdf_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/pi_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/planning_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/timeseries.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/rtctoolsapp.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/simulation/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/simulation/csv_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/simulation/io_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/simulation/pi_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/simulation/simulation_problem.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/util.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/version.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/curve.dat +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/diag.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/initial_state_0.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/initial_state_1.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/look_up_table_0.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/look_up_table_1.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/look_up_table_2.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/pi_run.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/surface.dat +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_export.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import.bin +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_0.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_1.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_2.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_ensemble.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_ensemble.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_ensemblesize1_noRealization.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_ensemblesize1_withRealization.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data/timeseries_import_neq.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/data_path.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/test_csv.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/test_data.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/test_diag.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/test_interpolate.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/test_netcdf.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data/test_storage.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/data_path.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/examples/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/examples/test_examples.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/internal/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/internal/test_alias_tools.py +0 -0
- {rtc_tools-2.9.0a1/tests/optimization → rtc_tools-2.9.0a2/tests/modelica}/__init__.py +0 -0
- {rtc_tools-2.9.0a1/tests/simulation → rtc_tools-2.9.0a2/tests/optimization}/__init__.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/EmptyModel.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/Model.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelAlgebraic.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelDebugChecks.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelDelay.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelDelayLoop.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelHomotopyInput.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelHomotopyInputAlias.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelHomotopyParameter.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelMixedInteger.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelNestedDelay.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelSIUnits.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelSymbolicParameters.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelWithInitial.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelWithInitialLinear.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ModelWithLookupTable.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/SingleShootingModel.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/lookup_tables/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/lookup_tables/curvefit_options.ini +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/lookup_tables/x_prime.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member0/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member0/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member0/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member0/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member1/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member1/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member1/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/member1/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/Model.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/member0/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/member1/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/member2/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/member3/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/timeseries_import.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_ensemble_sizes/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/member0/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/member1/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/timeseries_import.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_initial_date/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/member0/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/member1/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/timeseries_import.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_timestep/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/member0/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/member0/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/member1/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/member1/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/timeseries_import.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/multiple_io_mixins/different_values/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/non_zero_indexed_ensembles/Model.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/non_zero_indexed_ensembles/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/non_zero_indexed_ensembles/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/non_zero_indexed_ensembles/rtcParameterConfig_extra.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/non_zero_indexed_ensembles/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/one-member-ensemble/ensemble.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/one-member-ensemble/member0/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/one-member-ensemble/member0/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/one-member-ensemble/member0/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/one-member-ensemble/member0/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/reference_linear_model.lp +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/rtcParameterConfig_extra.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/single_non_zero_ensemble_index/Model.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/single_non_zero_ensemble_index/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/single_non_zero_ensemble_index/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/single_non_zero_ensemble_index/rtcParameterConfig_extra.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/single_non_zero_ensemble_index/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/timeseries_import.nc +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/data_path.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/regenerate_lp_reference.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_control_tree_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_csv_lookuptable_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_csv_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_debug_checks.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_delay_expressions.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_extra_casadipath.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_goal_programming.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_homotopy_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_integration.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_interpolation.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_io_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_linearized_order_goal_programming_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_min_abs_goal_programming.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_modelica_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_multiple_io_mixins.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_netcdf_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_optimization_problem.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_path_extra_variables.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_path_variable_assembly.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_pi_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_planning_and_control_tree_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_planning_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_problem_class_check.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_single_pass_goal_programming.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_solvers.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_timeseries.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_vector_constraints_variables.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/optimization/test_vector_goals.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/.gitignore +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/Model.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/ModelCustomEquation.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/Model_base.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/Model_delay.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/Model_nominal.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_infeasible.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_out_of_bounds.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_out_of_sym_bounds.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_with_bounds.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_with_input_series.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_with_sym_ystart.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_with_xstart.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/model_with_zero_xstart.mo +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/infeasible_initial_value/timeseries_import_with_x.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/initial_state.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/parameters.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/rtcDataConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/rtcParameterConfig.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/timeseries_import.csv +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data/timeseries_import.xml +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/data_path.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/test_csv_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/test_io_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/test_pi_mixin.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/test_problem_class_check.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/simulation/test_simulation.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/test_case.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/tests/test_rtctoolsapp.py +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/uv.lock +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/xsd/rtcDataConfig.xsd +0 -0
- {rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/xsd/rtcSharedTypes.xsd +0 -0
|
@@ -132,8 +132,35 @@ jobs:
|
|
|
132
132
|
dependency-groups: "tests"
|
|
133
133
|
- run: uv run tox -vv
|
|
134
134
|
|
|
135
|
+
# Check example models with OpenModelica, to track models that pymoca
|
|
136
|
+
# accepts but that are not valid Modelica. See tests/modelica.
|
|
137
|
+
modelica-conformance:
|
|
138
|
+
name: Modelica Conformance (OpenModelica ${{ matrix.omc_version }})
|
|
139
|
+
needs: [style]
|
|
140
|
+
runs-on: ubuntu-latest
|
|
141
|
+
strategy:
|
|
142
|
+
matrix:
|
|
143
|
+
# The test records the known failures for this version, and only runs with it.
|
|
144
|
+
omc_version: ['1.27.1']
|
|
145
|
+
container:
|
|
146
|
+
image: openmodelica/openmodelica:v${{ matrix.omc_version }}-ompython
|
|
147
|
+
timeout-minutes: 30
|
|
148
|
+
env:
|
|
149
|
+
TOXENV: omc
|
|
150
|
+
OMC_VERSION: ${{ matrix.omc_version }}
|
|
151
|
+
# The image has no git, so hatch-vcs cannot determine the version.
|
|
152
|
+
SETUPTOOLS_SCM_PRETEND_VERSION: "0+omc"
|
|
153
|
+
steps:
|
|
154
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
155
|
+
- uses: ./.github/actions/setup-python
|
|
156
|
+
with:
|
|
157
|
+
dependency-groups: "tests"
|
|
158
|
+
- name: Install the Modelica Standard Library
|
|
159
|
+
run: omc tests/modelica/install_msl.mos
|
|
160
|
+
- run: uv run tox -vv
|
|
161
|
+
|
|
135
162
|
deploy:
|
|
136
|
-
needs: [build, test-linux, coverage, examples-linux]
|
|
163
|
+
needs: [build, test-linux, coverage, examples-linux, modelica-conformance]
|
|
137
164
|
runs-on: ubuntu-latest
|
|
138
165
|
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/2.') }}
|
|
139
166
|
permissions:
|
|
@@ -150,7 +177,7 @@ jobs:
|
|
|
150
177
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
151
178
|
|
|
152
179
|
deploy-nexus:
|
|
153
|
-
needs: [build, test-linux, coverage, examples-linux]
|
|
180
|
+
needs: [build, test-linux, coverage, examples-linux, modelica-conformance]
|
|
154
181
|
runs-on: ubuntu-latest
|
|
155
182
|
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/2.') }}
|
|
156
183
|
permissions:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: rtc-tools
|
|
3
|
-
Version: 2.9.
|
|
3
|
+
Version: 2.9.0a2
|
|
4
4
|
Summary: Toolbox for control and optimization of water systems.
|
|
5
5
|
Project-URL: Homepage, https://oss.deltares.nl/web/rtc-tools/home
|
|
6
6
|
Project-URL: Download, https://github.com/rtc-tools/rtc-tools/
|
|
@@ -45,6 +45,41 @@ programming solves more than one priority, each priority gets its own file with
|
|
|
45
45
|
constant terms an LP file can hold (no NaN, no lower bound of +inf, no upper bound of -inf, no
|
|
46
46
|
infinite constant). It raises a :exc:`ValueError` otherwise.
|
|
47
47
|
|
|
48
|
+
By default the constraint rows are unnamed. Set the class attribute
|
|
49
|
+
``label_all_constraint_rows = True`` to label each row by its origin:
|
|
50
|
+
|
|
51
|
+
* ``initial_residual_{i}`` and ``initial_derivative_{i}``: model equations at the initial time
|
|
52
|
+
* ``collocation_eq{i}__t{t}``: model equation ``i`` at time index ``t``
|
|
53
|
+
* ``delay_{variable}__t{t}``: delayed feedback
|
|
54
|
+
* ``constraint_{i}`` and ``path_constraint_{i}__t{t}``: entries of
|
|
55
|
+
:meth:`~rtctools.optimization.optimization_problem.OptimizationProblem.constraints` and
|
|
56
|
+
:meth:`~rtctools.optimization.optimization_problem.OptimizationProblem.path_constraints`
|
|
57
|
+
* ``objective_priority_{p}``: objective of an earlier priority, added by
|
|
58
|
+
:class:`~rtctools.optimization.single_pass_goal_programming_mixin.SinglePassGoalProgrammingMixin`
|
|
59
|
+
|
|
60
|
+
Elements of a vector constraint get ``__{k}``, and ensemble members ``__m{i}``. A row with a
|
|
61
|
+
finite lower and upper bound becomes two lines, labelled ``__lb`` and ``__ub``. Characters
|
|
62
|
+
that LP readers reject become ``_``, and repeated labels get ``__d{n}``. The labels are also
|
|
63
|
+
available without exporting, in ``transcribed_problem["g_names"]`` after :meth:`optimize`.
|
|
64
|
+
|
|
65
|
+
To name a constraint yourself, set ``named_constraints = True`` and add the name as 4th
|
|
66
|
+
element of the tuple. With this flag on, constraint lists may mix 3- and 4-tuples, so code
|
|
67
|
+
that reads them, like a mixin calling ``super().constraints()``, must accept both::
|
|
68
|
+
|
|
69
|
+
named_constraints = True
|
|
70
|
+
|
|
71
|
+
def path_constraints(self, ensemble_member):
|
|
72
|
+
return [(self.state("Q_release"), 0.0, 10.0, "release_capacity")]
|
|
73
|
+
|
|
74
|
+
This yields rows labelled ``release_capacity__t0__lb``, ``release_capacity__t0__ub``, and so on.
|
|
75
|
+
The other rows stay unnamed, unless ``label_all_constraint_rows`` is set as well.
|
|
76
|
+
|
|
77
|
+
Goal programming can name the constraints it adds: with ``named_constraints = True``, set the
|
|
78
|
+
goal programming option ``constraint_names`` to label them ``{GoalClass}_p{priority}``,
|
|
79
|
+
``{GoalClass}_p{priority}_abs_pos`` / ``_abs_neg`` for a
|
|
80
|
+
:class:`~rtctools.optimization.min_abs_goal_programming_mixin.MinAbsGoal`, and
|
|
81
|
+
``pareto_p{priority}`` for the objective constraint kept with ``keep_soft_constraints``.
|
|
82
|
+
|
|
48
83
|
Rows with two infinite bounds are left out of the file. A row that reduces to a constant
|
|
49
84
|
outside its bounds (by more than 1e-9, or with a lower bound above its upper bound) is kept,
|
|
50
85
|
written against a variable ``__zero`` fixed to 0, so that an LP solver also finds the exported
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import os
|
|
3
3
|
import textwrap
|
|
4
|
+
from collections import Counter
|
|
4
5
|
|
|
5
6
|
import casadi as ca
|
|
6
7
|
import numpy as np
|
|
@@ -19,6 +20,9 @@ LP_FEASIBILITY_EPSILON = 1e-9
|
|
|
19
20
|
# Variable fixed to 0 that stands in for the missing variable term of an infeasible constant row
|
|
20
21
|
LP_ZERO_VAR = "__zero"
|
|
21
22
|
|
|
23
|
+
# Characters LP readers reject in names; a backslash would start a comment
|
|
24
|
+
_LP_FORBIDDEN_NAME_CHARS = str.maketrans(dict.fromkeys(" \t\r\n\\:+-*/^<>=()[]'\"#", "_"))
|
|
25
|
+
|
|
22
26
|
logger = logging.getLogger("rtctools")
|
|
23
27
|
|
|
24
28
|
# Note: the LP file is currently used for diagnostics/export only. Using it as a
|
|
@@ -54,14 +58,38 @@ def _format_lp_bound(val: float) -> str:
|
|
|
54
58
|
return f"{val:.15g}"
|
|
55
59
|
|
|
56
60
|
|
|
57
|
-
def
|
|
58
|
-
"""
|
|
61
|
+
def _sanitize_lp_name(name: str) -> str:
|
|
62
|
+
"""Replace characters LP readers reject, and prefix a leading digit or period."""
|
|
63
|
+
name = name.translate(_LP_FORBIDDEN_NAME_CHARS)
|
|
64
|
+
return f"_{name}" if name[:1].isdigit() or name[:1] == "." else name
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def _deduplicate(names: list[str]) -> list[str]:
|
|
68
|
+
"""Append ``__d{n}`` to every occurrence of a repeated name; empty names stay empty."""
|
|
69
|
+
counts = Counter(names)
|
|
70
|
+
taken = set(names)
|
|
71
|
+
next_index = Counter()
|
|
72
|
+
result = []
|
|
73
|
+
for name in names:
|
|
74
|
+
if name and counts[name] > 1:
|
|
75
|
+
while (candidate := f"{name}__d{next_index[name]}") in taken:
|
|
76
|
+
next_index[name] += 1
|
|
77
|
+
taken.add(candidate)
|
|
78
|
+
name = candidate
|
|
79
|
+
result.append(name)
|
|
80
|
+
return result
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def _describe(indices, names: list[str | None] | None) -> str:
|
|
84
|
+
"""List up to ten indices, by name where names are given."""
|
|
59
85
|
indices = list(indices)[:10]
|
|
60
|
-
|
|
86
|
+
if names is None:
|
|
87
|
+
return str(indices)
|
|
88
|
+
return ", ".join(names[i] or f"row {i}" for i in indices)
|
|
61
89
|
|
|
62
90
|
|
|
63
91
|
def _check_writable_bounds(
|
|
64
|
-
lb: np.ndarray, ub: np.ndarray, kind: str, names: list[str] | None
|
|
92
|
+
lb: np.ndarray, ub: np.ndarray, kind: str, names: list[str | None] | None
|
|
65
93
|
) -> None:
|
|
66
94
|
"""Raise if a bound has no LP form: NaN, a lower bound of +inf or an upper bound of -inf."""
|
|
67
95
|
bad = np.flatnonzero(np.isnan(lb) | np.isnan(ub) | np.isposinf(lb) | np.isneginf(ub))
|
|
@@ -133,6 +161,7 @@ def _build_constraints(
|
|
|
133
161
|
lbg: list,
|
|
134
162
|
ubg: list,
|
|
135
163
|
var_names: list[str],
|
|
164
|
+
row_names: list[str | None] | None = None,
|
|
136
165
|
) -> str:
|
|
137
166
|
"""
|
|
138
167
|
Build the LP constraints string.
|
|
@@ -143,7 +172,9 @@ def _build_constraints(
|
|
|
143
172
|
|
|
144
173
|
Rows with both bounds infinite are left out. A row without variable terms is left out if
|
|
145
174
|
its constant satisfies its bounds, and otherwise written against ``LP_ZERO_VAR`` (fixed to 0
|
|
146
|
-
by an extra row) so the file stays infeasible.
|
|
175
|
+
by an extra row) so the file stays infeasible. With ``row_names``, each line is labelled
|
|
176
|
+
with its LP-safe row name: ``__lb`` / ``__ub`` for the two lines of a range row and
|
|
177
|
+
``__d{n}`` for repeated names.
|
|
147
178
|
|
|
148
179
|
Note: constraint lines are not wrapped and may exceed the LP format 255-character
|
|
149
180
|
line limit for problems with many variables. Use shorter variable names if needed.
|
|
@@ -154,6 +185,7 @@ def _build_constraints(
|
|
|
154
185
|
lbg: Lower bounds on each constraint row (``-inf`` for one-sided upper bounds).
|
|
155
186
|
ubg: Upper bounds on each constraint row (``+inf`` for one-sided lower bounds).
|
|
156
187
|
var_names: Human-readable name for each element of x.
|
|
188
|
+
row_names: Optional name for each row of g; a row named ``None`` stays unnamed.
|
|
157
189
|
|
|
158
190
|
Returns:
|
|
159
191
|
Indented constraints string ready to follow the ``Subject To`` header
|
|
@@ -169,7 +201,7 @@ def _build_constraints(
|
|
|
169
201
|
|
|
170
202
|
lbg = np.array(ca.veccat(*lbg))[:, 0]
|
|
171
203
|
ubg = np.array(ca.veccat(*ubg))[:, 0]
|
|
172
|
-
_check_writable_bounds(lbg, ubg, "constraint",
|
|
204
|
+
_check_writable_bounds(lbg, ubg, "constraint", row_names)
|
|
173
205
|
A_csc = A.tocsc()
|
|
174
206
|
A_coo = A_csc.tocoo()
|
|
175
207
|
b = np.array(b)[:, 0]
|
|
@@ -177,7 +209,7 @@ def _build_constraints(
|
|
|
177
209
|
if len(nonfinite_rows):
|
|
178
210
|
raise ValueError(
|
|
179
211
|
"Cannot export LP file: constraint rows have a non-finite constant term: "
|
|
180
|
-
f"{_describe(nonfinite_rows,
|
|
212
|
+
f"{_describe(nonfinite_rows, row_names)}."
|
|
181
213
|
)
|
|
182
214
|
|
|
183
215
|
constraints = [[] for _ in range(A.shape[0])]
|
|
@@ -185,7 +217,8 @@ def _build_constraints(
|
|
|
185
217
|
if abs(c) > LP_COEFF_EPSILON:
|
|
186
218
|
constraints[i].extend(["+" if c > 0 else "-", f"{abs(c):.15g}", var_names[j]])
|
|
187
219
|
|
|
188
|
-
|
|
220
|
+
labels = [_sanitize_lp_name(n) if n else "" for n in row_names or [None] * A.shape[0]]
|
|
221
|
+
lines = [] # (label, line); the label is "" for an unnamed row
|
|
189
222
|
vacuous_rows = []
|
|
190
223
|
infeasible_constant_rows = []
|
|
191
224
|
for i, cur_constr in enumerate(constraints):
|
|
@@ -207,35 +240,37 @@ def _build_constraints(
|
|
|
207
240
|
infeasible_constant_rows.append(i)
|
|
208
241
|
c_str = LP_ZERO_VAR
|
|
209
242
|
|
|
243
|
+
label = labels[i]
|
|
210
244
|
if np.isfinite(lb) and np.isfinite(ub) and lb == ub:
|
|
211
|
-
|
|
245
|
+
lines.append((label, f"{c_str} = {lb - b_i:.15g}"))
|
|
212
246
|
elif np.isfinite(lb) and np.isfinite(ub):
|
|
213
247
|
# Range constraint: lb <= expr <= ub. We do not use the LP ``Ranges``
|
|
214
248
|
# section; we express this as two separate inequalities instead.
|
|
215
|
-
|
|
216
|
-
|
|
249
|
+
lines.append((label and f"{label}__lb", f"{c_str} >= {lb - b_i:.15g}"))
|
|
250
|
+
lines.append((label and f"{label}__ub", f"{c_str} <= {ub - b_i:.15g}"))
|
|
217
251
|
elif np.isfinite(lb):
|
|
218
|
-
|
|
252
|
+
lines.append((label, f"{c_str} >= {lb - b_i:.15g}"))
|
|
219
253
|
else:
|
|
220
|
-
|
|
221
|
-
constraints_str_list.append(constraint_line)
|
|
254
|
+
lines.append((label, f"{c_str} <= {ub - b_i:.15g}"))
|
|
222
255
|
if infeasible_constant_rows:
|
|
223
|
-
|
|
256
|
+
lines.append((LP_ZERO_VAR if row_names is not None else "", f"{LP_ZERO_VAR} = 0"))
|
|
224
257
|
logger.warning(
|
|
225
258
|
"LP export: %d constraint row(s) reduce to a constant that violates their bounds, "
|
|
226
259
|
"so the problem is infeasible: %s.",
|
|
227
260
|
len(infeasible_constant_rows),
|
|
228
|
-
_describe(infeasible_constant_rows,
|
|
261
|
+
_describe(infeasible_constant_rows, row_names),
|
|
229
262
|
)
|
|
230
263
|
if vacuous_rows:
|
|
231
264
|
logger.info(
|
|
232
265
|
"LP export: left out %d constraint row(s) with both bounds infinite: %s.",
|
|
233
266
|
len(vacuous_rows),
|
|
234
|
-
_describe(vacuous_rows,
|
|
267
|
+
_describe(vacuous_rows, row_names),
|
|
235
268
|
)
|
|
236
|
-
if not
|
|
269
|
+
if not lines:
|
|
237
270
|
return ""
|
|
238
|
-
|
|
271
|
+
unique = _deduplicate([label for label, _ in lines])
|
|
272
|
+
lines = [(label, line) for label, (_, line) in zip(unique, lines, strict=True)]
|
|
273
|
+
return " " + "\n ".join(f"{label}: {line}" if label else line for label, line in lines)
|
|
239
274
|
|
|
240
275
|
|
|
241
276
|
def _build_bounds(
|
|
@@ -32,6 +32,22 @@ from .timeseries import Timeseries
|
|
|
32
32
|
logger = logging.getLogger("rtctools")
|
|
33
33
|
|
|
34
34
|
|
|
35
|
+
def _row_labels(constraints, prefix, suffix):
|
|
36
|
+
"""Label each row of ``(f, m, M[, name])`` tuples, one per element of a vector ``f``.
|
|
37
|
+
|
|
38
|
+
An unnamed entry is labelled ``{prefix}_{i}``, or ``None`` if ``prefix`` is ``None``.
|
|
39
|
+
"""
|
|
40
|
+
for i, c in enumerate(constraints):
|
|
41
|
+
base = (c[3] if len(c) == 4 else None) or (prefix and f"{prefix}_{i}")
|
|
42
|
+
n = c[0].size1()
|
|
43
|
+
if base is None:
|
|
44
|
+
yield from [None] * n
|
|
45
|
+
elif n == 1:
|
|
46
|
+
yield f"{base}{suffix}"
|
|
47
|
+
else:
|
|
48
|
+
yield from (f"{base}__{k}{suffix}" for k in range(n))
|
|
49
|
+
|
|
50
|
+
|
|
35
51
|
class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABCMeta):
|
|
36
52
|
"""
|
|
37
53
|
Discretizes your model using a mixed collocation/integration scheme.
|
|
@@ -56,6 +72,10 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
56
72
|
:cvar inline_delay_expressions:
|
|
57
73
|
If ``True``, delay expressions are inlined into constraints and objectives instead of
|
|
58
74
|
being added as separate equality constraints. Default is ``False``.
|
|
75
|
+
:cvar label_all_constraint_rows:
|
|
76
|
+
If ``True``, :meth:`transcribe` labels every constraint row in ``nlp["g_names"]``,
|
|
77
|
+
e.g. ``collocation_eq0__t3``. Default is ``False``: only rows of constraints named under
|
|
78
|
+
:attr:`named_constraints` are labelled.
|
|
59
79
|
"""
|
|
60
80
|
|
|
61
81
|
#: Check whether the collocation constraints are linear
|
|
@@ -64,6 +84,9 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
64
84
|
#: Inline delay expressions instead of adding them as separate equality constraints
|
|
65
85
|
inline_delay_expressions = False
|
|
66
86
|
|
|
87
|
+
#: Label every constraint row in ``nlp["g_names"]``
|
|
88
|
+
label_all_constraint_rows = False
|
|
89
|
+
|
|
67
90
|
#: Whether or not the collocation constraints are linear (affine)
|
|
68
91
|
linear_collocation = None
|
|
69
92
|
|
|
@@ -558,9 +581,8 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
558
581
|
|
|
559
582
|
# Path constraints
|
|
560
583
|
path_constraints = self.path_constraints(0)
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
)
|
|
584
|
+
self.__check_constraint_tuples(path_constraints, "path_constraints")
|
|
585
|
+
path_constraint_expressions = ca.vertcat(*[c[0] for c in path_constraints])
|
|
564
586
|
|
|
565
587
|
# Delayed feedback
|
|
566
588
|
delayed_feedback_expressions, delayed_feedback_states, delayed_feedback_durations = (
|
|
@@ -1219,6 +1241,12 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1219
1241
|
g = []
|
|
1220
1242
|
lbg = []
|
|
1221
1243
|
ubg = []
|
|
1244
|
+
label_all = self.label_all_constraint_rows
|
|
1245
|
+
labels = [] if label_all or self.named_constraints else None
|
|
1246
|
+
|
|
1247
|
+
def add_labels(names):
|
|
1248
|
+
if labels is not None:
|
|
1249
|
+
labels.extend(names)
|
|
1222
1250
|
|
|
1223
1251
|
# Add constraints for initial conditions
|
|
1224
1252
|
if self.__initial_residual_with_params_fun_map is None:
|
|
@@ -1261,11 +1289,19 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1261
1289
|
True,
|
|
1262
1290
|
)
|
|
1263
1291
|
|
|
1292
|
+
n_initial_residuals = res.size1()
|
|
1264
1293
|
res = ca.vec(res)
|
|
1265
1294
|
g.append(res)
|
|
1266
1295
|
zeros = [0.0] * res.size1()
|
|
1267
1296
|
lbg.extend(zeros)
|
|
1268
1297
|
ubg.extend(zeros)
|
|
1298
|
+
add_labels(
|
|
1299
|
+
f"initial_residual_{eq}" + (f"__m{m}" if self.ensemble_size > 1 else "")
|
|
1300
|
+
if label_all
|
|
1301
|
+
else None
|
|
1302
|
+
for m in range(self.ensemble_size)
|
|
1303
|
+
for eq in range(n_initial_residuals)
|
|
1304
|
+
)
|
|
1269
1305
|
|
|
1270
1306
|
# The initial values and the interpolated mapped arguments are saved
|
|
1271
1307
|
# such that can be reused in map_path_expression().
|
|
@@ -1290,6 +1326,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1290
1326
|
# of loop detection.
|
|
1291
1327
|
for ensemble_member in range(self.ensemble_size):
|
|
1292
1328
|
logger.info(f"Transcribing ensemble member {ensemble_member + 1}/{self.ensemble_size}")
|
|
1329
|
+
member = f"__m{ensemble_member}" if self.ensemble_size > 1 else ""
|
|
1293
1330
|
|
|
1294
1331
|
initial_state = ensemble_aggregate["initial_state"][:, ensemble_member]
|
|
1295
1332
|
initial_derivatives = ensemble_aggregate["initial_derivatives"][:, ensemble_member]
|
|
@@ -1390,6 +1427,10 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1390
1427
|
g.append(ca.vertcat(*initial_derivative_constraints))
|
|
1391
1428
|
lbg.append(np.zeros(len(initial_derivative_constraints)))
|
|
1392
1429
|
ubg.append(np.zeros(len(initial_derivative_constraints)))
|
|
1430
|
+
add_labels(
|
|
1431
|
+
f"initial_derivative_{i}{member}" if label_all else None
|
|
1432
|
+
for i in range(len(initial_derivative_constraints))
|
|
1433
|
+
)
|
|
1393
1434
|
|
|
1394
1435
|
# Initial conditions for integrator
|
|
1395
1436
|
accumulation_X0 = []
|
|
@@ -1610,6 +1651,11 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1610
1651
|
zeros = np.zeros(collocation_constraints.size1())
|
|
1611
1652
|
lbg.extend(zeros)
|
|
1612
1653
|
ubg.extend(zeros)
|
|
1654
|
+
add_labels(
|
|
1655
|
+
f"collocation_eq{eq}__t{t}{member}" if label_all else None
|
|
1656
|
+
for t in range(1, n_collocation_times)
|
|
1657
|
+
for eq in range(dae_residual_collocated_size)
|
|
1658
|
+
)
|
|
1613
1659
|
|
|
1614
1660
|
# Prepare arguments for map_path_expression() calls to ca.map()
|
|
1615
1661
|
if len(integrated_variables) + len(collocated_variables) > 0:
|
|
@@ -1913,6 +1959,10 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1913
1959
|
zeros = np.zeros(n_collocation_times)
|
|
1914
1960
|
lbg.extend(zeros)
|
|
1915
1961
|
ubg.extend(zeros)
|
|
1962
|
+
add_labels(
|
|
1963
|
+
f"delay_{in_canonical}__t{t}{member}" if label_all else None
|
|
1964
|
+
for t in range(n_collocation_times)
|
|
1965
|
+
)
|
|
1916
1966
|
|
|
1917
1967
|
# Objective
|
|
1918
1968
|
f_member = self.objective(ensemble_member)
|
|
@@ -1935,12 +1985,16 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1935
1985
|
"The `constraints` method returned None, but should always return a list."
|
|
1936
1986
|
)
|
|
1937
1987
|
|
|
1988
|
+
self.__check_constraint_tuples(constraints, "constraints")
|
|
1989
|
+
|
|
1938
1990
|
if logger.getEffectiveLevel() == logging.DEBUG:
|
|
1939
1991
|
for constraint in constraints:
|
|
1940
|
-
logger.debug("Adding constraint
|
|
1992
|
+
logger.debug("Adding constraint " + ", ".join(map(str, constraint)))
|
|
1941
1993
|
|
|
1942
1994
|
if constraints:
|
|
1943
|
-
g_constraint, lbg_constraint, ubg_constraint =
|
|
1995
|
+
g_constraint, lbg_constraint, ubg_constraint = zip(
|
|
1996
|
+
*(c[:3] for c in constraints), strict=True
|
|
1997
|
+
)
|
|
1944
1998
|
|
|
1945
1999
|
lbg_constraint = list(lbg_constraint)
|
|
1946
2000
|
ubg_constraint = list(ubg_constraint)
|
|
@@ -1977,12 +2031,15 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
1977
2031
|
g.extend(g_constraint)
|
|
1978
2032
|
lbg.extend(lbg_constraint)
|
|
1979
2033
|
ubg.extend(ubg_constraint)
|
|
2034
|
+
prefix = "constraint" if label_all else None
|
|
2035
|
+
add_labels(_row_labels(constraints, prefix, member))
|
|
1980
2036
|
|
|
1981
2037
|
# Path constraints
|
|
1982
2038
|
# We need to call self.path_constraints() again here,
|
|
1983
2039
|
# as the bounds may change from ensemble member to member.
|
|
1984
2040
|
if ensemble_member > 0:
|
|
1985
2041
|
path_constraints = self.path_constraints(ensemble_member)
|
|
2042
|
+
self.__check_constraint_tuples(path_constraints, "path_constraints")
|
|
1986
2043
|
|
|
1987
2044
|
if len(path_constraints) > 0:
|
|
1988
2045
|
# We need to evaluate the path constraints at t0, as the initial time is not
|
|
@@ -2003,7 +2060,9 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2003
2060
|
j = 0
|
|
2004
2061
|
for path_constraint in path_constraints:
|
|
2005
2062
|
if logger.getEffectiveLevel() == logging.DEBUG:
|
|
2006
|
-
logger.debug(
|
|
2063
|
+
logger.debug(
|
|
2064
|
+
"Adding path constraint " + ", ".join(map(str, path_constraint))
|
|
2065
|
+
)
|
|
2007
2066
|
|
|
2008
2067
|
s = path_constraint[0].size1()
|
|
2009
2068
|
|
|
@@ -2038,6 +2097,12 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2038
2097
|
|
|
2039
2098
|
lbg.extend(lbg_path_constraints.transpose().ravel())
|
|
2040
2099
|
ubg.extend(ubg_path_constraints.transpose().ravel())
|
|
2100
|
+
prefix = "path_constraint" if label_all else None
|
|
2101
|
+
add_labels(
|
|
2102
|
+
label
|
|
2103
|
+
for t in range(n_collocation_times)
|
|
2104
|
+
for label in _row_labels(path_constraints, prefix, f"__t{t}{member}")
|
|
2105
|
+
)
|
|
2041
2106
|
|
|
2042
2107
|
# If inlining delay expressions, carry out the single call to ca.substitute()
|
|
2043
2108
|
# A single call is more efficient as it constructs a single ca.Function internally,
|
|
@@ -2068,6 +2133,8 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2068
2133
|
logger.info("Creating NLP dictionary")
|
|
2069
2134
|
|
|
2070
2135
|
nlp = {"x": X, "f": ca.sum1(ca.vertcat(*f)), "g": ca.vertcat(*g)}
|
|
2136
|
+
if labels is not None:
|
|
2137
|
+
nlp["g_names"] = labels
|
|
2071
2138
|
|
|
2072
2139
|
# Done
|
|
2073
2140
|
logger.info("Done transcribing problem")
|
|
@@ -2077,6 +2144,20 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2077
2144
|
|
|
2078
2145
|
return discrete, lbx, ubx, lbg, ubg, x0, nlp
|
|
2079
2146
|
|
|
2147
|
+
def __check_constraint_tuples(self, constraints, method):
|
|
2148
|
+
for i, c in enumerate(constraints):
|
|
2149
|
+
if len(c) == 4 and self.named_constraints:
|
|
2150
|
+
if not isinstance(c[3], str | None):
|
|
2151
|
+
raise TypeError(
|
|
2152
|
+
f"{method}() entry #{i}: the name must be a str or None, "
|
|
2153
|
+
f"not {type(c[3]).__name__}"
|
|
2154
|
+
)
|
|
2155
|
+
elif len(c) != 3:
|
|
2156
|
+
raise TypeError(
|
|
2157
|
+
f"{method}() entry #{i} has {len(c)} elements; expected (f, m, M), "
|
|
2158
|
+
"or (f, m, M, name) if named_constraints is True"
|
|
2159
|
+
)
|
|
2160
|
+
|
|
2080
2161
|
def clear_transcription_cache(self):
|
|
2081
2162
|
"""
|
|
2082
2163
|
Clears the DAE ``Function``s that were cached by ``transcribe``.
|
|
@@ -2122,6 +2203,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2122
2203
|
lbx: list,
|
|
2123
2204
|
ubx: list,
|
|
2124
2205
|
discrete: list[bool],
|
|
2206
|
+
g_names: list[str | None] | None = None,
|
|
2125
2207
|
) -> None:
|
|
2126
2208
|
"""Export the transcribed LP/MILP problem as a file.
|
|
2127
2209
|
|
|
@@ -2141,6 +2223,8 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2141
2223
|
lbg, ubg: Lower/upper bounds on constraints.
|
|
2142
2224
|
lbx, ubx: Lower/upper bounds on variables.
|
|
2143
2225
|
discrete: Boolean array indicating discrete variables.
|
|
2226
|
+
g_names: Optional label per row of g, written as LP row names; a row labelled
|
|
2227
|
+
``None`` stays unnamed.
|
|
2144
2228
|
|
|
2145
2229
|
Raises:
|
|
2146
2230
|
ValueError: If the problem has a non-affine objective or constraints, uses
|
|
@@ -2168,7 +2252,7 @@ class CollocatedIntegratedOptimizationProblem(OptimizationProblem, metaclass=ABC
|
|
|
2168
2252
|
|
|
2169
2253
|
var_names = _sanitize_var_names(self._collint_variable_indices_as_lists, x.shape[0])
|
|
2170
2254
|
obj_str = _build_objective(f, x, var_names)
|
|
2171
|
-
constr_str = _build_constraints(g, x, lbg, ubg, var_names)
|
|
2255
|
+
constr_str = _build_constraints(g, x, lbg, ubg, var_names, g_names)
|
|
2172
2256
|
bounds_str, binary_vars, general_vars = _build_bounds(var_names, lbx, ubx, discrete)
|
|
2173
2257
|
|
|
2174
2258
|
timestamp = time.strftime("%Y%m%d_%H%M%S")
|
|
@@ -183,9 +183,7 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
183
183
|
self.__subproblem_soft_constraints[ensemble_member],
|
|
184
184
|
)
|
|
185
185
|
|
|
186
|
-
|
|
187
|
-
constraints.append((constraint.function(self), constraint.min, constraint.max))
|
|
188
|
-
|
|
186
|
+
constraints.extend(self._gp_constraint_tuples(additional_constraints))
|
|
189
187
|
return constraints
|
|
190
188
|
|
|
191
189
|
def path_constraints(self, ensemble_member):
|
|
@@ -197,9 +195,7 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
197
195
|
self.__subproblem_path_soft_constraints[ensemble_member],
|
|
198
196
|
)
|
|
199
197
|
|
|
200
|
-
|
|
201
|
-
path_constraints.append((constraint.function(self), constraint.min, constraint.max))
|
|
202
|
-
|
|
198
|
+
path_constraints.extend(self._gp_constraint_tuples(additional_path_constraints))
|
|
203
199
|
return path_constraints
|
|
204
200
|
|
|
205
201
|
def solver_options(self):
|
|
@@ -253,6 +249,8 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
253
249
|
+---------------------------+-----------+---------------+
|
|
254
250
|
| ``keep_soft_constraints`` | ``bool`` | ``False`` |
|
|
255
251
|
+---------------------------+-----------+---------------+
|
|
252
|
+
| ``constraint_names`` | ``bool`` | ``False`` |
|
|
253
|
+
+---------------------------+-----------+---------------+
|
|
256
254
|
|
|
257
255
|
Before turning a soft constraint of the goal programming algorithm into a hard constraint,
|
|
258
256
|
the violation variable (also known as epsilon) of each goal is relaxed with the
|
|
@@ -318,6 +316,9 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
318
316
|
constraint for the subsequent priorities (while in the False option this was the case only
|
|
319
317
|
for the function of minimization goals).
|
|
320
318
|
|
|
319
|
+
If ``constraint_names`` is set to ``True``, the constraints that goal programming adds
|
|
320
|
+
are named ``{GoalClass}_p{priority}``. This requires ``named_constraints = True``.
|
|
321
|
+
|
|
321
322
|
:returns: A dictionary of goal programming options.
|
|
322
323
|
"""
|
|
323
324
|
|
|
@@ -333,6 +334,7 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
333
334
|
options["interior_distance"] = 1e-6
|
|
334
335
|
options["scale_by_problem_size"] = False
|
|
335
336
|
options["keep_soft_constraints"] = False
|
|
337
|
+
options["constraint_names"] = False
|
|
336
338
|
|
|
337
339
|
# Define temporary variable to avoid infinite loop between
|
|
338
340
|
# solver_options and goal_programming_options.
|
|
@@ -613,13 +615,14 @@ class GoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
613
615
|
|
|
614
616
|
options = self.goal_programming_options()
|
|
615
617
|
|
|
618
|
+
name = f"pareto_p{self._gp_current_priority}"
|
|
616
619
|
if options["fix_minimized_values"]:
|
|
617
|
-
constraint = _GoalConstraint(None, _constraint_func, obj_val, obj_val, True)
|
|
620
|
+
constraint = _GoalConstraint(None, _constraint_func, obj_val, obj_val, True, name)
|
|
618
621
|
self.check_collocation_linearity = False
|
|
619
622
|
self.linear_collocation = False
|
|
620
623
|
else:
|
|
621
624
|
obj_val += options["constraint_relaxation"]
|
|
622
|
-
constraint = _GoalConstraint(None, _constraint_func, -np.inf, obj_val, True)
|
|
625
|
+
constraint = _GoalConstraint(None, _constraint_func, -np.inf, obj_val, True, name)
|
|
623
626
|
|
|
624
627
|
# The goal works over all ensemble members, so we add it to the last
|
|
625
628
|
# one, as at that point the inputs of all previous ensemble members
|
{rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/goal_programming_mixin_base.py
RENAMED
|
@@ -454,6 +454,11 @@ class StateGoal(Goal):
|
|
|
454
454
|
)
|
|
455
455
|
|
|
456
456
|
|
|
457
|
+
def _goal_name(goal: Goal) -> str:
|
|
458
|
+
goal = getattr(goal, "orig_goal", goal) # name a converted MinAbsGoal after the user's goal
|
|
459
|
+
return f"{type(goal).__name__}_p{goal.priority}"
|
|
460
|
+
|
|
461
|
+
|
|
457
462
|
class _GoalConstraint:
|
|
458
463
|
def __init__(
|
|
459
464
|
self,
|
|
@@ -462,6 +467,7 @@ class _GoalConstraint:
|
|
|
462
467
|
m: float | np.ndarray | Timeseries,
|
|
463
468
|
M: float | np.ndarray | Timeseries,
|
|
464
469
|
optimized: bool,
|
|
470
|
+
name: str | None = None,
|
|
465
471
|
):
|
|
466
472
|
assert isinstance(m, (float, np.ndarray, Timeseries))
|
|
467
473
|
assert isinstance(M, (float, np.ndarray, Timeseries))
|
|
@@ -477,6 +483,9 @@ class _GoalConstraint:
|
|
|
477
483
|
self.min = m
|
|
478
484
|
self.max = M
|
|
479
485
|
self.optimized = optimized
|
|
486
|
+
if name is None and goal is not None:
|
|
487
|
+
name = _goal_name(goal)
|
|
488
|
+
self.name = name
|
|
480
489
|
|
|
481
490
|
def update_bounds(self, other, enforce="self"):
|
|
482
491
|
# NOTE: a.update_bounds(b) is _not_ the same as b.update_bounds(a).
|
|
@@ -563,6 +572,16 @@ class _GoalProgrammingMixinBase(OptimizationProblem, metaclass=ABCMeta):
|
|
|
563
572
|
def goal_programming_options(self) -> dict[str, float | bool]:
|
|
564
573
|
raise NotImplementedError()
|
|
565
574
|
|
|
575
|
+
def _gp_constraint_tuples(self, goal_constraints) -> list[tuple]:
|
|
576
|
+
"""Constraint tuples for ``goal_constraints``, named if ``constraint_names`` is set."""
|
|
577
|
+
if not self.goal_programming_options()["constraint_names"]:
|
|
578
|
+
return [(c.function(self), c.min, c.max) for c in goal_constraints]
|
|
579
|
+
if not self.named_constraints:
|
|
580
|
+
raise ValueError(
|
|
581
|
+
"goal_programming_options()['constraint_names'] requires named_constraints = True"
|
|
582
|
+
)
|
|
583
|
+
return [(c.function(self), c.min, c.max, c.name) for c in goal_constraints]
|
|
584
|
+
|
|
566
585
|
def goals(self) -> list[Goal]:
|
|
567
586
|
"""
|
|
568
587
|
User problem returns list of :class:`Goal` objects.
|
{rtc_tools-2.9.0a1 → rtc_tools-2.9.0a2}/src/rtctools/optimization/min_abs_goal_programming_mixin.py
RENAMED
|
@@ -12,6 +12,7 @@ from .goal_programming_mixin_base import (
|
|
|
12
12
|
StateGoal,
|
|
13
13
|
_EmptyEnsembleList,
|
|
14
14
|
_EmptyEnsembleOrderedDict,
|
|
15
|
+
_goal_name,
|
|
15
16
|
_GoalConstraint,
|
|
16
17
|
_GoalProgrammingMixinBase,
|
|
17
18
|
)
|
|
@@ -114,17 +115,15 @@ class MinAbsGoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
114
115
|
def constraints(self, ensemble_member):
|
|
115
116
|
constraints = super().constraints(ensemble_member)
|
|
116
117
|
|
|
117
|
-
|
|
118
|
-
constraints.append((constraint.function(self), constraint.min, constraint.max))
|
|
119
|
-
|
|
118
|
+
constraints.extend(self._gp_constraint_tuples(self.__problem_constraints[ensemble_member]))
|
|
120
119
|
return constraints
|
|
121
120
|
|
|
122
121
|
def path_constraints(self, ensemble_member):
|
|
123
122
|
path_constraints = super().path_constraints(ensemble_member)
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
path_constraints.extend(
|
|
125
|
+
self._gp_constraint_tuples(self.__problem_path_constraints[ensemble_member])
|
|
126
|
+
)
|
|
128
127
|
return path_constraints
|
|
129
128
|
|
|
130
129
|
def __validate_goals(self, goals, is_path_goal):
|
|
@@ -197,8 +196,11 @@ class MinAbsGoalProgrammingMixin(_GoalProgrammingMixinBase):
|
|
|
197
196
|
_pos = functools.partial(_constraint_func, sign=1)
|
|
198
197
|
_neg = functools.partial(_constraint_func, sign=-1)
|
|
199
198
|
|
|
200
|
-
|
|
201
|
-
constraints[ensemble_member]
|
|
199
|
+
name = _goal_name(goal)
|
|
200
|
+
constraints[ensemble_member] += [
|
|
201
|
+
_GoalConstraint(None, _pos, 0.0, np.inf, False, f"{name}_abs_pos"),
|
|
202
|
+
_GoalConstraint(None, _neg, 0.0, np.inf, False, f"{name}_abs_neg"),
|
|
203
|
+
]
|
|
202
204
|
|
|
203
205
|
# Overwrite the original goal, such that it is just a minimization
|
|
204
206
|
# of the additional variable.
|