def start(self): assert self.simulation event_seq = [] for delay,gen in self.input_sequence: event_seq.append(FunctionEvent(self.simulation.convert_to_time_type(delay),self.set_input_generator,gen)) event_seq.append(FunctionEvent(0,self.generate)) now = self.simulation.time() self.event = PeriodicEventSequence(now+self.simulation.convert_to_time_type(self.phase),self.simulation.convert_to_time_type(self.period),event_seq) self.simulation.enqueue_event(self.event)
def start(self): assert self.simulation if self.period > 0: # if it has a positive period, then schedule a repeating event to trigger it e=FunctionEvent(0,self.generate) now = self.simulation.time() self.simulation.enqueue_event(PeriodicEventSequence(now+self.simulation.convert_to_time_type(self.phase),self.simulation.convert_to_time_type(self.period),[e]))
def start(self): super(ShiftingGeneratorSheet, self).start() if self.fixation_jitter_period > 0: now = self.simulation.time() refix_event = PeriodicEventSequence( now + self.simulation.convert_to_time_type( self.fixation_jitter_period), self.simulation.convert_to_time_type( self.fixation_jitter_period), [FunctionEvent(0, self.refixate)]) self.simulation.enqueue_event(refix_event)