-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
788731c
commit 686c6d3
Showing
6 changed files
with
90 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#Command-line: | ||
"${KAPPABIN}"KaSim -l 1 counters_smaller_than.ka -seed 23014 -d output -syntax 4 || true |
21 changes: 21 additions & 0 deletions
21
tests/integration/compiler/counters_smaller_than/counters_smaller_than.ka
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
%agent: A(c{=0 / += 7}) | ||
%agent: B() | ||
|
||
'rule_a' A(c{<=2}) -> A(c{+=1}) @ 1 | ||
'rule_b' A(c{>=5}) -> A(c{-=1}) @ 1 | ||
'rule_c' A(c{=3}) -> A(c{+=1}) @ 1 | ||
'rule_aa' A(c{<=1}),. -> ., B() @ 0.2 | ||
|
||
%init: 10 A(c{=0}) | ||
%init: 10 A(c{=7}) | ||
|
||
// %obs: 'A' |A()| | ||
%obs: 'B' |B()| | ||
%obs: 'A0' |A(c{=0})| | ||
%obs: 'A1' |A(c{=1})| | ||
%obs: 'A2' |A(c{=2})| | ||
%obs: 'A3' |A(c{=3})| | ||
%obs: 'A4' |A(c{=4})| | ||
%obs: 'A5' |A(c{=5})| | ||
%obs: 'A6' |A(c{=6})| | ||
%obs: 'A7' |A(c{=7})| |
19 changes: 19 additions & 0 deletions
19
tests/integration/compiler/counters_smaller_than/output/LOG.ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Parsing counters_smaller_than.ka... | ||
done | ||
+ simulation parameters | ||
+ Sanity checks | ||
+ Compiling... | ||
+ Building initial simulation conditions... | ||
-variable declarations | ||
-rules | ||
-interventions | ||
-observables | ||
-update_domain construction | ||
28 (sub)observables 58 navigation steps | ||
-initial conditions | ||
+ Building initial state (200 agents) | ||
Done | ||
+ Command line to rerun is: 'KaSim' '-l' '1' 'counters_smaller_than.ka' '-seed' '23014' '-d' 'output' '-syntax' '4' | ||
______________________________________________________________________ | ||
###################################################################### | ||
Simulation ended |
4 changes: 4 additions & 0 deletions
4
tests/integration/compiler/counters_smaller_than/output/data.csv.ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Output of 'KaSim' '-l' '1' 'counters_smaller_than.ka' '-seed' '23014' '-d' 'output' '-syntax' '4' | ||
"[T]","B","A0","A1","A2","A3","A4","A5","A6","A7" | ||
0.,0,10,0,0,0,0,0,0,10 | ||
1.,2,3,2,2,0,1,2,3,5 |
Empty file.
44 changes: 44 additions & 0 deletions
44
tests/integration/compiler/counters_smaller_than/output/inputs.ka.ref
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
%def: "seed" "23014" | ||
%def: "dumpIfDeadlocked" "true" | ||
%def: "maxConsecutiveClash" "3" | ||
%def: "progressBarSize" "70" | ||
%def: "progressBarSymbol" "#" | ||
%def: "plotPeriod" "1" "t.u." | ||
%def: "outputFileName" "data.csv" | ||
|
||
|
||
%agent: A(c{=0/+=7} c__inverted{=0/+=7}) | ||
%agent: B() | ||
|
||
%var:/*0*/ 'B' |B()| | ||
%var:/*1*/ 'A0' |A(c{=0})| | ||
%var:/*2*/ 'A1' |A(c{=1})| | ||
%var:/*3*/ 'A2' |A(c{=2})| | ||
%var:/*4*/ 'A3' |A(c{=3})| | ||
%var:/*5*/ 'A4' |A(c{=4})| | ||
%var:/*6*/ 'A5' |A(c{=5})| | ||
%var:/*7*/ 'A6' |A(c{=6})| | ||
%var:/*8*/ 'A7' |A(c{=7})| | ||
%plot: [T] | ||
%plot: B | ||
%plot: A0 | ||
%plot: A1 | ||
%plot: A2 | ||
%plot: A3 | ||
%plot: A4 | ||
%plot: A5 | ||
%plot: A6 | ||
%plot: A7 | ||
|
||
'rule_a' A(c{>=0/+=1} c__inverted{>=5/+=-1}) @ 1 | ||
'rule_b' A(c{>=5/+=-1} c__inverted{>=0/+=1}) @ 1 | ||
'rule_c' A(c{=3/+=1} c__inverted{>=1/+=-1}) @ 1 | ||
'rule_aa' A(c[#] c__inverted{>=6})-, B()+ @ 0.2 | ||
|
||
/*0*/%mod: (|A(c__inverted{=8})| = 1) do $PRINTF ""; $PRINTF "Counter c__inverted of agent A reached maximum"; $STOP "counter_perturbation.ka"; repeat [false] | ||
/*1*/%mod: (|A(c{=8})| = 1) do $PRINTF ""; $PRINTF "Counter c of agent A reached maximum"; $STOP "counter_perturbation.ka"; repeat [false] | ||
|
||
%init: 10 A(c{=0} c__inverted{=7}) | ||
%init: 10 A(c{=7} c__inverted{=0}) | ||
|
||
%mod: [E] = 19 do $STOP; |