sustaingym.algorithms.building.mpc_controller#

Module Contents#

Classes#

MPCAgent

param env:

An object representing the environment for the agent.

MPCAgent_DataDriven

param env:

An object representing the environment for the agent.

class sustaingym.algorithms.building.mpc_controller.MPCAgent(env: sustaingym.envs.building.BuildingEnv, beta: float, pnorm: float, safety_margin: float = 0.9, planning_steps: int = 1)[source]#
Parameters:
  • env (sustaingym.envs.building.BuildingEnv) – An object representing the environment for the agent.

  • beta (float) – temperature error penalty weight for reward function

  • pnorm (float) – p to use for norm in reward function

  • safety_margin (float) – A safety margin factor for constraints.

  • planning_steps (int) – Number of steps over which to plan.

TODO: rewrite using cp.Parameters

predict() tuple[numpy.ndarray, numpy.ndarray][source]#
Parameters:

env – An object representing the environment for the agent.

Returns:

tuple – (optimal action, predicted state)

Return type:

tuple[numpy.ndarray, numpy.ndarray]

class sustaingym.algorithms.building.mpc_controller.MPCAgent_DataDriven(env: sustaingym.envs.building.BuildingEnv, beta: float, pnorm: float, safety_margin: float = 0.9, planning_steps: int = 1)[source]#
Parameters:
  • env (sustaingym.envs.building.BuildingEnv) – An object representing the environment for the agent.

  • beta (float) – temperature error penalty weight for reward function

  • pnorm (float) – p to use for norm in reward function

  • safety_margin (float) – A safety margin factor for constraints.

  • planning_steps (int) – Number of steps over which to plan.

TODO: rewrite using cp.Parameters

predict() tuple[numpy.ndarray, numpy.ndarray][source]#
Parameters:

env – An object representing the environment for the agent.

Returns:

tuple – (optimal action, predicted state)

Return type:

tuple[numpy.ndarray, numpy.ndarray]