flatland.envs.timetable_generators module

flatland.envs.timetable_generators module#

Timetable generators: Railway Undertaking (RU) / Eisenbahnverkehrsunternehmen (EVU).

flatland.envs.timetable_generators.len_handle_none(v)[source]#
flatland.envs.timetable_generators.timetable_generator(agents: List[EnvAgent], distance_map: DistanceMap, agents_hints: dict, np_random: RandomState | None = None) Timetable[source]#

Calculates earliest departure and latest arrival times for the agents This is the new addition in Flatland 3 Also calculates the max episodes steps based on the density of the timetable

inputs:

agents - List of all the agents rail_env.agents distance_map - Distance map of positions to targets of each agent in each direction agent_hints - Uses the number of cities np_random - RNG state for seeding

returns:

Timetable with the latest_arrivals, earliest_departures and max_episdode_steps

flatland.envs.timetable_generators.ttgen_flatland2(agents: List[EnvAgent], distance_map: DistanceMap, agents_hints: dict, np_random: RandomState | None = None) Timetable[source]#