From 7dc1198836a895e9fa08ebd8fac300273637b00d Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Fri, 6 Jan 2023 10:59:41 +0100 Subject: [PATCH 1/2] :sparkles: --- Assignment-2/DCR_graph.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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: From 5084aa4aaf01d9e57318db0577b5575c435933c8 Mon Sep 17 00:00:00 2001 From: NikolajDanger Date: Fri, 6 Jan 2023 11:40:45 +0100 Subject: [PATCH 2/2] :sparkles: --- .../__pycache__/DCR_graph.cpython-310.pyc | Bin 7637 -> 7637 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Assignment-2/__pycache__/DCR_graph.cpython-310.pyc b/Assignment-2/__pycache__/DCR_graph.cpython-310.pyc index 35dbe5b2aa85fd3c4c20e5951399098fa34efb22..fa79f9359d83dd045d2087e23a6c8506b93fc28a 100644 GIT binary patch delta 255 zcmYkpzb^w}00!WDzjN1X@9uM{6Q`Oc9U46a#qNwpe zG`$4Oe;vV+evCkM^dTTe+h}2sFUBqMteJBd=7+h23@foZM))3E$0#SP8cKY%I&joQ zyb6pf!w!H+W}G%=`R%-6fzNIm6?HCsV3m*EKiE_c-VCrsFL{Iwb(yq*2Jd=SaLBAb zk0y8gZPZm)@4mp9YV?(XYevByu2i*u40z&6Y8Ne)9f*Kaex;*$(aT9&rX2YTEtgAM delta 253 zcmX}Zze@sP00v;+yY4*iyZbuqLemO_Y6=@0uD}`+YHVGM?dquR|kht_$L_<(h&l3evAh%rCj{SLSch)YlcXCxTW1${mjumZ&P3_dP zV8i@xg9~~KDb?5WzyyWS#S~wR4yIW%E6DTHT*nxT@djr35#PoMBtN zipmgaV1?sO4<&v(@2K+G?O{o^r4MZKaqtJb>cJ}kA-&`YcGPuJ01e&`ZJ^1VUqy>` we-B4$VE9nOr8-V60=JCP2e?t?kpj@=S!N$kDwmCbbAF9RiNKqbLS`KK3mbh)MF0Q*