intersection_phase module

class intersection_phase.IntersectionPhaseGenerator(world, I, fns='phase', targets='cur_phase', negative=False)

Bases: object

Generate State or Reward based on statistics of intersection vehicles.

Parameters
  • world (World object) –

  • I (Intersection object) –

  • fns (list of statistics to get, "phase" is needed for result "cur_phase") –

  • targets (list of results to return, currently support "cur_phase": current phase of the intersection (not before yellow phase)) – See section 4.2 of the intelliLight paper[Hua Wei et al, KDD’18] for more detailed description on these targets.

  • negative (boolean, whether return negative values (mostly for Reward)) –

  • time_interval (use to calculate) –

generate()