[HN Gopher] Agentscript: Agent Based Modeling in the Browser
       ___________________________________________________________________
        
       Agentscript: Agent Based Modeling in the Browser
        
       Author : nickswalker
       Score  : 42 points
       Date   : 2023-09-19 18:16 UTC (4 hours ago)
        
 (HTM) web link (agentscript.org)
 (TXT) w3m dump (agentscript.org)
        
       | matlin wrote:
       | I took a a couple classes in college that were taught in NetLogo.
       | While it isn't the most practical language (except for visual
       | simulations), I think it's incredibly valuable to learn to think
       | in terms of isolated agents. It brings together OOP and
       | functional programming and is a good foundation to learn multi-
       | threading or light-weight processes like in Erlang/Elixir.
        
       | Nezteb wrote:
       | Woah this is awesome and I love the ant foraging simulation
       | example!
       | 
       | A few months ago someone posted about an in-browser
       | sand/water/fish simulation and there was a discussion thread
       | about similar ant simulations!
       | https://news.ycombinator.com/item?id=36002901
        
       | jalino23 wrote:
       | this is such a cool idea, I'm a beginner game developer and
       | wanted to create a vibrant city that feels alive, this just gives
       | me an idea to try ABM
        
       | WorldMaker wrote:
       | Neat. My master's project many years back was something like this
       | but built in XNA (which was the style at the time). I mostly just
       | had simple triangular "turtles" ("bees" in this system, because
       | of a bee swarm metaphor naming convention, for silly reasons such
       | as naming things is hard) by the time I presented the project
       | (and graduated), but I had some fun with them, all three vertices
       | could have different colors and there were some things we were
       | doing with that.
       | 
       | The big thing I was exploring, however, was a more prototypical-
       | inheritance-oriented development. Rather than forEach() style
       | callbacks, instance methods were used (`Update(time)`) and could
       | be inherited from prototypes (which was the default as the Clone
       | method was the default way to create new "bees"/"turtles"). The
       | prototype-inheritance worked in sort of "copy on write" way that
       | properties would be entirely shared across the prototype chain
       | until changed for a specific instance.
       | 
       | I used the Boo language in the C#-based REPL environment. That
       | was a Python-inspired .NET language (which has somewhat
       | disappeared since). At the time, I built the prototype-style
       | inheritance as a combination of hacks of C# object graphs of hash
       | tables (`Dictionary<K, V>` with an added "ownership" concept) and
       | Boo macros (and not quite finished at the pencil's down time:
       | `IQuackFoo` [Boo] and `IDynamicObject` [DLR] support).
       | 
       | (I think I'd have to dig the old darcs repo out of mothballed
       | backups at this point, but I did find my final presentation on it
       | in my Documents folder, otherwise I wouldn't have remembered half
       | of this.)
       | 
       | Anyway, the interesting thing about Agentscript being in JS,
       | itself a prototype-based language, is that you should be able to
       | easily recreate much of what I did in that old project, except
       | maybe the "copy on write" semantics might need a bit of fudging.
       | I still think that prototype-based inheritance (and even things
       | like runtime prototype switching) is still a very useful avenue
       | of exploration for Agent based modeling like this (and
       | underappreciated in general, especially now that JS' own
       | prototype-oriented nature is increasingly obscured behind the
       | class syntax sugar). It can be a little more interesting that
       | imperative forEach-based modeling.
        
       ___________________________________________________________________
       (page generated 2023-09-19 23:01 UTC)