{
 "format": "stockflow-1",
 "id": "lib-cobra-effect",
 "name": "The cobra effect",
 "notes": "A well-known story (it may be partly legend) says a city once had too many cobras and paid a reward for each dead one. People soon bred cobras to earn the reward. When the city noticed and stopped paying, the breeders released their now-worthless snakes, and there were more cobras than before. Economists use the story to warn that rewards can create the very thing they try to remove. Watch Wild_Snakes before month 6 and after the reward ends. Try: end the reward earlier or later. Time unit: months.",
 "sim": {
  "start": 0,
  "stop": 60,
  "dt": 0.25,
  "unit": "months"
 },
 "elements": [
  {
   "id": "c1",
   "type": "stock",
   "name": "Wild_Snakes",
   "eq": "10000",
   "x": 360,
   "y": 220,
   "units": "snakes",
   "doc": "Snakes living wild in the city.",
   "nonneg": true
  },
  {
   "id": "c2",
   "type": "stock",
   "name": "Bred_Snakes",
   "eq": "0",
   "x": 360,
   "y": 520,
   "units": "snakes",
   "doc": "Snakes people keep and breed to collect the reward.",
   "nonneg": true
  },
  {
   "id": "c3",
   "type": "flow",
   "name": "Wild_Births",
   "eq": "Wild_Snakes*0.04*(1 - Wild_Snakes/10000)",
   "from": null,
   "to": "c1",
   "fx": 120,
   "fy": 220,
   "units": "snakes/month",
   "doc": "Snakes born in the wild; fewer when the city is crowded with snakes.",
   "biflow": false
  },
  {
   "id": "c4",
   "type": "flow",
   "name": "Caught_for_Reward",
   "eq": "Wild_Snakes*Catch_Rate*Reward_On",
   "from": "c1",
   "to": null,
   "tx": 620,
   "ty": 160,
   "units": "snakes/month",
   "doc": "Wild snakes caught and handed in.",
   "biflow": false
  },
  {
   "id": "c5",
   "type": "flow",
   "name": "Breeding",
   "eq": "Bred_Snakes*0.08 + Starting_Farms*Reward_On",
   "from": null,
   "to": "c2",
   "fx": 120,
   "fy": 520,
   "units": "snakes/month",
   "doc": "New snakes bred on farms. People start breeding once the reward makes it pay.",
   "biflow": false
  },
  {
   "id": "c6",
   "type": "flow",
   "name": "Bred_Handed_In",
   "eq": "Bred_Snakes*0.07*Reward_On",
   "from": "c2",
   "to": null,
   "tx": 620,
   "ty": 600,
   "units": "snakes/month",
   "doc": "Bred snakes killed and handed in for the reward.",
   "biflow": false
  },
  {
   "id": "c7",
   "type": "flow",
   "name": "Released",
   "eq": "Bred_Snakes*0.5*(1 - Reward_On)",
   "from": "c2",
   "to": "c1",
   "units": "snakes/month",
   "doc": "When the reward stops, the snakes are worthless and people let them go.",
   "biflow": false
  },
  {
   "id": "c8",
   "type": "aux",
   "name": "Reward_On",
   "eq": "IF TIME >= Reward_Start AND TIME < Reward_End THEN 1 ELSE 0",
   "x": 620,
   "y": 360,
   "units": "1 = yes",
   "doc": "Whether the city pays a reward."
  },
  {
   "id": "c9",
   "type": "aux",
   "name": "Reward_Start",
   "eq": "6",
   "x": 820,
   "y": 280,
   "units": "month",
   "doc": "When the reward starts."
  },
  {
   "id": "c10",
   "type": "aux",
   "name": "Reward_End",
   "eq": "30",
   "x": 820,
   "y": 420,
   "units": "month",
   "doc": "When the city stops the reward.",
   "slider": {
    "min": 12,
    "max": 60,
    "step": 1,
    "kind": "decision"
   }
  },
  {
   "id": "c11",
   "type": "aux",
   "name": "Catch_Rate",
   "eq": "0.03",
   "x": 620,
   "y": 60,
   "units": "per month",
   "doc": "Share of wild snakes caught each month while the reward is paid.",
   "slider": {
    "min": 0,
    "max": 0.1,
    "step": 0.005,
    "kind": "assumption"
   }
  },
  {
   "id": "c12",
   "type": "aux",
   "name": "Starting_Farms",
   "eq": "150",
   "x": 120,
   "y": 380,
   "units": "snakes/month",
   "doc": "Snakes people start breeding each month while the reward is paid.",
   "slider": {
    "min": 0,
    "max": 500,
    "step": 10,
    "kind": "assumption"
   }
  },
  {
   "id": "c13",
   "type": "aux",
   "name": "Snakes_Paid_For",
   "eq": "Caught_for_Reward + Bred_Handed_In",
   "x": 820,
   "y": 560,
   "units": "snakes/month",
   "doc": "Snakes the city pays for."
  }
 ],
 "plots": [
  "c1",
  "c2",
  "c13"
 ],
 "summary": {
  "kpis": [
   {
    "name": "Wild_Snakes",
    "agg": "final",
    "label": "Wild snakes at the end",
    "better": "low",
    "format": "num"
   },
   {
    "name": "Snakes_Paid_For",
    "agg": "total",
    "label": "Snakes the city paid for",
    "better": "low",
    "format": "num"
   }
  ]
 }
}