Skip to content

Commit

Permalink
integration tests for #683
Browse files Browse the repository at this point in the history
  • Loading branch information
Jérôme FERET committed Mar 10, 2024
1 parent d824f94 commit 3e5d63b
Show file tree
Hide file tree
Showing 12 changed files with 199 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/integration/compiler/counters_empty_interface/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"${KAPPABIN}"KaSim --compile counters_empty_interface.ka || true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%agent: A()
%agent: B(x,c{=0 / +=3})

A() -> . @1
17 changes: 17 additions & 0 deletions tests/integration/compiler/counters_empty_interface/output/LOG.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Parsing counters_empty_interface.ka...
done
+ simulation parameters
+ Sanity checks
+ Compiling...
+ Building initial simulation conditions...
-variable declarations
-rules
-interventions
-observables
-update_domain construction
8 (sub)observables 0 navigation steps
-initial conditions
+ Self seeding...
+ Building initial state (0 agents)
Done
+ Command line to rerun is: 'KaSim' '--compile' 'counters_empty_interface.ka' -seed 701950535
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
_____(1)
A()-
_____(1)
B(c{>=4})
Environment:

%agent: A()
%agent: B(x c{=0/+=3})

%plot: [T]
A()- @ 1
/*0*/%mod: (|B(c{=4})| = 1) do $PRINTF ""; $PRINTF "Counter c of agent B reached maximum"; $STOP "counter_perturbation.ka"; repeat [false]
Rules:
0: (ast: 1) 0: /*cc1*/ A/*1*/() -- A/*1*//*0*/ ++ @1
Polymers:
__counter_agent.a-b.
Domain:
/*cc0*/ -> ()
/*cc1*/ A/*1*/() [rate_of_rule [0]] -> ()
/*cc2*/ B/*2*/(c{=4}) [intervention [0]] -> ()
/*cc3*/ -> ()
/*cc4*/ -> ()
/*cc5*/ -> ()
/*cc6*/ -> ()
/*cc7*/ B/*2*/(x[.]) -> ()
/*cc8*/ B/*2*/(c[.]) -> ()
Intial graph;


1 change: 1 addition & 0 deletions tests/integration/compiler/counters_empty_lhs/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"${KAPPABIN}"KaSim --compile counters_empty_lhs.ka || true
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%agent: A()
%agent: B(x,c{=0 / +=3})

. -> A() @1
17 changes: 17 additions & 0 deletions tests/integration/compiler/counters_empty_lhs/output/LOG.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Parsing counters_empty_lhs.ka...
done
+ simulation parameters
+ Sanity checks
+ Compiling...
+ Building initial simulation conditions...
-variable declarations
-rules
-interventions
-observables
-update_domain construction
7 (sub)observables 0 navigation steps
-initial conditions
+ Self seeding...
+ Building initial state (0 agents)
Done
+ Command line to rerun is: 'KaSim' '--compile' 'counters_empty_lhs.ka' -seed 897249907
28 changes: 28 additions & 0 deletions tests/integration/compiler/counters_empty_lhs/output/error.log.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
_____(1)
A()+
_____(1)
B(c{>=4})
Environment:

%agent: A()
%agent: B(x c{=0/+=3})

%plot: [T]
A()+ @ 1
/*0*/%mod: (|B(c{=4})| = 1) do $PRINTF ""; $PRINTF "Counter c of agent B reached maximum"; $STOP "counter_perturbation.ka"; repeat [false]
Rules:
0: (ast: 1) -- ++ A/*ν 0*/ @1
Polymers:
__counter_agent.a-b.
Domain:
/*cc0*/ -> ()
/*cc1*/ B/*1*/(c{=4}) [intervention [0]] -> ()
/*cc2*/ -> ()
/*cc3*/ -> ()
/*cc4*/ -> ()
/*cc5*/ -> ()
/*cc6*/ B/*1*/(x[.]) -> ()
/*cc7*/ B/*1*/(c[.]) -> ()
Intial graph;


1 change: 1 addition & 0 deletions tests/integration/compiler/counters_enumerate/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"${KAPPABIN}"KaSim --compile counters_enumerate.ka || true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%agent: A()
%agent: B(c{=0 / +=2})
%init: 40 A()

