def hh_separation(self): while True: try: self.travel_dist = self.initial_hh_sep / (math.sqrt(1 - (returns_to_date(self, "%")))) except ZeroDivisionError: self.travel_dist = 0 yield self.env.timeout(24)
def phone_call(self): self.output_data['Call'].append(call(self.rep.reps, self.district.input_data["LA"], self.digital, self.hh_type, self.env.now)) self.calls += 1 if (not self.digital and not self.paper_allowed and h.returns_to_date(self.district) < self.district.input_data['paper_trigger'] and h.str2bool(self.input_data['paper_on_request'])): # so provide paper if the conditions are met... self.paper_allowed = True censusv2.schedule_paper_drop(self, self, False) yield self.env.timeout(0) else: yield self.env.process(self.phone_call_connect())