786960b3ac9c0b3e75a8319649d1987194844d46,flow/envs/green_wave_env.py,TrafficLightGridEnv,k_closest_to_intersection,#TrafficLightGridEnv#Any#Any#,377
Before Change
intersection or not. Does no padding
if k < 0:
raise IndexError("k must be greater than 0")
dists = []
def sort_lambda(veh_id):
return self.get_distance_to_intersection(veh_id)
After Change
"parameter k={}, but k should be non-negative"
.format(k))
if isinstance(edges, list):
return [k_closest_to_intersection(edge, k) for edge in edges]
// get the ids of all the vehicles on the edge "edges" order by
// increasing distance to intersection
veh_ids_ordered = sorted(
self.k.vehicle.get_ids_by_edge(edges),
key=self.get_distance_to_intersection)
// return the ids of the k vehicles closest to the intersection
return veh_ids_ordered[:k]
class PO_TrafficLightGridEnv(TrafficLightGridEnv):
Environment used to train traffic lights to regulate traffic flow
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: flow-project/flow
Commit Name: 786960b3ac9c0b3e75a8319649d1987194844d46
Time: 2019-07-01
Author: nathanlct@icloud.com
File Name: flow/envs/green_wave_env.py
Class Name: TrafficLightGridEnv
Method Name: k_closest_to_intersection
Project Name: prody/ProDy
Commit Name: fa926b8278a3b635d929e0fe6c63ac2a8983a406
Time: 2012-12-15
Author: lordnapi@gmail.com
File Name: lib/prody/dynamics/nma.py
Class Name: NMA
Method Name: __getitem__
Project Name: tgsmith61591/pmdarima
Commit Name: ea36b28c92b4f5f8314707051ee936fd2393bfd5
Time: 2019-11-25
Author: tgsmith61591@gmail.com
File Name: pmdarima/utils/array.py
Class Name:
Method Name: diff_inv