{"action":"created","issue":{"url":"https://api.github.com/repos/Kappa-Dev/KaSim/issues/330","repository_url":"https://api.github.com/repos/Kappa-Dev/KaSim","labels_url":"https://api.github.com/repos/Kappa-Dev/KaSim/issues/330/labels{/name}","comments_url":"https://api.github.com/repos/Kappa-Dev/KaSim/issues/330/comments","events_url":"https://api.github.com/repos/Kappa-Dev/KaSim/issues/330/events","html_url":"https://github.com/Kappa-Dev/KaSim/issues/330","id":202630984,"number":330,"title":"potential bug in output of KaSim results?","user":{"login":"yarden","id":96318,"avatar_url":"https://avatars.githubusercontent.com/u/96318?v=3","gravatar_id":"","url":"https://api.github.com/users/yarden","html_url":"https://github.com/yarden","followers_url":"https://api.github.com/users/yarden/followers","following_url":"https://api.github.com/users/yarden/following{/other_user}","gists_url":"https://api.github.com/users/yarden/gists{/gist_id}","starred_url":"https://api.github.com/users/yarden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarden/subscriptions","organizations_url":"https://api.github.com/users/yarden/orgs","repos_url":"https://api.github.com/users/yarden/repos","events_url":"https://api.github.com/users/yarden/events{/privacy}","received_events_url":"https://api.github.com/users/yarden/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-23T19:43:02Z","updated_at":"2017-01-25T23:20:56Z","closed_at":"2017-01-23T22:09:23Z","body":"What follows might be my own pedestrian misunderstanding, but I'm getting counter-intuitive results when plotting Kappa simulations and also when running ``KaSim`` directly. Consider this [two-agent kappa program](https://gist.github.com/yarden/6366f0e4d7f2a592f60d368e5fc36611). It contains a perturbation at T=50 that adds 100 units of ``Gal()`` agent:\r\n\r\n```\r\n%mod: [T]=50 || [false] do $ADD 100 Gal()\r\n```\r\n\r\n``Gal()`` is initially 0, so its value should increase at T=100, yet the plot shows it flat at 100 starting at around T=1:\r\n\r\n![kasim_result](https://cloud.githubusercontent.com/assets/96318/22219551/2f66174c-e179-11e6-88c2-c896764e6302.png)\r\n\r\nThe simulation correctly shows that agents that depend on ``Gal()`` are only made at around T=50, as expected, so it doesn't look like ``Gal()``'s value is actually interpreted internally as being at level 100 starting at T=1.\r\n\r\nWhen I run ``KaSim`` directly, it matches the plotted results:\r\n\r\n```\r\n$ KaSim -i toy_model.ka -l 150\r\n+ Self seeding...\r\n+ Command line to rerun is: 'KaSim' '-i' 'toy_model.ka' '-l' '150' -seed 298615321\r\nParsing toy_model.ka...\r\n...[snip]...\r\n$ head data.csv \r\n# Output of 'KaSim' '-i' 'toy_model.ka' '-l' '150' -seed 298615321\r\n\"[T]\", \"[T]glu_sensor_var\", \"[T]glu_sensor_varglu_sensor_active\", \"[T]glu_sensor_varglu_sensor_activegal\"\r\n0., 50, 0, 0\r\n1., 50, 0, 100\r\n2., 50, 0, 100\r\n3., 50, 0, 100\r\n4., 50, 0, 100\r\n5., 50, 0, 100\r\n6., 50, 0, 100\r\n7., 50, 0, 100\r\n```\r\n\r\nThere's another potential issue with the ``KaSim`` output. The variables I set to observe were:\r\n\r\n```\r\n%obs: 'glu_sensor_var' |GluSensor()|\r\n%obs: 'glu_sensor_active' |GluSensor(gal_ext!gal_ext.Gal)|\r\n%obs: 'gal' |Gal()|\r\n```\r\n\r\nMy expectation was three columns in output, ``[T]glu_sensor_var``, ``[T]glu_sensor_active``, and ``[T]gal``, but it looks like the string ``glu_sensor_var`` got prepended to each variable name. In any case, you can see that the KaSim result matches the plotting: ``gal`` is 0 at T=0, but 100 at T=1 rather than T=100, which is what I can't explain.\r\n\r\nThanks very much, Yarden"},"comment":{"url":"https://api.github.com/repos/Kappa-Dev/KaSim/issues/comments/275264212","html_url":"https://github.com/Kappa-Dev/KaSim/issues/330#issuecomment-275264212","issue_url":"https://api.github.com/repos/Kappa-Dev/KaSim/issues/330","id":275264212,"user":{"login":"yarden","id":96318,"avatar_url":"https://avatars.githubusercontent.com/u/96318?v=3","gravatar_id":"","url":"https://api.github.com/users/yarden","html_url":"https://github.com/yarden","followers_url":"https://api.github.com/users/yarden/followers","following_url":"https://api.github.com/users/yarden/following{/other_user}","gists_url":"https://api.github.com/users/yarden/gists{/gist_id}","starred_url":"https://api.github.com/users/yarden/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarden/subscriptions","organizations_url":"https://api.github.com/users/yarden/orgs","repos_url":"https://api.github.com/users/yarden/repos","events_url":"https://api.github.com/users/yarden/events{/privacy}","received_events_url":"https://api.github.com/users/yarden/received_events","type":"User","site_admin":false},"created_at":"2017-01-25T23:20:56Z","updated_at":"2017-01-25T23:20:56Z","body":"I believe I ran KaSim with OCaml 4.02.3:\r\n\r\n```\r\n$ ocaml\r\n        OCaml version 4.02.3\r\n\r\n# Printf.printf \"foo\";;\r\nfoo- : unit = ()\r\n# Printf.printf \"bar\";;\r\nbar- : unit = ()\r\n```"}}
{"actor":{"display_login":"yarden"}}