World_cityflow module

used to describe the cityflow world information

class World_cityflow.Intersection(intersection, world)

Bases: object

Intersection Class is mainly used for describing crossing information and defining acting methods

insert_road(road, out)

It’s used to append a road into self.road meanwhile, add the corresponding direction with the added road

Parameters
  • road – newly added road

  • out – newly added out

Returns

empty

reset()

The function is to reset current_phase, tl_phase, current_phase_time, action_before_yellow and action_executed :return:

sort_roads(RIGHT)

To sort roads information by arranging an order :param RIGHT: :return:

step(action, interval)

step is to take relative actions according to interval :param action: the changes to take :param interval: the non-acting time slice

Returns

class World_cityflow.World(cityflow_config, thread_num)

Bases: object

Create a CityFlow engine and maintain informations about CityFlow world

get_average_travel_time()
Returns

get_cur_phase()
get_cur_throughput()
get_executed_action()
get_history_vehicles()
get_info(info)
Parameters

info

get_lane_delay()
get_lane_queue_length()
Returns

get_lane_waiting_time_count()
get_pressure()
get_vehicle_lane()
get_vehicle_trajectory()
get_vehicle_waiting_time()
reset()

reset the engine

reset_vehicle_info()

reset vehicle infos,including waiting_time, trajectory,etc :return:

step(actions=None)

step: to take one time action :param actions: :return:

subscribe(fns)
Parameters

fns

update_current_measurements()