options package


options.options_loader module

class options.options_loader.OptionsGraph(json_path, env_class, *env_args, **env_kwargs)

Bases: object

Represent the options graph as a graph like structure. The configuration is specified in a json file and consists of the following specific values:

  • nodes: dictionary of policy node aliases -> maneuver classes
  • edges: dictionary such that it has key value pairs which represent
    edges between policy node aliases
  • starting_node: ego’s starting node
adj = None

adjacency list from the graph

edges = None

edges of the graph


Performs low level steps and transitions to other nodes using controller transition policy.

Returns state after one step, step reward, episode_termination_flag, info

nodes = None

nodes of the graph


Reset the environment. This function may be needed to reset the environment for eg. after an MCTS rollout and update. Also reset the controller to root node.

Returns whatever the environment’s reset returns.


Sets custom arguments depending on the chosen controller.

Parameters:**kwargs – dictionary of args and values

Sets the trained controller policy as a function which takes in feature vector and returns an option index(int). By default, trained_policy is None.

Parameters:policy – a function which takes in feature vector and returns an option index(int)

Sets the current node for controller. Used for training/testing a particular node.

Parameters:node_alias – alias of the node as per config file

Complete an episode using specified option. This assumes that the manager’s env is at a place where the option’s initiation condition is met.

Parameters:option – index of high level option to be executed
visualize_low_level_steps = False

visualization flag

Module contents