Group#

class enki_env.GroupConfig(action: ~enki_env.config.ActionConfig, observation: ~enki_env.config.ObservationConfig, reward: ~enki_env.reward.RewardFunction | None = None, info: list[~enki_env.info.InfoFunction] = <factory>, terminations: list[TypeAliasForwardRef('Termination')] = <factory>)#

Contains everything required to configure a group of similar agents.

action: ActionConfig#

Defines how actions are actuated.

get_controller(policy: Predictor, deterministic: bool = True, cutoff: float = 0) pyenki.Controller#

Returns a controller, which can be assigned to a robot pyenki.PhysicalObject.control_step_callback, that actuates a policy.

Parameters:
  • policy – The policy.

  • deterministic – Whether to evaluate the policy deterministically.

  • cutoff – When the absolute value of actions is below this threshold, they will be set to zero.

info: list[InfoFunction]#

Defines which extra information is added to the info dictionary returned by reset and step.

observation: ObservationConfig#

Defines how observations are generated.

reward: RewardFunction | None = None#

Defines how rewards are assigned. If set to None, it will generate a constant -1.

terminations: list[Termination]#

Defines a list of conditions for a robot to terminate an episode, which are evaluated in sequence. The first time a returned value is different than None, it is recorded as a success (if True) or failure (if False) and may cause the episode to terminate for the robot or for the whole environment, depending on the value of terminate_on in the constructor of enki_env.ParallelEnkiEnv.

enki_env.setup_controllers(world: pyenki.World, config: dict[str, GroupConfig], policies: dict[str, Predictor], deterministic: bool = True, cutoff: float = 0) None#

Equips all robots in the world, with controllers that evaluate the selected policies, by matching the robot name with the keys of policies and config.

Parameters:
  • world – The world

  • config – A map of configurations assigned to groups of robots.

  • policies – A map of policies assigned to groups of robots.

  • deterministic – Whether to evaluate the policy deterministically.

  • cutoff – When the absolute value of actions is below this threshold, they will be set to zero.