Kappa-Dev/KappaTools

KaSim cannot read empty strings ("")

Closed this issue · 0 comments

This means that it also cannot read back inputs.ka files.

For example:

$ cat ./test.ka
%agent: A(c{=0 / +=2})

%init: 1 A(c{=0})

%obs: A1 |A(c{=0})|

$ bin/KaSim ./test.ka
Parsing ./test.ka...
done
+ simulation parameters
+ Sanity checks
+ Compiling...
+ Building initial simulation conditions...
	-variable declarations
	-rules
	-interventions
	-observables
	-update_domain construction
	8 (sub)observables 4 navigation steps
	-initial conditions
+ Self seeding...
+ Building initial state (2 agents)
Done
+ Command line to rerun is: 'KaSim' './test.ka' -seed 343591691
Warning: A deadlock was reached after 0 events and 0.000000E+00s (Activity = 0.00000)
0.00 time units in 0 events
Simulation ended

$ cat ./inputs.ka
// "uuid" : "157248261"
%def: "seed" "343591691"
%def: "dumpIfDeadlocked" "true"
%def: "maxConsecutiveClash" "3"
%def: "progressBarSize" "70"
%def: "progressBarSymbol" "#"
%def: "plotPeriod" "1" "t.u."
%def: "outputFileName" "data.csv"


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

%var:/*0*/ 'A1' |A(c{=0})|
%plot: [T]
%plot: A1


/*0*/%mod: (|A(c{=3})| = 1) do $PRINTF ""; $PRINTF "Counter c of agent A reached maximum"; $STOP "counter_perturbation.ka"; repeat [false]

%init: 1 A(c{=0})

%mod: [E] = 0 do $STOP;

$ bin/KaSim ./inputs.ka
Parsing ./inputs.ka...
done
File "./inputs.ka", line 18, characters 39-40:
Unknown character: "