From 12ae02e1bd811c644d9fe71ee53fa658128fe306 Mon Sep 17 00:00:00 2001 From: Jarrod Pas <j.pas@usask.ca> Date: Thu, 20 Jul 2017 17:11:32 -0600 Subject: [PATCH] Adds tick event function to TickProcess --- pydyton/core.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pydyton/core.py b/pydyton/core.py index 33d06bb..430ddaa 100644 --- a/pydyton/core.py +++ b/pydyton/core.py @@ -9,6 +9,7 @@ class Process: def process(self, *args): raise NotImplementedError + yield None class TickProcess(Process): @@ -16,6 +17,9 @@ class TickProcess(Process): super().__init__() if tick < 1: raise ValueError('tick must be greatert than or equal to 1') - self.tick = tick + self.__tick = tick + + def tick(self): + return self.env.timeout(self.__tick) -- GitLab