Commit 2e75be72 authored by Lars Schieffer's avatar Lars Schieffer
Browse files

update pseudo code

parent 2a95bfe1
......@@ -41,34 +41,30 @@ def instancesOf(model: dict, functions: dict) -> list:
synchronise[index] = label
sync = {"result": label, "synchronise": synchronise}
syncs.append(sync)
model["system"]["syncs"] = syncs
else:
syncs = system["syncs"]
updatedSyncs = []
removeLabel = [set() for number in range(len(instances))]
for synchronisation in system["syncs"]:
for synchronisation in syncs:
result = synchronisation["result"] if "result" in synchronisation else "tau"
syncVector = synchronisation["synchronise"]
edges = []
for index, label in enumerate(syncVector):
if label:
edges.append(instances[index][label])
removeLabel[index].add(label)
edges = flattenOf(edges)
for edge in edges:
updatedLabel = str(len(updatedSyncs))
updatedVector = []
synchronise = []
for index, entry in enumerate(syncVector):
if entry:
instances[index][updatedLabel] = [edge.pop(0)]
updatedVector.append(updatedLabel)
synchronise.append(updatedLabel)
else:
updatedVector.append(None)
synchronisation = {"result": result, "synchronise": updatedVector}
synchronise.append(None)
synchronisation = {"result": result, "synchronise": synchronise}
updatedSyncs.append(synchronisation)
model["system"]["syncs"] = updatedSyncs
for index, labels in enumerate(removeLabel):
for label in list(labels):
instances[index].pop(label, None)
return instances
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment