Skip to content

Commit a4c7d67

Browse files
YasharzfAboudyKreidieh
authored andcommitted
get not departed vehicles (#922)
* added function to kernel/vehicle to get number of not departed vehiles * fixed over indentation of the docstring * indentation edit * pep8 Co-authored-by: AboudyKreidieh <akreidieh@gmail.com>
1 parent 1111e9a commit a4c7d67

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

flow/core/kernel/vehicle/traci.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ def update(self, reset):
225225
self.num_not_departed += sim_obs[tc.VAR_LOADED_VEHICLES_NUMBER] - \
226226
sim_obs[tc.VAR_DEPARTED_VEHICLES_NUMBER]
227227

228+
# update the number of not departed vehicles
229+
self.num_not_departed += sim_obs[tc.VAR_LOADED_VEHICLES_NUMBER] - \
230+
sim_obs[tc.VAR_DEPARTED_VEHICLES_NUMBER]
231+
228232
# update the "headway", "leader", and "follower" variables
229233
for veh_id in self.__ids:
230234
try:
@@ -552,6 +556,10 @@ def get_num_not_departed(self):
552556
"""See parent class."""
553557
return self.num_not_departed
554558

559+
def get_num_not_departed(self):
560+
"""See parent class."""
561+
return self.num_not_departed
562+
555563
def get_previous_speed(self, veh_id, error=-1001):
556564
"""See parent class."""
557565
if isinstance(veh_id, (list, np.ndarray)):

0 commit comments

Comments
 (0)