A() -> . @ 1
. -> A() @ 1
A(),B(c{=x}) -> .,B(c{+=0}) @ x
.,B(c{=x}) -> A(),B(c{+=0}) @ x
17 changes: 17 additions & 0 deletions tests/integration/compiler/counters_enumerate/output/LOG.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Parsing counters_enumerate.ka...
done
+ simulation parameters
+ Sanity checks
+ Compiling...
+ Building initial simulation conditions...
-variable declarations
-rules
-interventions
-observables
-update_domain construction
11 (sub)observables 9 navigation steps
-initial conditions
+ Self seeding...
+ Building initial state (40 agents)
Done
+ Command line to rerun is: 'KaSim' '--compile' 'counters_enumerate.ka' -seed 202629756
72 changes: 72 additions & 0 deletions tests/integration/compiler/counters_enumerate/output/error.log.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
_____(1)
A()-
_____(1)
A()+
_____(1)
B(c{=0}), A()-
_____(1)
B(c{=1}), A()-
_____(1)
B(c{=2}), A()-
_____(1)
B(c{=0}), A()+
_____(1)
B(c{=1}), A()+
_____(1)
B(c{=2}), A()+
_____(1)
B(c{>=3})
_____(1)
A()+
Environment:

%agent: A()
%agent: B(c{=0/+=2})

%plot: [T]
A()- @ 1
A()+ @ 1
B(c{=0}), A()- @ 0
B(c{=1}), A()- @ 1
B(c{=2}), A()- @ 2
B(c{=0}), A()+ @ 0
B(c{=1}), A()+ @ 1
B(c{=2}), A()+ @ 2

/*0*/%mod: (|B(c{=3})| = 1) do $PRINTF ""; $PRINTF "Counter c of agent B reached maximum"; $STOP "counter_perturbation.ka"; repeat [false]
Rules:
0: (ast: 1) 0: /*cc1*/ A/*1*/() -- A/*1*//*0*/ ++ @1
1: (ast: 2) -- ++ A/*ν 0*/ @1
2: (ast: 3) 0: /*cc2*/ B/*2*/(c{=0}), 1: /*cc1*/ A/*1*/() -- A/*1*//*1*/
++ @0
3: (ast: 4) 0: /*cc3*/ B/*2*/(c{=1}), 1: /*cc1*/ A/*1*/() -- A/*1*//*1*/
++ @1
4: (ast: 5) 0: /*cc4*/ B/*2*/(c{=2}), 1: /*cc1*/ A/*1*/() -- A/*1*//*1*/
++ @2
5: (ast: 6) 0: /*cc2*/ B/*2*/(c{=0}) -- ++ A/*ν 0*/ @0
6: (ast: 7) 0: /*cc3*/ B/*2*/(c{=1}) -- ++ A/*ν 0*/ @1
7: (ast: 8) 0: /*cc4*/ B/*2*/(c{=2}) -- ++ A/*ν 0*/ @2
Polymers:

Domain:
/*cc0*/ -> ()
/*cc1*/ A/*1*/()
[rate_of_rule [0] rate_of_rule [2] rate_of_rule [3] rate_of_rule [4]]
-> ()
/*cc2*/ B/*2*/(c{=0}) [rate_of_rule [2] rate_of_rule [5]] -> ()
/*cc3*/ B/*2*/(c{=1}) [rate_of_rule [3] rate_of_rule [6]] -> ()
/*cc4*/ B/*2*/(c{=2}) [rate_of_rule [4] rate_of_rule [7]] -> ()
/*cc5*/ B/*2*/(c{=3}) [intervention [0]] -> ()
/*cc6*/ -> ()
/*cc7*/ -> ()
/*cc8*/ -> ()
/*cc9*/ B/*2*/(c{=0})
-> (-3(b[a.!__counter_agent-4])->-4(b[a.!__counter_agent-5])->-5(b[a.!__counter_agent-6])->()
5
-3(b[a.!__counter_agent-4])->-4(b[a.!__counter_agent-5])->-5(b[.])->()
4 -3(b[a.!__counter_agent-4])->-4(b[.])->() 3 -3(b[.])->() 2)
/*cc10*/ -> ()
/*cc11*/ B/*2*/(c[.]) -> ()
Intial graph;
%init: 40 A()

0 comments on commit 3e5d63b

Please sign in to comment.