options package¶
Subpackages¶
Submodules¶
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
-
current_node
¶
-
edges
= None¶ edges of the graph
-
execute_controller_policy
()¶ Performs low level steps and transitions to other nodes using controller transition policy.
Returns state after one step, step reward, episode_termination_flag, info
-
get_number_of_nodes
()¶
-
load_trained_low_level_policies
()¶
-
nodes
= None¶ nodes of the graph
-
render
(mode='human')¶
-
reset
()¶ 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.
-
set_controller_args
(**kwargs)¶ Sets custom arguments depending on the chosen controller.
Parameters: **kwargs – dictionary of args and values
-
set_controller_policy
(policy)¶ 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)
-
set_current_node
(node_alias)¶ Sets the current node for controller. Used for training/testing a particular node.
Parameters: node_alias – alias of the node as per config file
-
step
(option)¶ 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