84e1ff2cbd32ab4a11c0b0356cbf89fe132b5bd8,examples/sumo/two_loops_merge_straight.py,,two_loops_merge_straight_example,#Any#,20
Before Change
def two_loops_merge_straight_example(sumo_binary=None):
logging.basicConfig(level=logging.INFO)
sumo_params = SumoParams(sim_step=0.1, emission_path="./data/",
sumo_binary="sumo-gui")
if sumo_binary is not None:
sumo_params.sumo_binary = sumo_binary
// note that the vehicles are added sequentially by the generator,
// so place the merging vehicles after the vehicles in the ring
vehicles = Vehicles()
vehicles.add(veh_id="idm",
acceleration_controller=(IDMController, {}),
lane_change_controller=(SumoLaneChangeController, {}),
routing_controller=(ContinuousRouter, {}),
num_vehicles=7,
sumo_car_following_params=SumoCarFollowingParams(
minGap=0.0, tau=0.5),
sumo_lc_params=SumoLaneChangeParams())
vehicles.add(veh_id="merge-idm",
acceleration_controller=(IDMController, {}),
lane_change_controller=(SumoLaneChangeController, {}),
routing_controller=(ContinuousRouter, {}),
num_vehicles=7,
sumo_car_following_params=SumoCarFollowingParams(
minGap=0.01, tau=0.5),
sumo_lc_params=SumoLaneChangeParams())
additional_env_params = {"target_velocity": 20}
env_params = EnvParams(additional_params=additional_env_params)
additional_net_params = ADDITIONAL_NET_PARAMS.copy()
additional_net_params["ring_radius"] = 75
additional_net_params["inner_lanes"] = 1
additional_net_params["outer_lanes"] = 1
additional_net_params["lane_length"] = 75
net_params = NetParams(
no_internal_links=False,
additional_params=additional_net_params
)
initial_config = InitialConfig(
x0=50,
spacing="custom",
additional_params={"merge_bunching": 0}
)
scenario = TwoLoopsOneMergingScenario(
name="two-loop-one-merging",
generator_class=TwoLoopOneMergingGenerator,
vehicles=vehicles,
net_params=net_params,
initial_config=initial_config
)
env = TwoLoopsMergeEnv(env_params, sumo_params, scenario)
exp = SumoExperiment(env, scenario)
logging.info("Experiment Set Up complete")
return exp
After Change
env = AccelEnv(env_params, sumo_params, scenario)
return SumoExperiment(env, scenario)
if __name__ == "__main__":
// import the experiment variable
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances
Project Name: flow-project/flow
Commit Name: 84e1ff2cbd32ab4a11c0b0356cbf89fe132b5bd8
Time: 2018-04-29
Author: akreidieh@gmail.com
File Name: examples/sumo/two_loops_merge_straight.py
Class Name:
Method Name: two_loops_merge_straight_example
Project Name: flow-project/flow
Commit Name: 84e1ff2cbd32ab4a11c0b0356cbf89fe132b5bd8
Time: 2018-04-29
Author: akreidieh@gmail.com
File Name: examples/sumo/sugiyama.py
Class Name:
Method Name: sugiyama_example
Project Name: flow-project/flow
Commit Name: 84e1ff2cbd32ab4a11c0b0356cbf89fe132b5bd8
Time: 2018-04-29
Author: akreidieh@gmail.com
File Name: examples/sumo/highway.py
Class Name:
Method Name: highway_example
Project Name: flow-project/flow
Commit Name: 229ea0173f96c6ffd3db8b3a18067b8636f005c4
Time: 2018-04-20
Author: akreidieh@gmail.com
File Name: examples/sumo/figure_eight.py
Class Name:
Method Name: figure_eight_example