World_sumo module

used to describe the sumo world information

class World_sumo.Intersection(id, world, phases)

Bases: object

Intersection Class is mainly used for describing crossing information

and defining acting methods

get_current_phase()
Returns

observe(step_length, distance)
Parameters
  • step_length

  • distance

Returns

prep_phase(new_phase)
Parameters

new_phase

Returns

pseudo_step(action)
Parameters

action

Returns

reset()
Returns

class World_sumo.World(sumo_config, placeholder=0)

Bases: object

World Class to describe the agent’s environment

generate_valid_phase()
Returns

get_average_travel_time()
Returns

[real travel time, planned travel time(aligned with Cityflow)]

get_cur_phase()
Returns

get_cur_throughput()
Returns

get_current_time()
Returns

get_info(info)
Parameters

info

Returns

get_lane_delay()
Returns

get_lane_queue_length()
Returns

get_lane_vehicle_count()
Returns

get_lane_vehicles()
Returns

get_lane_waiting_time_count()
Returns

get_lane_waiting_vehicle_count()
Returns

get_plan_depart_time()

Get planned depart time for all vehicles appeared in sumo.rou.xml file. In SUMO and Cityflow, travel time = arriving time-planned depart time. Note: Not real depart time, but planned depart time. return: planned depart time of all vehicles.

get_pressure()
get_vehicles()
Returns

reset()
Returns

step(action=None)
Parameters

action

Returns

step_sim()
Returns

subscribe(fns)
Parameters

fns

Returns

World_sumo.create_yellows(phases, yellow_length)
Parameters
  • phases

  • yellow_length

Returns