def update_pos(self, simul_clock): if self.start_time <= simul_clock < self.ar_time: self.isVisible = True self.px = self.start_px self.py = self.start_py + calc_proportional_pos(self.start_py, self.anchored_py, self.start_time, self.ar_time, simul_clock) elif self.ar_time <= simul_clock < self.dp_time: self.px, self.py = self.anchored_px, self.anchored_py elif self.dp_time <= simul_clock < self.end_time: self.px = self.anchored_px self.py = self.anchored_py + calc_proportional_pos(self.anchored_py, self.end_py, self.dp_time, self.end_time, simul_clock) elif self.end_time: self.isVisible = False
def update_pos(self, simul_clock): if self.pe_time <= simul_clock < self.tro_ms_time: #straddler moving self.py = self.pe_py + calc_proportional_pos(self.pe_py, self.tg_py, self.pe_time, self.tro_ms_time, simul_clock) elif self.tro_ms_time <= simul_clock < self.tro_mf_time: self.py = self.tg_py #trolly moving self.trolly.px = self.trolly.pe_px + calc_proportional_pos(self.trolly.pe_px, self.trolly.tg_px, self.tro_ms_time, self.tro_mf_time, simul_clock) elif self.tro_mf_time <= simul_clock < self.tg_time: self.py = self.tg_py self.trolly.px = self.trolly.tg_px if self.tg_time <= simul_clock: self.trolly.px = self.trolly.pe_px = self.trolly.tg_px self.pe_time, self.pe_py = self.tg_time, self.tg_py if self.evt_start: self.evt_start = False
def set_evt_data(self, target_evt_id, simul_clock): self.set_start_evt_date() self.set_anchor_evt_date() self.set_end_evt_date() if self.start_time and simul_clock <= self.start_time: self.px, self.py = 0, 0 elif self.ar_time and self.start_time <= simul_clock < self.ar_time: self.isVisible = True self.px = self.start_px self.py = self.start_py + calc_proportional_pos(self.start_py, self.anchored_py, self.start_time, self.ar_time, simul_clock) elif self.ar_time and self.ar_time <= simul_clock < self.dp_time: self.isVisible = True self.px, self.py = self.anchored_px, self.anchored_py elif self.end_time and self.dp_time <= simul_clock < self.end_time: self.isVisible = True self.px = self.anchored_px self.py = self.anchored_py + calc_proportional_pos(self.anchored_py, self.end_py, self.dp_time, self.end_time, simul_clock) elif self.end_time and self.end_time <= simul_clock: self.isVisible = False self.px, self.py = 0, 0 else: assert False
def update_pos(self, simul_clock): if self.target_evt_id == 0: if self.tg_container in self.target_qb.holding_containers: self.tg_px = self.target_qb.holding_containers[self.tg_container].px if self.pe_time <= simul_clock < self.tg_time: self.px = self.pe_px + calc_proportional_pos(self.pe_px, self.tg_px, self.pe_time, self.tg_time, simul_clock) else: if self.ss_ls: if self.pe_time <= simul_clock < self.waypoint1_time: self.px = self.pe_px + calc_proportional_pos(self.pe_px, self.wp1_px, self.pe_time, self.waypoint1_time, simul_clock) self.py = self.pe_py elif self.waypoint1_time <= simul_clock < self.waypoint2_time: self.thr_wp1 = True self.px = self.wp1_px self.py = self.wp1_py + calc_proportional_pos(self.wp1_py, self.wp2_py, self.waypoint1_time, self.waypoint2_time, simul_clock) elif self.waypoint2_time <= simul_clock < self.waypoint3_time: self.thr_wp1 = False self.thr_wp2 = True self.px = self.wp2_px + calc_proportional_pos(self.wp2_px, self.wp3_px, self.waypoint2_time, self.waypoint3_time, simul_clock) self.py = self.wp2_py elif self.waypoint3_time <= simul_clock < self.tg_time: self.thr_wp2 = False self.thr_wp3 = True self.px = self.wp3_px self.py = self.wp3_py + calc_proportional_pos(self.wp3_py, self.tg_py, self.waypoint3_time, self.tg_time, simul_clock) elif self.ls_ss: if self.tg_container in self.target_qb.holding_containers: self.tg_px = self.target_qb.holding_containers[self.tg_container].px if self.pe_time <= simul_clock < self.waypoint1_time: self.px = self.pe_px self.py = self.pe_py + calc_proportional_pos(self.pe_py, self.wp1_py, self.pe_time, self.waypoint1_time, simul_clock) elif self.waypoint1_time <= simul_clock < self.waypoint2_time: self.thr_wp1 = True self.px = self.wp1_px + calc_proportional_pos(self.wp1_px, self.wp2_px, self.waypoint1_time, self.waypoint2_time, simul_clock) self.py = self.wp1_py elif self.waypoint2_time <= simul_clock < self.waypoint3_time: self.thr_wp1 = False self.thr_wp2 = True self.px = self.wp2_px self.py = self.wp2_py + calc_proportional_pos(self.wp2_py, self.wp3_py, self.waypoint2_time, self.waypoint3_time, simul_clock) elif self.waypoint3_time <= simul_clock < self.tg_time: self.thr_wp2 = False self.thr_wp3 = True self.px = self.wp3_px + calc_proportional_pos(self.wp3_px, self.tg_px, self.waypoint3_time, self.tg_time, simul_clock) self.py = self.wp3_py elif self.ls_ls: if self.pe_time <= simul_clock < self.waypoint1_time: self.px = self.pe_px self.py = self.pe_py + calc_proportional_pos(self.pe_py, self.wp1_py, self.pe_time, self.waypoint1_time, simul_clock) elif self.waypoint1_time <= simul_clock < self.waypoint2_time: self.thr_wp1 = True self.px = self.wp1_px + calc_proportional_pos(self.wp1_px, self.wp2_px, self.waypoint1_time, self.waypoint2_time, simul_clock) self.py = self.wp1_py elif self.waypoint2_time <= simul_clock < self.tg_time: self.thr_wp1 = False self.thr_wp2 = True self.px = self.wp2_px self.py = self.wp2_py + calc_proportional_pos(self.wp2_py, self.tg_py, self.waypoint2_time, self.tg_time, simul_clock) elif self.ss_ss: self.px = self.pe_px + calc_proportional_pos(self.pe_px, self.tg_px, self.pe_time, self.tg_time, simul_clock) if self.tg_time <= simul_clock: self.pe_time = self.tg_time self.pe_px, self.pe_py = self.px, self.py = self.tg_px, self.tg_py if self.evt_start: self.evt_start = False