hive.agents.random module

class hive.agents.random.RandomAgent(observation_space, action_space, id=0, logger=None, **kwargs)[source]

Bases: Agent

An agent that takes random steps at each timestep.

Parameters
  • observation_space (gym.Space) – The shape of the observations.

  • action_space (gym.Space) – The number of actions available to the agent.

  • id – Agent identifier.

  • logger (ScheduledLogger) – Logger used to log agent’s metrics.

act(observation, agent_traj_state=None)[source]

Returns a random action for the agent.

update(update_info, agent_traj_state=None)[source]

Updates the agent.

Parameters
  • update_info (dict) – Contains information from the environment agent needs to update itself.

  • agent_traj_state – Contains necessary state information for the agent to process current trajectory. This should be updated and returned.

Returns

Agent trajectory state.

save(dname)[source]

Saves agent checkpointing information to file for future loading.

Parameters

dname (str) – directory where agent should save all relevant info.

load(dname)[source]

Loads agent information from file.

Parameters

dname (str) – directory where agent checkpoint info is stored.