diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..61f2dc9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +**/__pycache__/ diff --git a/Assignment-2/DCR_graph.py b/Assignment-2/DCR_graph.py index ad3a8a5..f58ee27 100644 --- a/Assignment-2/DCR_graph.py +++ b/Assignment-2/DCR_graph.py @@ -11,7 +11,6 @@ def listify(element): class Event(): def __init__(self, _id:str, name:str, id_dict:dict, parent:Process=None) -> None: self._id = _id - id_dict[_id] = self self.name = name.lower() self.pending = False self.executed = False @@ -20,6 +19,8 @@ class Event(): self.relations_from : list[Relationship] = [] self.parent = parent + id_dict[_id] = self + def execute(self): self.executed = True self.pending = False @@ -123,7 +124,7 @@ class Relationship(): def execute(self): if self.type == RelationsshipType.condition: - pass # does nothing + pass # does nothing (Since the source is executed as well) elif self.type == RelationsshipType.response: self.target.pending = True elif self.type == RelationsshipType.coresponse: @@ -133,13 +134,13 @@ class Relationship(): elif self.type == RelationsshipType.include: self.target.included = True elif self.type == RelationsshipType.milestone: - pass # does nothing + pass # does nothing (Since the source is executed as well) elif self.type == RelationsshipType.update: - pass + pass # Don't know what this one does elif self.type == RelationsshipType.spawn: - pass + pass # Don't know what this one does elif self.type == RelationsshipType.templateSpawn: - pass + pass # Don't know what this one does class Graph(): def __init__(self, process:Process, relationships:list[Relationship], id_dict: dict) -> None: diff --git a/Assignment-2/__pycache__/DCR_graph.cpython-310.pyc b/Assignment-2/__pycache__/DCR_graph.cpython-310.pyc deleted file mode 100644 index 5ef1bd8..0000000 Binary files a/Assignment-2/__pycache__/DCR_graph.cpython-310.pyc and /dev/null differ diff --git a/Assignment-2/__pycache__/conformance_testing.cpython-310.pyc b/Assignment-2/__pycache__/conformance_testing.cpython-310.pyc deleted file mode 100644 index fd004a2..0000000 Binary files a/Assignment-2/__pycache__/conformance_testing.cpython-310.pyc and /dev/null differ diff --git a/Assignment-2/__pycache__/log.cpython-310.pyc b/Assignment-2/__pycache__/log.cpython-310.pyc deleted file mode 100644 index b645fb0..0000000 Binary files a/Assignment-2/__pycache__/log.cpython-310.pyc and /dev/null differ