Discord
@gmorinan/snowpiercer
Simulation
1
3
Public

Snowpiercer

Simulation of a society living entirely within one train. The concept and hyper-parameters of this model are based upon the Snowpiercer TV series (https://en.wikipedia.org/wiki/Snowpiercer(TVseries)).

This is an agent based simulation model of a society living entirely within one train. The concept and hyperparameters of this model are based upon the Snowpiercer TV series.

BACKGROUND / LORE

The premise of Snowpiercer is that a climate catastrophy has caused a new ice age and wiped out nearly all of humankind. The remnants of humanity survive by living on a 1 train that perpetually circles the Earth. This train is split into 4 classes: first class (upper class), second class (middle class), third class (working class), and the stowaways who are referred to as 'the tail' (underclass).

The default hyperparameters for this model are based upon the information given to viewers of the TV series. For computational ease we divide all numbers by 10, so in this model 1 passenger, or 1 carraige, is meant to represent 10.

Here are the numbers provided by the TV show, and therefore the basis for the default hyperparameters of this model:

  • There are 3000 passengers (hence 300 in our model)
  • 400 of these are in the tail (hence 40 in our model)
  • The tail + third class makes up 70% of passengers, from this we can infer that third class is 1700 passengers (hence 170 in our model)
  • This leaves 900 passengers in first and second class (lacking anymore information, we are left to make an assumption that this is split 650/250, hence 65/25 in our model)
  • The train has 1001 carriages, although many of these are dedicated to growing crops and raising livestock (lacking anymore information, we assume that only 480 carraiges are used for human habitation, hence there are 48 carriages in the train blueprint used in this model)
  • We are not given details about the exact number of carraiges occupied by each class, although it is clear that the ratio of people to carriages is lowest in first and highest in the tail (lacking anymore information we assign 1 carraige to the tail, 14 to third class, 9 to second, and 6 to first, which means first class has by far the lowest ratio of people to carriages).
  • We also know there are some number of train guards, who are generally seen patrolling third class, sometimes in second class, but never seen routinely patrolling first or the tail (hence in our experimentation we only have guards in third and second)

GLOBALS: SETUP

The "setup" global determine the layout of the train at time zero. The train is split into classes (by default 4). Each input within "setup" (with the exception of "blueprint") should be a list of length equal to the number of classes.

Within "setup":

  • "class_numbers" determines how many passengers will belong to each class.
  • "car_ids" determines which spaces on the train blueprint belong to each class, for every value in "blueprint" that matches one of the entries, it is possible for a passenger to be placed in that space.
  • "wall_colors" determines the RGB color of the walls, each class of the train has different colored walls.
  • "wall_ids" determines where to place walls, for every value in "blueprint" that matches one of the entries, a wall will be placed.
  • "blueprint" points to the map of how the train should be setup, this map should be a 2D array containing values in the range 0-255.

EXAMPLE: the first entry of the "setup" lists correspond to the stowaway class, so the default inputs mean;

  • there are 40 agents in this class
  • they can start in any space where the blueprint is 254
  • walls around the stoaway carraigs appear where the blueprint is 4
  • and these walls will have an RGB value of (25,25,25)

GLOBALS: ATTRIBUTES

The "attr" global determines the attributes of the passenger agents created within the model (additional dummy agents are created to represent walls, but these have no adjustable attributes).

The "mood" attributes determines the calculations for the core mechanic of this model, which is the mood of each passenger, ranging 0-1. The mood of passengers changes randomly, but is more likely to decrease when there is overcrowding.

Within "attr":

  • "behaviors" lists the behaviors to assign to passengers.
  • "color_happy" the RGB value for passengers when their mood is at the maxmimum of 1.
  • "color_unhappy" the RGB value for passengers when their mood is at the minimum of 0. (Note that passengers with a mood between 0 and 1 will have an RGB value that is the weighted average of happy & unhappy inputs).
  • "mood_incr" controls how mood decreases when there is overcrowding.
  • "mood_baseline" controls how mood increases if there is no overcrowding.
  • "mood_edge" controls the minimum randomness each iteration.

SCRIPTS

The following scripts contain the model instructions:

  • "create_passengers.py" determines the intial placement of passengers
  • "create_walls.py" determines the placement of walls
  • "move.py" determines how passengers/guards move around the train (and avoid walls)
  • "proximity.py" determines how passengers interact with neighboring passengers (i.e. sending messages to reduce their mood, to represent the negative affect of overcrowding)
  • "update_mood.py" calculates how the mood of a passenger changes, based upon the messages they have received

EXPERIMENTS

Two scenarios have been included, in order to examine how different setups can affect the average mood of the passengers over time.

These two scenarios are:

  • Normal scenario described above where there are four classes, correpsonding to what we see on the TV series
  • Alternative scenario where there is only one class and all passengers are distributed randomly with the same probability.

These scenarios run for 365 time increments.

AUTHOR

This repository was authored by Gareth Morinan, with thanks to the team at HASH