def reset(self): data_instance = Data.init_from_config_dic(config_dict) self.model = Model(data_instance) self.T = WARMUP_TIME_SECONDS # run the warm up period for t in range(self.T, self.T + 3600, INT_ASSIGN): self.model.dispatch_at_time(t) self.T = ANALYSIS_TIME_SECONDS print("##########################") print("##########################") print("End of the warm up time ") print("##########################") print("##########################")
import numpy as np from lib.Data import Data from lib.configs import config_dict from lib.utils import Model from lib.Constants import POLICY_UPDATE_INTERVAL, WARMUP_TIME_SECONDS, T_TOTAL_SECONDS, INT_ASSIGN, \ ANALYSIS_TIME_SECONDS, DEMAND_UPDATE_INTERVAL import time data_instance = Data.init_from_config_dic(config_dict) m = Model(data_instance) print('Fleet size is {f}'.format(f=data_instance.FLEET_SIZE)) stime = time.time() # # dispatch the system for T_TOTAL seconds, at the interval of INT_ASSIGN for T in range(data_instance.WARMUP_TIME_SECONDS, data_instance.T_TOTAL_SECONDS, data_instance.INT_ASSIGN): m.dispatch_at_time(T) # end time etime = time.time() # run time of this simulation runtime = etime - stime print("The run time was {runtime} minutes ".format(runtime=runtime / 60)) m.save_zonal_stats("../performance_stats/")