Added simulation files.

This commit is contained in:
cheezedoodle2
2023-04-03 23:19:16 -07:00
parent b7d548800e
commit 0f10f22345
5 changed files with 109 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
from abc import ABC, abstractmethod
class Simulation(ABC):
@abstractmethod
def start(self):
"Start the simulated object."
pass
@abstractmethod
def tick(self) -> bool:
"""
Simulate one clock tick.
Returns:
bool: True if the simulation could advance one clock tick, or False if the object is expired.
"""
pass
@abstractmethod
def use(self, *args, **kwargs):
"""
Use the simulated object.
Args:
args (tuple): A tuple of arguments.
kwargs (dict): A dictionary of key-value pairs of arguments.
"""
pass
@abstractmethod
def stop(self):
"Stop the simulated object."
pass