Skip to content

Latest commit

 

History

History
90 lines (60 loc) · 3.38 KB

README.md

File metadata and controls

90 lines (60 loc) · 3.38 KB

ThirdWay

Build Status Coverage Status

ThirdWay is a Scala library for building Agent-Based Models (ABMs).

Using

ThirdWay is on the Maven's Central Repository. Installation is as easy as adding:

libraryDependencies += "com.generativists" % "thirdway_2.11" % "0.0.1"

to your build.sbt file.

I'll write a few tutorials and a user's manual as the library matures.

History

It started off as a Julia ABM package, heavily-inspired by MASON. But, Julia proved inappropriate for my dissertation. (Although, it is a lovely language!) In a bout of triage, I switched to Scala, a language I've always evangelized for ABM development. I've come full circle.

Design Principals

Readability Matters...A Lot

Agent-based models are inherently complex. Consequently, it's terribly easy to introduce computational artifacts. That is, you run your simulation; you observe an interesting result; you think it's because that's how what you tried to model actually works; but, really, it's because your implementation was incorrect. Readability provides some defense. To repurpose Hoare,

One way [to construct a model] to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies.

Readable code tends to simpler to understand.

Code Coverage Matters

In the same vein as readability, well-tested code helps guard against artifacts. There is a danger evangelizing the One True Methodology® protects against all regressions and bugs. But, in agent-based modeling, it's not a garnish. Again, if the models are inherently complex, code must be verified to ensure you know why something happens.

As a rule, ThirdWay assumes a model without good code coverage is incorrect and bug-ridden.

Speed is a Subordinate Concern

That is, it is subordinate, at least with respect to the two prior principals. If speed is completely irrelevant, there are much better languages and frameworks for designing ABMs. (In particular, if your model is not large, use something lighter and more zen-like -- for example, Mesa.) However, this library assumes larger simulations, possibly with very thick agents. As such, speed matters -- but, correctness matters more.

Any time there is a tradeoff, readability, interoperability, or simplicity trumps speed.

Contributing

I have a very good map in my head of what I need for my dissertation. Until the map in my head and code in this library sync up, my needs may not be clear. And, I won't accept a pull request if it frustrates my project. So, if you have a cool idea, open up an issue first. I don't want anyone submitting a good PR that gets rejected because I can't use it, yet.

Bibliography

  • Luke, Sean, Claudio Cioffi-Revilla, Liviu Panait, Keith Sullivan, and Gabriel Balan. "Mason: A multiagent simulation environment." Simulation 81, no. 7 (2005): 517-527.