backspaces/agentscript — pull request #53 by bennlich (2014-07-01 23:05:49+00:00)
Title: Multiple models

See https://github.com/backspaces/agentscript/issues/48.

- Global `ABM` no longer contains agentsets, contexts, or world properties. Instead, those properties belong only to the ABM.Model instance.
- Agents and agentsets now contain a reference to their model, so they don't have to go through `ABM` to access other agents/agentsets.
- Extras have been updated to accept a model parameter, so they are not dependent on global `ABM` properties. Importantly, an `ABM.DataSet` can be initialized with a model parameter, can have its model parameter set with `setModel()`, or can use a model parameter passed in through a relevant function, e.g. `myDataSet.toPatchVar('elevation', myElevationModel)`. This way you can use one dataset to interact with several models.

Works with all test models and sketches (after modification for breaking changes in extras)!

TODO: Create an example showing two models on one page!