TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Agentscript: Agent Based Modeling in the Browser

85 点作者 nickswalker超过 1 年前

4 条评论

matlin超过 1 年前
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超过 1 年前
Woah this is awesome and I love the ant foraging simulation example!<p>A few months ago someone posted about an in-browser sand&#x2F;water&#x2F;fish simulation and there was a discussion thread about similar ant simulations! <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36002901">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=36002901</a>
WorldMaker超过 1 年前
Neat. My master&#x27;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 &quot;turtles&quot; (&quot;bees&quot; 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.<p>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 &quot;bees&quot;&#x2F;&quot;turtles&quot;). The prototype-inheritance worked in sort of &quot;copy on write&quot; way that properties would be entirely shared across the prototype chain until changed for a specific instance.<p>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&lt;K, V&gt;` with an added &quot;ownership&quot; concept) and Boo macros (and not quite finished at the pencil&#x27;s down time: `IQuackFoo` [Boo] and `IDynamicObject` [DLR] support).<p>(I think I&#x27;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&#x27;t have remembered half of this.)<p>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 &quot;copy on write&quot; 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&#x27; own prototype-oriented nature is increasingly obscured behind the class syntax sugar). It can be a little more interesting that imperative forEach-based modeling.
jalino23超过 1 年前
this is such a cool idea, I&#x27;m a beginner game developer and wanted to create a vibrant city that feels alive, this just gives me an idea to try ABM