diff options
Diffstat (limited to 'simulator/__init__.py')
| -rw-r--r-- | simulator/__init__.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/simulator/__init__.py b/simulator/__init__.py index 3924499..e81ae9a 100644 --- a/simulator/__init__.py +++ b/simulator/__init__.py @@ -89,16 +89,14 @@ class DummyOven: self.cool = None def step(self): + rate = -2 if self.heat is not None: - targets = [350, 350, 100] - rate = 12 * self.heat - elif self.cool is not None: - rate = -8 * self.cool - else: - rate = -4 + rate += 12 * self.heat + if self.cool is not None: + rate -= 8 * self.cool for i, temp in enumerate(self.temps): - mult = random.uniform(0.7, 1) if i < 2 else 0.01 + mult = random.uniform(0.5, 1) if i < 2 else 0.05 temp = temp + rate * mult self.temps[i] = max(24, min(temp, 350)) |
