{
 "format": "stockflow-1",
 "id": "lib-rabbits-foxes",
 "name": "Rabbits and foxes",
 "notes": "Rabbits multiply. More rabbits mean food for foxes, so foxes multiply too. Many foxes eat many rabbits, rabbits become scarce, foxes go hungry and die back, and the rabbits recover. The two populations chase each other in waves, the foxes always a little behind. Try: what happens if foxes hunt better (Hunting_Success)? Does it end with more or fewer foxes? Time unit: months (10 years).",
 "sim": {
  "start": 0,
  "stop": 120,
  "dt": 0.125,
  "unit": "months"
 },
 "elements": [
  {
   "id": "f1",
   "type": "stock",
   "name": "Rabbits",
   "eq": "200",
   "x": 360,
   "y": 200,
   "units": "rabbits",
   "doc": "Rabbits in the area.",
   "nonneg": true
  },
  {
   "id": "f2",
   "type": "stock",
   "name": "Foxes",
   "eq": "10",
   "x": 360,
   "y": 480,
   "units": "foxes",
   "doc": "Foxes in the area.",
   "nonneg": true
  },
  {
   "id": "f3",
   "type": "flow",
   "name": "Rabbit_Births",
   "eq": "Rabbits*Rabbit_Birth_Rate*MAX(0, 1 - Rabbits/Meadow_Size)",
   "from": null,
   "to": "f1",
   "fx": 140,
   "fy": 200,
   "units": "rabbits/month",
   "doc": "New rabbits. Fewer when the meadow gets crowded.",
   "biflow": false
  },
  {
   "id": "f4",
   "type": "flow",
   "name": "Rabbits_Eaten",
   "eq": "Rabbits*Foxes*Hunting_Success",
   "from": "f1",
   "to": null,
   "tx": 600,
   "ty": 200,
   "units": "rabbits/month",
   "doc": "Rabbits caught by foxes. More foxes and more rabbits mean more catches.",
   "biflow": false
  },
  {
   "id": "f5",
   "type": "flow",
   "name": "Fox_Births",
   "eq": "Rabbits_Eaten*Fox_Babies_per_Rabbit",
   "from": null,
   "to": "f2",
   "fx": 140,
   "fy": 480,
   "units": "foxes/month",
   "doc": "Well-fed foxes raise more cubs.",
   "biflow": false
  },
  {
   "id": "f6",
   "type": "flow",
   "name": "Fox_Deaths",
   "eq": "Foxes*Fox_Death_Rate",
   "from": "f2",
   "to": null,
   "tx": 600,
   "ty": 480,
   "units": "foxes/month",
   "doc": "Foxes dying of age, hunger or disease.",
   "biflow": false
  },
  {
   "id": "f7",
   "type": "aux",
   "name": "Rabbit_Birth_Rate",
   "eq": "0.25",
   "x": 160,
   "y": 80,
   "units": "per month",
   "doc": "New rabbits per rabbit per month when there is plenty of space.",
   "slider": {
    "min": 0.05,
    "max": 0.6,
    "step": 0.01,
    "kind": "assumption"
   }
  },
  {
   "id": "f8",
   "type": "aux",
   "name": "Meadow_Size",
   "eq": "2000",
   "x": 360,
   "y": 60,
   "units": "rabbits",
   "doc": "Most rabbits the meadow can feed.",
   "slider": {
    "min": 500,
    "max": 5000,
    "step": 100,
    "kind": "assumption"
   }
  },
  {
   "id": "f9",
   "type": "aux",
   "name": "Hunting_Success",
   "eq": "0.0015",
   "x": 620,
   "y": 340,
   "units": "per fox per month",
   "doc": "Chance per month that a given fox catches a given rabbit.",
   "slider": {
    "min": 0.0005,
    "max": 0.004,
    "step": 0.0001,
    "kind": "assumption"
   }
  },
  {
   "id": "f10",
   "type": "aux",
   "name": "Fox_Babies_per_Rabbit",
   "eq": "0.08",
   "x": 160,
   "y": 340,
   "units": "foxes per rabbit",
   "doc": "Fox cubs raised per rabbit eaten.",
   "slider": {
    "min": 0.02,
    "max": 0.2,
    "step": 0.01,
    "kind": "assumption"
   }
  },
  {
   "id": "f11",
   "type": "aux",
   "name": "Fox_Death_Rate",
   "eq": "0.1",
   "x": 620,
   "y": 600,
   "units": "per month",
   "doc": "Share of foxes that die each month.",
   "slider": {
    "min": 0.02,
    "max": 0.3,
    "step": 0.01,
    "kind": "assumption"
   }
  }
 ],
 "plots": [
  "f1",
  "f2"
 ],
 "summary": {
  "kpis": [
   {
    "name": "Rabbits",
    "agg": "min",
    "label": "Fewest rabbits",
    "better": "high",
    "format": "num"
   },
   {
    "name": "Foxes",
    "agg": "max",
    "label": "Most foxes",
    "better": "high",
    "format": "num"
   }
  ]
 }
}