More DCL graphs!

This commit is contained in:
2023-01-06 11:45:47 +01:00
5 changed files with 8 additions and 6 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/__pycache__/

View File

@ -11,7 +11,6 @@ def listify(element):
class Event(): class Event():
def __init__(self, _id:str, name:str, id_dict:dict, parent:Process=None) -> None: def __init__(self, _id:str, name:str, id_dict:dict, parent:Process=None) -> None:
self._id = _id self._id = _id
id_dict[_id] = self
self.name = name.lower() self.name = name.lower()
self.pending = False self.pending = False
self.executed = False self.executed = False
@ -20,6 +19,8 @@ class Event():
self.relations_from : list[Relationship] = [] self.relations_from : list[Relationship] = []
self.parent = parent self.parent = parent
id_dict[_id] = self
def execute(self): def execute(self):
self.executed = True self.executed = True
self.pending = False self.pending = False
@ -123,7 +124,7 @@ class Relationship():
def execute(self): def execute(self):
if self.type == RelationsshipType.condition: if self.type == RelationsshipType.condition:
pass # does nothing pass # does nothing (Since the source is executed as well)
elif self.type == RelationsshipType.response: elif self.type == RelationsshipType.response:
self.target.pending = True self.target.pending = True
elif self.type == RelationsshipType.coresponse: elif self.type == RelationsshipType.coresponse:
@ -133,13 +134,13 @@ class Relationship():
elif self.type == RelationsshipType.include: elif self.type == RelationsshipType.include:
self.target.included = True self.target.included = True
elif self.type == RelationsshipType.milestone: elif self.type == RelationsshipType.milestone:
pass # does nothing pass # does nothing (Since the source is executed as well)
elif self.type == RelationsshipType.update: elif self.type == RelationsshipType.update:
pass pass # Don't know what this one does
elif self.type == RelationsshipType.spawn: elif self.type == RelationsshipType.spawn:
pass pass # Don't know what this one does
elif self.type == RelationsshipType.templateSpawn: elif self.type == RelationsshipType.templateSpawn:
pass pass # Don't know what this one does
class Graph(): class Graph():
def __init__(self, process:Process, relationships:list[Relationship], id_dict: dict) -> None: def __init__(self, process:Process, relationships:list[Relationship], id_dict: dict) -> None: