

Introducing AgentBase, for Agent Based Modeling from the Browser - wybo
http://agentbase.org/

======
wybo
A side-project that came out of my (ongoing) thesis work at Oxford. I model
social movements, and how the Internet and Social Media might affect them.

You can try a template model here:
[http://agentbase.org/model.html?9d54597f7aafc995d227](http://agentbase.org/model.html?9d54597f7aafc995d227)

AgentBase uses:

* HTML canvas, jQuery, etc

* CoffeeScript browser library, for compilation of CoffeeScript

* ACE editor for code editing

* GitHub gists, mini-repositories for storage of models

* NodeJS + Mongo for keeping a list of models

Comments most welcome!

~~~
lucio
This is really good. It is not receiving the deserved attention/upvotes on
HN...

<sarcasm?> Make a game of it, maybe with flock, and you'll be on the front
page for days... ;) </sarcasm?>

~~~
papad
Yea this is great. As an applied math major in college, modeling was my
favorite class with so many variations of ABMs with Monte Carlo randomness.
Like you, I was focused on social sciences, specifically economics so love
these methods to better simulate and understand our world.

My friends and I have taken similar shots at putting this functionality
online, and turning it into a game is a great idea! Especially a game that
helps teach/learn different concepts. For example, we had a previous project
that allowed folks to learn Javascript by programming the AI for your
different units in a RTS game. Unfortunately, we didn't have enough money/time
to support it - hopefully we can bring it back online soon - but you can see
more info on this reddit thread:
[http://www.reddit.com/r/learnprogramming/comments/1alfd9/jav...](http://www.reddit.com/r/learnprogramming/comments/1alfd9/javascript_learn_by_playing_rts_game_where_you/)

Similar to you, we were using HTML5 canvas with a CodeMirror editor so users
could modify and republish their own version in real-tim. I think you could do
something similar where users had to modify the code (to different extents
which could be levels) to get it to flock in certain ways. And then actually
give the flock some real world story/context. That would be really cool.

------
lucio
Great! Excellent work. I'm mesmerized with the flock example...

To try: # A more inestable flock
[http://agentbase.org/model.html?82ef4f46d2a05838dc5f](http://agentbase.org/model.html?82ef4f46d2a05838dc5f)

    
    
        @population = 55      # agents
        @setVision 4           # patches & set patch rect
        @minSeparation = 3 # patches

~~~
wybo
Cool to see the tinkering works for you! It is mesmerizing :)

Do save your model as a new one if you want, makes it a one-click experience
for visitors.

(in an ideal scenario AgentBase would do this automatically, and for each edit
provide a link to that version... gists don't fork, sadly)

~~~
lucio
Anyone not understanding what the three lines are, and how to apply them, has
not the knowledge required to fully appreciate what you've done: Beauty from
simplicity.

    
    
        @population = 55   # agents
        @setVision 4       # patches & set patch rect
        @minSeparation = 3 # patches

------
lucio
this is not working for me... (Chrome v39.0)
[http://agentbase.org/model.html?d10d06e31f41874b982c](http://agentbase.org/model.html?d10d06e31f41874b982c)

------
lucio
What is exactly the difference with agentscript.org ?

~~~
wybo
AgentBase.org as a website allows the in-browser editing and sharing of ABMs.
These ABMs make use of the AgentBase library. This library is quite similar to
AgentScript.

The AgentBase library actually was a fork from the AgentScript library. See
here for why I forked it (basically to keep it simple and to be able to apply
basic minimum coding standards and add automated tests):
[https://groups.google.com/forum/#!topic/agentbase/4NicEY8B6W...](https://groups.google.com/forum/#!topic/agentbase/4NicEY8B6WI)

Happy tinkering!

