Ben Berman

simulation

Housing Market Simulation

I once spent a bunch of time working on an ECS/actor framework for react-three-fiber with the intention of creating some interesting visuals about the housing market.

backstory

In 2023, I got into a little debate with my brother. I had said something like "The existence and legality of renting property (i.e. landlords) raises property values". He said something like "You're way too sure, given the potential second- and third-order effects."

I had this thought of "this would be easy to simulate", which I have learned is a dumb, untrue thought on both a literal and philosophical level.

I explored many possibilities, forked from ProbablyTrain/MapGeneratorA procedural city map generator, created for artistic purposes.repo, and played around with agentic LLMs for development for the first time.

One of the biggest through-lines here was to create an ECSEntity–component system: simulation state as entities with typed component data.Properties of entities are typically stored in big, co-located arrays, allowing disparate systems to run independently (parallelized and cache-optimal). Effectively an authoring layer to give struct-of-arrays performance with array-of-structs semantics.Wikipedia-style state management system for React (and therefore react-three-fiberReact renderer for three.js how the simulation was meant to be visualized.docs) with co-located memory supporting a many-entity simulation. One of the cool ideas behind making it ECS-style would be the potential to use workers to do (gasp) multi-threaded simulations/gaming in JavaScript.

footage

links

What's the state?

Abandoned, in part due to finding a job.

What did I learn?

  • Memory-oriented performance improvements in the JavaScript runtime are quite counter-intuitive.
  • Chaotic systems aren't well-represented by discrete data and decisions such as actors. Shout out to Chaos by James Gleick

    Gleick, James. Chaos: Making a New Science. Viking, 1987.

    publisher
    .

all interests