Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
name: flow

dependencies:
- python==3.6.8
- scipy==1.1.0
- lxml==4.4.1
- six==1.11.0
- path.py
- python-dateutil==2.7.3
- pip>=18.0
- tensorflow==1.9.0
- cloudpickle==1.2.1
- setuptools==41.0.0
- plotly==2.4.0
- python==3.7.3
- pip:
- scipy==1.1.0
- lxml==4.4.1
- six==1.11.0
- path.py
- python-dateutil==2.7.3
- pip>=18.0
- tensorflow==1.15.2
- setuptools==41.0.0
- plotly==2.4.0
- gym==0.14.0
- pyprind==2.11.2
- nose2==0.8.0
Expand All @@ -21,9 +20,9 @@ dependencies:
- matplotlib==3.0.0
- dill
- lz4
- ray==0.7.3
- ray==0.8.0
- setproctitle
- psutil
- opencv-python
- boto3==1.4.8
- boto3==1.10.45
- redis~=2.10.6
4 changes: 2 additions & 2 deletions flow/visualize/visualizer_rllib.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def visualizer_rllib(args):
if multiagent:
rets = {}
# map the agent id to its policy
policy_map_fn = config['multiagent']['policy_mapping_fn'].func
policy_map_fn = config['multiagent']['policy_mapping_fn']
for key in config['multiagent']['policies'].keys():
rets[key] = []
else:
Expand All @@ -177,7 +177,7 @@ def visualizer_rllib(args):
if multiagent:
state_init = {}
# map the agent id to its policy
policy_map_fn = config['multiagent']['policy_mapping_fn'].func
policy_map_fn = config['multiagent']['policy_mapping_fn']
size = config['model']['lstm_cell_size']
for key in config['multiagent']['policies'].keys():
state_init[key] = [np.zeros(size, np.float32),
Expand Down
11 changes: 8 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,24 @@ path.py
joblib==0.10.3
python-dateutil==2.7.3
cached_property
cloudpickle==1.2.0
pyglet==1.3.2
matplotlib==3.1.0
imutils==0.5.1
numpydoc
ray==0.7.3
ray==0.8.0
opencv-python
dill
lz4
setproctitle
psutil
opencv-python
boto3==1.4.8
boto3==1.10.45
redis~=2.10.6
pandas==0.24.2
plotly==2.4.0
tabulate
tensorflow==1.15.2
awscli==1.16.309
torch==1.4.0
pytz
tensorboardX
Binary file modified tests/data/rllib_data/multi_agent/checkpoint_1/checkpoint-1
Binary file not shown.
Binary file not shown.
40 changes: 24 additions & 16 deletions tests/data/rllib_data/multi_agent/params.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,53 +8,59 @@
"on_sample_end": null,
"on_train_result": null
},
"clip_actions": false,
"clip_actions": true,
"clip_param": 0.3,
"clip_rewards": null,
"collect_metrics_timeout": 180,
"compress_observations": false,
"custom_resources_per_worker": {},
"eager": false,
"eager_tracing": false,
"entropy_coeff": 0.0,
"entropy_coeff_schedule": null,
"env": "MultiWaveAttenuationPOEnv-v0",
"env": "MultiAgentAccelPOEnv-v1",
"env_config": {
"flow_params": "{\n \"env\": {\n \"additional_params\": {\n \"max_accel\": 1,\n \"max_decel\": 1,\n \"ring_length\": [\n 230,\n 230\n ],\n \"target_velocity\": 4\n },\n \"clip_actions\": true,\n \"evaluate\": false,\n \"horizon\": 3000,\n \"sims_per_step\": 1,\n \"warmup_steps\": 750\n },\n \"env_name\": \"MultiWaveAttenuationPOEnv\",\n \"exp_tag\": \"lord_of_numrings1\",\n \"initial\": {\n \"additional_params\": {},\n \"bunching\": 20.0,\n \"edges_distribution\": \"all\",\n \"lanes_distribution\": Infinity,\n \"min_gap\": 0,\n \"perturbation\": 0.0,\n \"shuffle\": false,\n \"spacing\": \"custom\",\n \"x0\": 0\n },\n \"net\": {\n \"additional_params\": {\n \"lanes\": 1,\n \"length\": 230,\n \"num_rings\": 1,\n \"resolution\": 40,\n \"speed_limit\": 30\n },\n \"inflows\": {\n \"_InFlows__flows\": []\n },\n \"osm_path\": null,\n \"template\": null\n },\n \"network\": \"MultiRingNetwork\",\n \"sim\": {\n \"color_vehicles\": true,\n \"emission_path\": null,\n \"lateral_resolution\": null,\n \"no_step_log\": true,\n \"num_clients\": 1,\n \"overtake_right\": false,\n \"port\": null,\n \"print_warnings\": true,\n \"pxpm\": 2,\n \"render\": false,\n \"restart_instance\": false,\n \"save_render\": false,\n \"seed\": null,\n \"show_radius\": false,\n \"sight_radius\": 25,\n \"sim_step\": 0.1,\n \"teleport_time\": -1\n },\n \"simulator\": \"traci\",\n \"veh\": [\n {\n \"acceleration_controller\": [\n \"IDMController\",\n {\n \"noise\": 0.2\n }\n ],\n \"car_following_params\": {\n \"controller_params\": {\n \"accel\": 2.6,\n \"carFollowModel\": \"IDM\",\n \"decel\": 4.5,\n \"impatience\": 0.5,\n \"maxSpeed\": 30,\n \"minGap\": 2.5,\n \"sigma\": 0.5,\n \"speedDev\": 0.1,\n \"speedFactor\": 1.0,\n \"tau\": 1.0\n },\n \"speed_mode\": 25\n },\n \"initial_speed\": 0,\n \"lane_change_controller\": [\n \"SimLaneChangeController\",\n {}\n ],\n \"lane_change_params\": {\n \"controller_params\": {\n \"laneChangeModel\": \"LC2013\",\n \"lcCooperative\": \"1.0\",\n \"lcKeepRight\": \"1.0\",\n \"lcSpeedGain\": \"1.0\",\n \"lcStrategic\": \"1.0\"\n },\n \"lane_change_mode\": 512\n },\n \"num_vehicles\": 21,\n \"routing_controller\": [\n \"ContinuousRouter\",\n {}\n ],\n \"veh_id\": \"human_0\"\n },\n {\n \"acceleration_controller\": [\n \"RLController\",\n {}\n ],\n \"car_following_params\": {\n \"controller_params\": {\n \"accel\": 2.6,\n \"carFollowModel\": \"IDM\",\n \"decel\": 4.5,\n \"impatience\": 0.5,\n \"maxSpeed\": 30,\n \"minGap\": 2.5,\n \"sigma\": 0.5,\n \"speedDev\": 0.1,\n \"speedFactor\": 1.0,\n \"tau\": 1.0\n },\n \"speed_mode\": 25\n },\n \"initial_speed\": 0,\n \"lane_change_controller\": [\n \"SimLaneChangeController\",\n {}\n ],\n \"lane_change_params\": {\n \"controller_params\": {\n \"laneChangeModel\": \"LC2013\",\n \"lcCooperative\": \"1.0\",\n \"lcKeepRight\": \"1.0\",\n \"lcSpeedGain\": \"1.0\",\n \"lcStrategic\": \"1.0\"\n },\n \"lane_change_mode\": 512\n },\n \"num_vehicles\": 1,\n \"routing_controller\": [\n \"ContinuousRouter\",\n {}\n ],\n \"veh_id\": \"rl_0\"\n }\n ]\n}",
"flow_params": "{\n \"env\": {\n \"additional_params\": {\n \"max_accel\": 3,\n \"max_decel\": 3,\n \"sort_vehicles\": false,\n \"target_velocity\": 20\n },\n \"clip_actions\": true,\n \"evaluate\": false,\n \"horizon\": 1500,\n \"sims_per_step\": 1,\n \"warmup_steps\": 0\n },\n \"env_name\": \"flow.envs.multiagent.ring.accel.MultiAgentAccelPOEnv\",\n \"exp_tag\": \"multiagent_figure_eight\",\n \"initial\": {\n \"additional_params\": {},\n \"bunching\": 0,\n \"edges_distribution\": \"all\",\n \"lanes_distribution\": Infinity,\n \"min_gap\": 0,\n \"perturbation\": 0.0,\n \"shuffle\": false,\n \"spacing\": \"uniform\",\n \"x0\": 0\n },\n \"net\": {\n \"additional_params\": {\n \"lanes\": 1,\n \"radius_ring\": 30,\n \"resolution\": 40,\n \"speed_limit\": 30\n },\n \"inflows\": {\n \"_InFlows__flows\": []\n },\n \"osm_path\": null,\n \"template\": null\n },\n \"network\": \"flow.networks.figure_eight.FigureEightNetwork\",\n \"sim\": {\n \"color_by_speed\": false,\n \"emission_path\": null,\n \"force_color_update\": false,\n \"lateral_resolution\": null,\n \"no_step_log\": true,\n \"num_clients\": 1,\n \"overtake_right\": false,\n \"port\": null,\n \"print_warnings\": true,\n \"pxpm\": 2,\n \"render\": false,\n \"restart_instance\": false,\n \"save_render\": false,\n \"seed\": null,\n \"show_radius\": false,\n \"sight_radius\": 25,\n \"sim_step\": 0.1,\n \"teleport_time\": -1,\n \"use_ballistic\": false\n },\n \"simulator\": \"traci\",\n \"veh\": [\n {\n \"acceleration_controller\": [\n \"IDMController\",\n {\n \"noise\": 0.2\n }\n ],\n \"car_following_params\": {\n \"controller_params\": {\n \"accel\": 2.6,\n \"carFollowModel\": \"IDM\",\n \"decel\": 1.5,\n \"impatience\": 0.5,\n \"maxSpeed\": 30,\n \"minGap\": 2.5,\n \"sigma\": 0.5,\n \"speedDev\": 0.1,\n \"speedFactor\": 1.0,\n \"tau\": 1.0\n },\n \"speed_mode\": 1\n },\n \"initial_speed\": 0,\n \"lane_change_controller\": [\n \"SimLaneChangeController\",\n {}\n ],\n \"lane_change_params\": {\n \"controller_params\": {\n \"laneChangeModel\": \"LC2013\",\n \"lcCooperative\": \"1.0\",\n \"lcKeepRight\": \"1.0\",\n \"lcSpeedGain\": \"1.0\",\n \"lcStrategic\": \"1.0\"\n },\n \"lane_change_mode\": 512\n },\n \"num_vehicles\": 6,\n \"routing_controller\": [\n \"ContinuousRouter\",\n {}\n ],\n \"veh_id\": \"human_0\"\n },\n {\n \"acceleration_controller\": [\n \"RLController\",\n {}\n ],\n \"car_following_params\": {\n \"controller_params\": {\n \"accel\": 3,\n \"carFollowModel\": \"IDM\",\n \"decel\": 3,\n \"impatience\": 0.5,\n \"maxSpeed\": 30,\n \"minGap\": 2.5,\n \"sigma\": 0.5,\n \"speedDev\": 0.1,\n \"speedFactor\": 1.0,\n \"tau\": 1.0\n },\n \"speed_mode\": 1\n },\n \"initial_speed\": 0,\n \"lane_change_controller\": [\n \"SimLaneChangeController\",\n {}\n ],\n \"lane_change_params\": {\n \"controller_params\": {\n \"laneChangeModel\": \"LC2013\",\n \"lcCooperative\": \"1.0\",\n \"lcKeepRight\": \"1.0\",\n \"lcSpeedGain\": \"1.0\",\n \"lcStrategic\": \"1.0\"\n },\n \"lane_change_mode\": 512\n },\n \"num_vehicles\": 1,\n \"routing_controller\": [\n \"ContinuousRouter\",\n {}\n ],\n \"veh_id\": \"rl_0\"\n },\n {\n \"acceleration_controller\": [\n \"IDMController\",\n {\n \"noise\": 0.2\n }\n ],\n \"car_following_params\": {\n \"controller_params\": {\n \"accel\": 2.6,\n \"carFollowModel\": \"IDM\",\n \"decel\": 1.5,\n \"impatience\": 0.5,\n \"maxSpeed\": 30,\n \"minGap\": 2.5,\n \"sigma\": 0.5,\n \"speedDev\": 0.1,\n \"speedFactor\": 1.0,\n \"tau\": 1.0\n },\n \"speed_mode\": 1\n },\n \"initial_speed\": 0,\n \"lane_change_controller\": [\n \"SimLaneChangeController\",\n {}\n ],\n \"lane_change_params\": {\n \"controller_params\": {\n \"laneChangeModel\": \"LC2013\",\n \"lcCooperative\": \"1.0\",\n \"lcKeepRight\": \"1.0\",\n \"lcSpeedGain\": \"1.0\",\n \"lcStrategic\": \"1.0\"\n },\n \"lane_change_mode\": 512\n },\n \"num_vehicles\": 6,\n \"routing_controller\": [\n \"ContinuousRouter\",\n {}\n ],\n \"veh_id\": \"human_1\"\n },\n {\n \"acceleration_controller\": [\n \"RLController\",\n {}\n ],\n \"car_following_params\": {\n \"controller_params\": {\n \"accel\": 3,\n \"carFollowModel\": \"IDM\",\n \"decel\": 3,\n \"impatience\": 0.5,\n \"maxSpeed\": 30,\n \"minGap\": 2.5,\n \"sigma\": 0.5,\n \"speedDev\": 0.1,\n \"speedFactor\": 1.0,\n \"tau\": 1.0\n },\n \"speed_mode\": 1\n },\n \"initial_speed\": 0,\n \"lane_change_controller\": [\n \"SimLaneChangeController\",\n {}\n ],\n \"lane_change_params\": {\n \"controller_params\": {\n \"laneChangeModel\": \"LC2013\",\n \"lcCooperative\": \"1.0\",\n \"lcKeepRight\": \"1.0\",\n \"lcSpeedGain\": \"1.0\",\n \"lcStrategic\": \"1.0\"\n },\n \"lane_change_mode\": 512\n },\n \"num_vehicles\": 1,\n \"routing_controller\": [\n \"ContinuousRouter\",\n {}\n ],\n \"veh_id\": \"rl_1\"\n }\n ]\n}",
"run": "PPO"
},
"evaluation_config": {},
"evaluation_interval": null,
"evaluation_num_episodes": 10,
"gamma": 0.999,
"grad_clip": null,
"horizon": 3000,
"horizon": 1500,
"ignore_worker_failures": false,
"input": "sampler",
"input_evaluation": [
"is",
"wis"
],
"kl_coeff": 0.2,
"kl_target": 0.01,
"lambda": 1.0,
"kl_target": 0.02,
"lambda": 0.97,
"local_tf_session_args": {
"inter_op_parallelism_threads": 8,
"intra_op_parallelism_threads": 8
},
"log_level": "INFO",
"log_level": "WARN",
"log_sys_usage": true,
"lr": 1e-05,
"lr": 5e-05,
"lr_schedule": null,
"memory": 0,
"memory_per_worker": 0,
"metrics_smoothing_episodes": 100,
"min_iter_time_s": 0,
"model": {
"conv_activation": "relu",
"conv_filters": null,
"custom_action_dist": null,
"custom_model": null,
"custom_options": {},
"custom_preprocessor": null,
"dim": 84,
"fcnet_activation": "tanh",
"fcnet_hiddens": [
32,
32,
32
],
Expand All @@ -75,23 +81,25 @@
"policies": {
"av": [
"<class 'ray.rllib.policy.tf_policy_template.PPOTFPolicy'>",
"Box(3,)",
"Box(6,)",
"Box(1,)",
{}
]
},
"policies_to_train": [
"av"
],
"policy_mapping_fn": "tune.function(<function setup_exps.<locals>.policy_mapping_fn at 0x7fda132e6c80>)"
"policies_to_train": null,
"policy_mapping_fn": "<function policy_mapping_fn at 0x147740598>"
},
"no_done_at_end": false,
"no_eager_on_workers": false,
"num_cpus_for_driver": 1,
"num_cpus_per_worker": 1,
"num_envs_per_worker": 1,
"num_gpus": 0,
"num_gpus_per_worker": 0,
"num_sgd_iter": 30,
"num_sgd_iter": 10,
"num_workers": 2,
"object_store_memory": 0,
"object_store_memory_per_worker": 0,
"observation_filter": "NoFilter",
"optimizer": {},
"output": null,
Expand All @@ -110,7 +118,7 @@
"sgd_minibatch_size": 128,
"shuffle_buffer_size": 0,
"shuffle_sequences": true,
"simple_optimizer": true,
"simple_optimizer": false,
"soft_horizon": false,
"synchronize_filters": true,
"tf_session_args": {
Expand All @@ -126,7 +134,7 @@
"log_device_placement": false
},
"timesteps_per_iteration": 0,
"train_batch_size": 60000,
"train_batch_size": 30000,
"use_gae": true,
"vf_clip_param": 10.0,
"vf_loss_coeff": 1.0,
Expand Down
Binary file modified tests/data/rllib_data/multi_agent/params.pkl
Binary file not shown.
Binary file modified tests/data/rllib_data/single_agent/checkpoint_1/checkpoint-1
Binary file not shown.
Binary file not shown.
Loading