Kappa-Dev / KappaTools

Tool suite for kappa models. Documentation and binaries can be found in the release section. Try it online at
http://kappalanguage.org/
GNU Lesser General Public License v3.0
112 stars 41 forks source link

Trace, init, T0 #667

Open hmedina opened 1 year ago

hmedina commented 1 year ago

Trace steps of type init do not contain their time of application; nor does the model block in the trace appear to contain the defined T0. As such, the trace is missing the information of what was the value of T when the simulation started and the init steps took place.

For example:

%def: "T0" "3.5"

%agent: neutron()   %init: 1 neutron()
'/' neutron()+ @ 1

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

Produces a trace:

{
    "uuid" : "690746744",
    "dict":{"agent":{"id":0,"type":1},"binding_type":{"type":0,"site":1},"quark":{"agent":0,"site":1},"test":["Is_here","Has_Internal","Is_Free","Is_Bound","Has_Binding_type","Is_Bound_to"],"actions":["Create","Mod_internal","Bind","Bind_to","Free","Remove"],"binding_state":["ANY","FREE","BOUND","BOUND_TYPE","BOUND_to"],"event":{"tests":0,"actions":1,"side_effect_src":2,"side_effect_dst":3,"connectivity_tests":4},"simulation_info":{"id":0,"time":1,"event":2,"profiling":3},"step":["Subs","Rule","Pert","Init","Obs","Dummy"]},
    "model":{
        "filenames":["","./tests/unit/time_predefined_T0/model.ka"],
        "update":{
            "signatures":[{"name":"neutron","decl":[]}],
            "single_agents":[null],
            "elementaries":[[]],
            "dag":[{"content":null,"roots":null,"deps":[],"sons":[]}],
            "id_by_type":[[]],
            "max_obs":1},
        "tokens":[],
        "algs":[],
        "observables":["[T]"],
        "ast_rules":[["/",{"mixture":[],"created":[{"type":0,"sites":[],"internals":[]}],"delta_tokens":[],"rate":{"val":1,"loc":{"file":1,"bline":4,"bchr":17,"echr":18}},"unary_rate":null,"editStyle":true}]],
        "elementary_rules":[{"rate":{"val":1,"loc":{"file":1,"bline":4,"bchr":17,"echr":18}},"inserted":[{"Agent":{"Fresh":{"id":0,"type":0}}}],"syntactic_rule":1,"instantiations":[[],[[0,{"Fresh":{"id":0,"type":0}},[]]],[],[],[]]}],
        "contact_map":[[]],
        "interventions":[{
            "alarm":null,
            "condition":{"val":["=",{"val":"[E]","loc":{"file":1,"bline":6,"bchr":6,"echr":9}},{"val":2,"loc":{"file":1,"bline":6,"bchr":12,"echr":13}}],"loc":{"file":1,"bline":6,"bchr":6,"echr":13}},
            "effect":[{"action":"STOP"}],"repeat":{"val":false},"needs_backtrack":true}],
        "dependencies_in_time":[],
        "dependencies_in_event":[["MODIF",0]],
        "algs_reverse_dependencies":[],
        "tokens_reverse_dependencies":[]},
    "trace":[
        [3,[[0,[0,0],[]]]],
        [1,0,[[],[[0,[1,0],[]]],[],[],[]],[-1,5.2935983629643,1,null]],
        [1,0,[[],[[0,[2,0],[]]],[],[],[]],[-1,5.756406890124298,2,null]]]
}

But the 3.5 value does not seem to be present at all.