File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ def wrap_up_servers(self, current_time):
444444 for srvr in self .servers :
445445 srvr .total_time = self .increment_time (current_time , - srvr .start_date )
446446 if srvr .busy :
447- srvr .busy_time += self .increment_time (current_time , - srvr .cust .arrival_date )
447+ srvr .busy_time += self .increment_time (current_time , - srvr .cust .service_start_date )
448448
449449
450450 def write_individual_record (self , individual ):
Original file line number Diff line number Diff line change @@ -637,6 +637,18 @@ def test_server_utilisation_with_schedules(self):
637637 recs = Q .get_all_records ()
638638 self .assertEqual (Q .transitive_nodes [0 ].server_utilisation , 21.0 / 37.0 )
639639
640+ def test_server_utilisation_with_wrapup (self ):
641+ N = ciw .create_network (
642+ Arrival_distributions = [['Exponential' ,7.14 ]],
643+ Service_distributions = [['Exponential' ,0.04 ]],
644+ Number_of_servers = [70 ]
645+ )
646+ ciw .seed (1 )
647+ Q = ciw .Simulation (N )
648+ Q .simulate_until_max_time (168 )
649+ for srvr in Q .transitive_nodes [0 ].servers :
650+ self .assertGreaterEqual (srvr .total_time , srvr .busy_time )
651+
640652 def test_num_inds_equal_len_all_inds (self ):
641653 # Create a Simulatin class that inherits form ciw.Simulation so that
642654 # an assertion than number_of_individuals == len(all_individuals)
You can’t perform that action at this time.
0 commit comments