gregziegan / climate-game

make the people happy
BSD 3-Clause "New" or "Revised" License
4 stars 0 forks source link

Economy V2 - Involve Earth => Materials => Capital => (Economy, Pollution) #29

Open gregziegan opened 3 years ago

gregziegan commented 3 years ago

Context

The economy is a rudimentary pipeline at the moment. There's no discrete stages for turning materials on Earth into more advanced capital like metal, glass, etc. To properly account for pollution and alter its course - we need to model these economic processes.

Below is a rough engineering draft:

Terms

APIs

Cultivators.harvest : Earth -> Cultivators -> (Earth, RawMaterials, Pollution)
Refineries.operate : RawMaterials -> Refineries -> (RefinedMaterials, Pollution)
Builders.produce : RefinedMaterials -> Builders -> (Capital, Pollution)
Economy.allocate : Capital -> ServiceWorkers -> Economy
Economy.distribute : Population -> Economy -> Efficiency

Psuedocode

let { earth, cultivators, builders, serviceWorkers, refineries } = model -- our game state

let (updatedEarth, materials, harvestPollution) = Cultivators.harvest earth cultivators

let (refinedMaterials, refinementPollution) = Refineries.operate materials refineries

let (capital, productionPollution) = Builders.produce materials builders

let economy = Economy.allocate capital serviceWorkers

let population = cultivators ++ builders ++ refineries.workers ++ serviceWorkers

let efficiency = Economy.distribute population economy

let totalPollution = Pollution.sum [ harvestPollution, refinementPollution, productionPollution ]

-- calculate score from efficiency & totalPollution. Record historical data for everything in scope here

Resources

Material Extraction visualization

gregziegan commented 3 years ago

We'll also need some accounting for pollution control