agentlib_mpc.modules package
This package contains all modules for the distributed model predictive control using multi agent systems.
It contains classes for local optimization and global coordination.
Subpackages
- agentlib_mpc.modules.InputPrediction package
- agentlib_mpc.modules.deactivate_mpc package
- agentlib_mpc.modules.dmpc package
DistributedMPCDistributedMPCConfig- Subpackages
- Submodules
- agentlib_mpc.modules.dmpc.coordinator module
CoordinatorCoordinatorConfigCoordinatorConfig.log_levelCoordinatorConfig.maxIterCoordinatorConfig.messages_inCoordinatorConfig.messages_outCoordinatorConfig.module_idCoordinatorConfig.shared_variable_fieldsCoordinatorConfig.time_out_non_respondersCoordinatorConfig.typeCoordinatorConfig.validate_incoming_valuesCoordinatorConfig.model_post_init()
- agentlib_mpc.modules.dmpc.employee module
MiniEmployeeMiniEmployeeConfigMiniEmployeeConfig.activeMiniEmployeeConfig.coordinatorMiniEmployeeConfig.deactivation_sourceMiniEmployeeConfig.enable_deactivationMiniEmployeeConfig.log_levelMiniEmployeeConfig.messages_inMiniEmployeeConfig.messages_outMiniEmployeeConfig.module_idMiniEmployeeConfig.registration_intervalMiniEmployeeConfig.request_frequencyMiniEmployeeConfig.shared_variable_fieldsMiniEmployeeConfig.typeMiniEmployeeConfig.validate_incoming_valuesMiniEmployeeConfig.model_post_init()
- agentlib_mpc.modules.estimation package
- Submodules
- agentlib_mpc.modules.estimation.mhe module
MHEMHEConfigMHEConfig.estimated_inputsMHEConfig.estimated_parametersMHEConfig.horizonMHEConfig.known_inputsMHEConfig.known_parametersMHEConfig.optimization_backendMHEConfig.shared_variable_fieldsMHEConfig.state_weightsMHEConfig.statesMHEConfig.time_stepMHEConfig.model_post_init()MHEConfig.state_weights_are_in_states()MHEConfig.wrappedMHEConfig.decorator_infoMHEConfig.shim
- agentlib_mpc.modules.ml_model_training package
- Submodules
- agentlib_mpc.modules.ml_model_training.data_reduction module
- agentlib_mpc.modules.ml_model_training.ml_model_trainer module
ANNTrainerANNTrainerConfigGPRTrainerGPRTrainerConfigLinRegTrainerLinRegTrainerConfigMLModelTrainerMLModelTrainer.agent_and_timeMLModelTrainer.build_ml_model()MLModelTrainer.create_inputs_and_outputs()MLModelTrainer.divide_in_tvt()MLModelTrainer.fit_ml_model()MLModelTrainer.input_namesMLModelTrainer.model_typeMLModelTrainer.output_namesMLModelTrainer.process()MLModelTrainer.register_callbacks()MLModelTrainer.resample()MLModelTrainer.retrain_model()MLModelTrainer.save_all()MLModelTrainer.save_ml_model()MLModelTrainer.serialize_ml_model()MLModelTrainer.training_info
MLModelTrainerConfigMLModelTrainerConfig.MLModelMLModelTrainerConfig.data_sourcesMLModelTrainerConfig.inputsMLModelTrainerConfig.interpolationsMLModelTrainerConfig.lagsMLModelTrainerConfig.output_typesMLModelTrainerConfig.outputsMLModelTrainerConfig.recursive_outputsMLModelTrainerConfig.retrain_delayMLModelTrainerConfig.save_dataMLModelTrainerConfig.save_directoryMLModelTrainerConfig.save_ml_modelMLModelTrainerConfig.save_plotsMLModelTrainerConfig.shared_variable_fieldsMLModelTrainerConfig.step_sizeMLModelTrainerConfig.test_shareMLModelTrainerConfig.time_series_lengthMLModelTrainerConfig.time_series_memory_sizeMLModelTrainerConfig.train_shareMLModelTrainerConfig.use_values_for_incomplete_dataMLModelTrainerConfig.validation_shareMLModelTrainerConfig.check_data_sources_existMLModelTrainerConfig.check_if_save_path_is_thereMLModelTrainerConfig.check_shares_amount_to_oneMLModelTrainerConfig.fill_interpolationsMLModelTrainerConfig.fill_lagsMLModelTrainerConfig.fill_output_typesMLModelTrainerConfig.fill_recursive_outputsMLModelTrainerConfig.model_post_init()
- agentlib_mpc.modules.ml_model_training.setpoint_generator module
SetPointGeneratorSetPointGeneratorConfigSetPointGeneratorConfig.day_endSetPointGeneratorConfig.day_lbSetPointGeneratorConfig.day_startSetPointGeneratorConfig.day_ubSetPointGeneratorConfig.intervalSetPointGeneratorConfig.night_lbSetPointGeneratorConfig.night_ubSetPointGeneratorConfig.shared_variable_fieldsSetPointGeneratorConfig.t_offsetSetPointGeneratorConfig.target_variableSetPointGeneratorConfig.model_post_init()
- agentlib_mpc.modules.mpc package
- Submodules
- agentlib_mpc.modules.mpc.minlp_mpc module
- agentlib_mpc.modules.mpc.mpc module
BaseMPCBaseMPC.assert_mpc_variables_are_in_model()BaseMPC.assert_subset()BaseMPC.cleanup_results()BaseMPC.collect_variables_for_optimization()BaseMPC.do_step()BaseMPC.get_results()BaseMPC.modelBaseMPC.pre_computation_hook()BaseMPC.process()BaseMPC.re_init_optimization()BaseMPC.read_results_file()BaseMPC.register_callbacks()BaseMPC.set_actuation()BaseMPC.set_output()BaseMPC.warn_for_missed_solves()
BaseMPCConfigBaseMPCConfig.controlsBaseMPCConfig.inputsBaseMPCConfig.optimization_backendBaseMPCConfig.outputsBaseMPCConfig.parametersBaseMPCConfig.prediction_horizonBaseMPCConfig.sampling_timeBaseMPCConfig.set_outputsBaseMPCConfig.shared_variable_fieldsBaseMPCConfig.statesBaseMPCConfig.time_stepBaseMPCConfig.default_sampling_timeBaseMPCConfig.model_post_init()
create_optimization_backend()
- agentlib_mpc.modules.mpc.mpc_full module
- agentlib_mpc.modules.mpc.skippable_mixin module
Submodules
agentlib_mpc.modules.data_source module
- class agentlib_mpc.modules.data_source.DataSource(config: dict, agent: Agent)[source]
Bases:
BaseModule
- pydantic model agentlib_mpc.modules.data_source.DataSourceConfig[source]
Bases:
BaseModuleConfig- Config:
arbitrary_types_allowed: bool = True
validate_assignment: bool = True
extra: str = forbid
frozen: bool = True
- Fields:
- Validators:
- field columns: List[str] | None = None
Optional list of columns of data frame that should be sent.If ommited, all datapoint in frame are sent.
- field data: DataFrame | Path = Empty DataFrame Columns: [] Index: []
Data that should be communicated during execution.Index should be either numeric or Datetime, numeric values are interpreted as seconds.
- Validated by:
- field data_offset: Timedelta | float | None = 0
Offset will be subtracted from index.
- field interpolation_method: InterpolationMethods | None = InterpolationMethods.previous
Interpolation method used for resampling of data.Only ‘linear’ and ‘previous’ are allowed.
- Validated by:
Indicates if the variable is going to be shared with other agents.
- field t_sample: float | int = 1
Sample time of data source. Default is 1 s.
- validator check_interpolation_method » interpolation_method[source]
- model_post_init(context: Any, /) None
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.
agentlib_mpc.modules.ml_model_simulator module
Module contains the MLModelSimulator, used to simulate with ML-Models. The class inherits from the Simulator class from the agentlib core.
- class agentlib_mpc.modules.ml_model_simulator.MLModelSimulator(*, config: dict, agent: Agent)[source]
Bases:
Simulator
- pydantic model agentlib_mpc.modules.ml_model_simulator.MLModelSimulatorConfig[source]
Bases:
SimulatorConfig- Config:
arbitrary_types_allowed: bool = True
validate_assignment: bool = True
extra: str = forbid
frozen: bool = True
- Fields:
- Validators:
check_t_sample»t_sample
- field serialized_ml_models: List[AgentVariable] = []
- model_post_init(context: Any, /) None
This function is meant to behave like a BaseModel method to initialise private attributes.
It takes context as an argument since that’s what pydantic-core passes when calling it.
- Parameters:
self – The BaseModel instance.
context – The context.