agentlib_mpc.modules.dmpc package
Subpackages
- agentlib_mpc.modules.dmpc.admm package
- Submodules
- agentlib_mpc.modules.dmpc.admm.admm module
ADMM
ADMM.admm_step()
ADMM.all_coupling_statuses()
ADMM.assert_mpc_variables_are_in_model()
ADMM.collect_couplings_for_optimization()
ADMM.collect_variables_for_optimization()
ADMM.cons_and_exchange
ADMM.deregister_all_participants()
ADMM.get_participants_values()
ADMM.get_results()
ADMM.participant_callback()
ADMM.penalty_factor_var
ADMM.process()
ADMM.receive_participant()
ADMM.registered_participants
ADMM.reset_participants_ready()
ADMM.send_coupling_values()
ADMM.send_coupling_variable()
ADMM.update_lambda()
ADMM.var_ref
ADMMConfig
ADMMParticipation
LocalADMM
LocalADMMConfig
ModuleStatus
ParticipantStatus
- agentlib_mpc.modules.dmpc.admm.admm_coordinated module
- agentlib_mpc.modules.dmpc.admm.admm_coordinator module
ADMMCoordinator
ADMMCoordinatorConfig
ADMMCoordinatorConfig.abs_tol
ADMMCoordinatorConfig.admm_iter_max
ADMMCoordinatorConfig.dual_tol
ADMMCoordinatorConfig.penalty_change_factor
ADMMCoordinatorConfig.penalty_change_threshold
ADMMCoordinatorConfig.penalty_factor
ADMMCoordinatorConfig.prediction_horizon
ADMMCoordinatorConfig.primal_tol
ADMMCoordinatorConfig.registration_period
ADMMCoordinatorConfig.rel_tol
ADMMCoordinatorConfig.sampling_time
ADMMCoordinatorConfig.save_iter_interval
ADMMCoordinatorConfig.save_solve_stats
ADMMCoordinatorConfig.solve_stats_file
ADMMCoordinatorConfig.time_step
ADMMCoordinatorConfig.use_relative_tolerances
ADMMCoordinatorConfig.wait_time_on_start_iters
ADMMCoordinatorConfig.default_sampling_time
ADMMCoordinatorConfig.model_post_init()
ADMMCoordinatorConfig.solve_stats_file_is_csv
- Module contents
Submodules
agentlib_mpc.modules.dmpc.coordinator module
- class agentlib_mpc.modules.dmpc.coordinator.Coordinator(*, config: dict, agent: Agent)[source]
Bases:
BaseModule
Class implementing the base coordination for distributed MPC
- property all_finished
Returns: True, if there are no busy agents, else False
- init_iteration_callback(variable: AgentVariable)[source]
Processes and Agents InitIteration confirmation. :param variable:
Returns:
- optim_results_callback(variable: AgentVariable)[source]
Saves the results of a local optimization. :param variable:
Returns:
- pydantic model agentlib_mpc.modules.dmpc.coordinator.CoordinatorConfig[source]
Bases:
BaseModuleConfig
- Config:
arbitrary_types_allowed: bool = True
validate_assignment: bool = True
extra: str = forbid
frozen: bool = True
- Fields:
- Validators:
check_valid_fields
»shared_variable_fields
- field maxIter: int = 10
Maximum number of iterations
- field messages_in: List[AgentVariable] = [AgentVariable(name='registration_agent_to_coordinator', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='registration_agent_to_coordinator', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='startIteration_agent_to_coordinator', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='startIteration_agent_to_coordinator', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='optimization_agent_to_coordinator', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='optimization_agent_to_coordinator', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None)]
- field messages_out: List[AgentVariable] = [AgentVariable(name='registration_coordinator_to_agent', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='registration_coordinator_to_agent', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='startIteration_coordinator_to_agent', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='startIteration_coordinator_to_agent', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='optimization_coordinator_to_agent', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='optimization_coordinator_to_agent', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None)]
- Validated by:
check_valid_fields
- field time_out_non_responders: float = 1
Maximum wait time for subsystems in seconds
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
agentlib_mpc.modules.dmpc.employee module
- class agentlib_mpc.modules.dmpc.employee.MiniEmployee(*, config: dict, agent: Agent)[source]
Bases:
BaseModule
- init_iteration_callback(variable: AgentVariable)[source]
Callback that processes the coordinators ‘startIteration’ flag. :param variable:
- abstract optimize(variable: AgentVariable)[source]
Performs the optimization given the information from the coordinator. Replies with local information. Returns:
- pre_computation_hook()[source]
This method is called in every computation step before the optimization starts. Overwrite this method in a derived subclass if you want to take some actions each time before the optimal control problem is solved.
- pydantic model agentlib_mpc.modules.dmpc.employee.MiniEmployeeConfig[source]
Bases:
BaseModuleConfig
- Config:
arbitrary_types_allowed: bool = True
validate_assignment: bool = True
extra: str = forbid
frozen: bool = True
- Fields:
- Validators:
check_valid_fields
»shared_variable_fields
- field coordinator: Source [Required]
Define the agents coordinator
- field messages_in: List[AgentVariable] = [AgentVariable(name='registration_coordinator_to_agent', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='registration_coordinator_to_agent', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='startIteration_coordinator_to_agent', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='startIteration_coordinator_to_agent', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='optimization_coordinator_to_agent', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='optimization_coordinator_to_agent', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None)]
- field messages_out: List[AgentVariable] = [AgentVariable(name='registration_agent_to_coordinator', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='registration_agent_to_coordinator', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='startIteration_agent_to_coordinator', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='startIteration_agent_to_coordinator', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None), AgentVariable(name='optimization_agent_to_coordinator', type=None, timestamp=None, unit='Not defined', description='Not defined', ub=inf, lb=-inf, clip=False, allowed_values=[], value=None, alias='optimization_agent_to_coordinator', source=Source(agent_id=None, module_id=None), shared=None, rdf_class=None)]
- field registration_interval: float = 10
Interval in seconds after which a registration attempt is made.
- Constraints:
ge = 0
- field request_frequency: float = 1
Wait time between signup_requests
- Validated by:
check_valid_fields
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.
Module contents
- class agentlib_mpc.modules.dmpc.DistributedMPC(config: dict, agent: Agent)[source]
Bases:
MPC
Base class which defines common interfaces among all distributed mpc approaches (either optimization based, game theory based or some other).
- pydantic model agentlib_mpc.modules.dmpc.DistributedMPCConfig[source]
Bases:
MPCConfig
Base config class with common configurations
- Config:
arbitrary_types_allowed: bool = True
validate_assignment: bool = True
extra: str = forbid
frozen: bool = True
- Fields:
- Validators:
- model_post_init(context: Any, /) None
We need to both initialize private attributes and call the user-defined model_post_init method.