SkillAgentSearch skills...

EconomySimulator

No description available

Install / Use

/learn @Ruddle/EconomySimulator
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

EconomySimulator

Code of the simulator, and its display, from the blog post Building an economy simulator from scratch. It uses mithril.js.

How to use

Example of usage: Simulation 25 from the blog post

import m from "mithril";
import * as economy from "./economy.js";

economy.init(m);

let options = {
  money: true,
  overconsume: true,
  bidding: true,
  sellMin: true,
  qol2: true,
  highNumbers: true,
  truncate: true,
  resourcesCons: ["food", "water", "wood"],
  peopleOpt: [
    { producer: "food", money: 1000 },
    { producer: "food", money: 1000 },
    { producer: "food", money: 1000 },
    { producer: "wood", money: 1000 },
    { producer: "water", money: 1000 },
    { producer: "gov", money: 1000 },
    { producer: "gov", money: 1000 },
    { producer: "gov", money: 1000 },
  ],
  prices: { food: 100, wood: 100, water: 100 },
  gov: {
    resources: { money: 1000 },
    tax: 3,
    autoTax: false,
    print: true,
    fluid: { mul: 1.5 },
  },
};

m.mount(document.body, { view: () => m(economy.Root, options) });
View on GitHub
GitHub Stars11
CategoryDevelopment
Updated7mo ago
Forks2

Languages

JavaScript

Security Score

77/100

Audited on Aug 15, 2025

No findings