flow.utils package¶
Subpackages¶
Submodules¶
flow.utils.exceptions module¶
Flow-specific exceptions.
flow.utils.flow_warnings module¶
Warnings that may be printed by Flow (e.g. deprecation warnings).
flow.utils.registry module¶
flow.utils.rllib module¶
Utility functions for Flow compatibility with RLlib.
This includes: environment generation, serialization, and visualization.
-
class
flow.utils.rllib.
FlowParamsEncoder
(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶ Bases:
json.encoder.JSONEncoder
Custom encoder used to generate
flow_params.json
.Extends
json.JSONEncoder
.
-
flow.utils.rllib.
get_flow_params
(config)[source]¶ Return Flow experiment parameters, given an experiment result folder.
- Parameters
config : dict < dict > or str
May be one of two things:
If it is a dict, then it is the stored RLlib configuration dict.
If it is a string, then it is the path to a flow_params json file.
- Returns
dict
flow-related parameters, consisting of the following keys:
exp_tag: name of the experiment
env_name: name of the flow environment the experiment is running on
scenario: name of the scenario class the experiment uses
simulator: simulator that is used by the experiment (e.g. aimsun)
sim: simulation-related parameters (see flow.core.params.SimParams)
env: environment related parameters (see flow.core.params.EnvParams)
net: network-related parameters (see flow.core.params.NetParams and the scenario’s documentation or ADDITIONAL_NET_PARAMS component)
veh: vehicles to be placed in the network at the start of a rollout (see flow.core.params.VehicleParams)
initial: parameters affecting the positioning of vehicles upon initialization/reset (see flow.core.params.InitialConfig)
tls: traffic lights to be introduced to specific nodes (see flow.core.params.TrafficLightParams)