Skip to content

Commit

Permalink
second try off wait all
Browse files Browse the repository at this point in the history
  • Loading branch information
maor226 committed Feb 8, 2022
1 parent 7e97372 commit 77080ef
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
4 changes: 2 additions & 2 deletions NodeLibrary.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,12 +358,12 @@ def genF(self, l):
def synchronization(self, tokens: Sequence[Dict], sync: Sequence[Dict], node: DiagramNode) -> Sequence[Dict]:
sync = copy.deepcopy(sync)
for t in tokens:
t = copy.deepcopy(t)


if node.waitall is not "[]":
if "WAITALL" not in t.keys():
t['WAITALL']= eval(node.waitall, globals(), t)

t = copy.deepcopy(t)
t['WAIT'] =(lambda w : w if callable(w) else self.genF(w))(list(itertools.chain(copy.deepcopy(t['WAITALL'])))) # need to be the union
# t['WAITALL']= [(lambda w :w if callable(w) else self.genF(w))(eval(w, globals(), t)) for w in node.waitall]

Expand Down
2 changes: 1 addition & 1 deletion Tests/TTT_maor.flow
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AllMove=lambda : All(X).extern(All(O))

st3 -> wa -> rq3;

st3 [type=start, initial="[{'path':Path[0]} ]", width=400];
st3 [type=start, initial="[{'path':path} for path in Path ]", width=400];
wa [type=waitall, waitall="[[X(i) for i in path]]"]
rq3 [type=sync, req="['Player X wins'], block =[AllMove()]"]

Expand Down
Binary file modified Tests/TTT_run/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Tests/TTT_run/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions Tests/tmp.flow
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
blockdiag {
st -> join -> req;

st [type=start, initial="[{1:'1'},{2:'2'},{'third':'3'}]"];
join [type=join]
req [type=sync, req="['O'+third]"]







# For debugging
class hidden [color = none, style = none, textcolor = white];
stt -> listener -> "Event viewer" -> listener [style = "none"];

listener [type=sync,
wait="['X'+str(i) for i in range(1,9)]+['O'+str(i) for i in range(1,9)]",
class = "hidden", autoformat='false'];

stt [type=start, class = "hidden", autoformat='false'];

}

0 comments on commit 77080ef

Please sign in to comment.