(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 59960, 1359] NotebookOptionsPosition[ 58481, 1304] NotebookOutlinePosition[ 59164, 1330] CellTagsIndexPosition[ 59121, 1327] WindowTitle->Predator-Prey Ecosystem: A Real-Time Agent-Based Simulation - \ Source WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Predator-Prey Ecosystem: A Real-Time Agent-Based Simulation", "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False, FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[BoxData[ GraphicsBox[RasterBox[CompressedData[" 1:eJztnVuSozgWQDNiPqa3MJ+zpVlCbaB3WlGVNV9dvYH6TQRUph/ZGIHQmwvG xoZzQu3Aku7VfUj4Nk53//fLn//78q+Xl5f/NP/88e+Xl8v154Xj5+fp89y0 4+X63L7VnQu02XqOt9FzjRK5qtRMoYZFpk11/Ji+WDye92+r7+fFfbnGkuu9 eIQ4LBVJ+YRo5DPnRdITDp0TLRg6m/62nY/n08f5+H461G37fWqum57z4Xy2 jby0prMZOh4/jodLOx2bt6fzRSEA3B/KMKGSBy/DSKVcyYOn8krHqajvqed6 G6iol4qkfAIVNQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADsizPA/lj72AEA AMCmWLu0AXh01j6jAAAAcdb+hNwUJ5e1zZnPDEeey/e1jx0AAABsirVLm03x XFVlhs1X1JNY+4wCAAB02B9PJ4BdsvYpBAAAgOeGihpADo9GAUDIr+Lnr7ef a9vw16/i73VtMPx6+2v1gGwMijeAE89FAQA2DRW1BxX14lBRA0wi+lx0baMA AAAAAAAAAAAAbkj0uegR4L4cDoe1TYA1YQMAbIaDy9rm3JU9+w4AjwB3np3D BgDYDHuuKu/su3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riorIU2xkjYjQi2hJFjXeFvFmhjeNUWu9HhO3/LQoe8tdSKqC ys+f+tE5aZVoBSU0T87U+sr2emq4Ur7k9eQrhydiaqiF3LqSX4QFfacMk684 yaT7l2GkUr7iJJOoqKMrUlGPritxZ9RyT9aIUFHn133e3IVQUQvVUlHPhor6 1r6r/k9G9X1A/47+dDrZ/9+lb9++vbr8+PHDe7X7w077rafHU+JNTo1GF/Wu U52hhtCjqGEZJVGdoZsp5ZmZoRe2kc3Fd0tnKGKvJQ9UKr8pRh15dY0MZTOO e/pTa43OSUmFpn5Pbzzv7agveTNCJRnZ70FCX4OU5ZWn9KfiELrpLZ3aIZn0 RYmGN+NRPsIpd7y19pa7qIhQZ15coicVmamMLjpb1SLmLUgmzlOtzau6RRAm bYxFTJoh9Vy+U4aNKonqDN1MKc/MDL2wjXydWIaRylElz5LKVExSS2Scigqm HHl1jQxlM457+lNrjc5JSYWmUlF7jqQ2RmqHZNIXJRrejEf5CKfc8dbaW+6i IkKdeXGJnlRkpjK66GxVi5i3IJk4T7U2r+oWQZi0MRYxaYbUZnyPLvH/lte2 FP/69esnAAAAAAAAAAAAwM74B4thROM= "], {{0, 0}, {1800, 25}}, {0, 255}, ColorFunction->RGBColor], ImageSize->{1800, 25}, PlotRange->{{0, 1800}, {0, 25}}]], "Section", CellFrame->{{0, 0}, {0, 0}}, ShowCellBracket->False], Cell[BoxData[{ RowBox[{ RowBox[{"Fox", "=", "1."}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Rabbit", "=", "2."}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"maxRabbits", "=", "500."}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"maxFoxes", "=", "500."}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dummyPoint", "=", RowBox[{"{", RowBox[{ RowBox[{"-", "1."}], ",", RowBox[{"-", "1."}]}], "}"}]}], ";"}]}], "Input", CellChangeTimes->{{3.403283674203125*^9, 3.403283698984375*^9}, { 3.413062283015625*^9, 3.413062284125*^9}, {3.4130623660625*^9, 3.413062376828125*^9}, {3.4131001863125*^9, 3.413100190609375*^9}, { 3.413221055828125*^9, 3.413221057203125*^9}, {3.413222851015625*^9, 3.4132228525*^9}, {3.413223074015625*^9, 3.413223081828125*^9}, { 3.413223315171875*^9, 3.41322331828125*^9}}, Magnification->1., CellID->12186613], Cell[BoxData[ RowBox[{ RowBox[{"initialAgents", "[", "]"}], ":=", RowBox[{"Developer`ToPackedArray", "[", "\[IndentingNewLine]", RowBox[{"Table", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Join", "[", StyleBox["\[IndentingNewLine]", FontColor->GrayLevel[0]], RowBox[{ RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", "2"}], "]"}], ",", RowBox[{"(*", " ", "Location", " ", "*)"}], "\[IndentingNewLine]", RowBox[{"{", RowBox[{"0.", ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"RandomReal", "[", "]"}], "<", "0.1"}], ",", "Fox", ",", "Rabbit"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", StyleBox[",", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"{", "100", "}"}], FontColor->GrayLevel[0]]}], StyleBox["\[IndentingNewLine]", FontColor->GrayLevel[0]], "]"}], "\[IndentingNewLine]", "]"}]}]], "Input",\ CellChangeTimes->{{3.403283674203125*^9, 3.403283698984375*^9}, { 3.413062283015625*^9, 3.413062284125*^9}, {3.4130623660625*^9, 3.413062369828125*^9}, {3.413099385046875*^9, 3.413099400484375*^9}, { 3.413099431953125*^9, 3.413099435640625*^9}, {3.413221069765625*^9, 3.413221103875*^9}, {3.4132212468125*^9, 3.41322126115625*^9}, { 3.413222073734375*^9, 3.413222074203125*^9}, 3.413227762890625*^9}, Magnification->1., CellID->179304614], Cell[BoxData[ RowBox[{ RowBox[{"visualize", "[", "agents_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"foxes", "=", RowBox[{ RowBox[{ RowBox[{"Take", "[", RowBox[{"#", ",", "2"}], "]"}], "&"}], "/@", RowBox[{"Select", "[", RowBox[{"agents", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "4", "]"}], "]"}], "\[Equal]", "Fox"}], ")"}], "&"}]}], "]"}]}]}], ",", RowBox[{"rabbits", "=", RowBox[{ RowBox[{ RowBox[{"Take", "[", RowBox[{"#", ",", "2"}], "]"}], "&"}], "/@", RowBox[{"Select", "[", RowBox[{"agents", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "4", "]"}], "]"}], "\[Equal]", "Rabbit"}], ")"}], "&"}]}], "]"}]}]}], ",", RowBox[{"dummyList", "=", RowBox[{"{", "dummyPoint", "}"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Show", "[", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Plotting", " ", "foxes"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Graphics", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"AbsolutePointSize", "[", "10", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".9", ",", ".42", ",", ".17"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Point", "@", RowBox[{"If", "[", RowBox[{ RowBox[{"foxes", "\[Equal]", RowBox[{"{", "}"}]}], ",", "dummyList", ",", "foxes"}], "]"}]}]}], "\[IndentingNewLine]", "}"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Plotting", " ", "rabbits"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Graphics", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"AbsolutePointSize", "[", "10", "]"}], ",", RowBox[{"RGBColor", "[", RowBox[{".48", ",", ".11", ",", ".56"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Point", "@", RowBox[{"If", "[", RowBox[{ RowBox[{"rabbits", "\[Equal]", RowBox[{"{", "}"}]}], ",", "dummyList", ",", "rabbits"}], "]"}]}]}], "\[IndentingNewLine]", "}"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"ImageSize", "\[Rule]", RowBox[{"{", RowBox[{"375", ",", "375"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", "\[IndentingNewLine]", RowBox[{"Frame", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"Axes", "\[Rule]", "False"}], ",", "\[IndentingNewLine]", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.40328370721875*^9, 3.4032837329375*^9}, { 3.40353796284375*^9, 3.40353801059375*^9}, {3.40353804496875*^9, 3.403538066390625*^9}, {3.4130644830625*^9, 3.413064552640625*^9}, { 3.4130999793125*^9, 3.41309998003125*^9}, {3.4131000239375*^9, 3.413100025046875*^9}, {3.413118589519039*^9, 3.4131186158157454`*^9}, { 3.413221163671875*^9, 3.413221202890625*^9}, {3.4132212821875*^9, 3.4132213226875*^9}, {3.41322135325*^9, 3.413221386125*^9}, { 3.413221483109375*^9, 3.41322148471875*^9}, {3.413223089171875*^9, 3.413223090890625*^9}, 3.413227759421875*^9, {3.413228403471799*^9, 3.4132284198001328`*^9}, {3.413228467503868*^9, 3.4132284798790264`*^9}}, CellID->581179032], Cell[BoxData[ RowBox[{ RowBox[{"updateAgents", "[", RowBox[{ "agents_", ",", "rabbitGrowthRate_", ",", "rabbitMobility_", ",", "foxGrowthRate_", ",", "foxMobility_", ",", "foxEndurance_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"foxPop", "=", RowBox[{"Length", "[", RowBox[{"Select", "[", RowBox[{"agents", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "4", "]"}], "]"}], "\[Equal]", "Fox"}], ")"}], "&"}]}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"rabbitPop", "=", RowBox[{"Length", "[", RowBox[{"Select", "[", RowBox[{"agents", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "4", "]"}], "]"}], "\[Equal]", "Rabbit"}], ")"}], "&"}]}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"nearestFoxes", "=", RowBox[{"Nearest", "[", RowBox[{"Append", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Take", "[", RowBox[{"#", ",", "2"}], "]"}], "&"}], "/@", RowBox[{"Select", "[", RowBox[{"agents", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "4", "]"}], "]"}], "\[Equal]", "Fox"}], ")"}], "&"}]}], "]"}]}], ",", "dummyPoint"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"nearestRabbits", "=", RowBox[{"Nearest", "[", RowBox[{"Append", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Take", "[", RowBox[{"#", ",", "2"}], "]"}], "&"}], "/@", RowBox[{"Select", "[", RowBox[{"agents", ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"#", "[", RowBox[{"[", "4", "]"}], "]"}], "\[Equal]", "Rabbit"}], ")"}], "&"}]}], "]"}]}], ",", "dummyPoint"}], "]"}], "]"}]}], ",", "\[IndentingNewLine]", "i", ",", "nextLocation", ",", "survivors"}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Table", "[", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"survivors", "=", RowBox[{"{", "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"nextLocation", " ", "=", RowBox[{ RowBox[{"agents", "[", RowBox[{"[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"1", ",", "2"}], "}"}]}], "]"}], "]"}], "+", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"agents", "[", RowBox[{"[", RowBox[{"i", ",", "4"}], "]"}], "]"}], "\[Equal]", "Rabbit"}], ",", "\[IndentingNewLine]", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "rabbitMobility"}], ",", "rabbitMobility"}], "}"}], ",", "2"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "foxMobility"}], ",", "foxMobility"}], "}"}], ",", "2"}], "]"}]}], "\[IndentingNewLine]", "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"nextLocation", "=", RowBox[{"Clip", "[", RowBox[{"nextLocation", ",", RowBox[{"{", RowBox[{"0.", ",", "1."}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"agents", "[", RowBox[{"[", RowBox[{"i", ",", "4"}], "]"}], "]"}], "\[Equal]", "Rabbit"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"rabbits", "'"}], " ", "behavior"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{ RowBox[{"nearestFoxes", "[", "nextLocation", "]"}], "[", RowBox[{"[", "1", "]"}], "]"}], "-", "nextLocation"}], "]"}], ">", "0.02"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"survivors", "=", RowBox[{"{", RowBox[{"Join", "[", RowBox[{"nextLocation", ",", RowBox[{"{", RowBox[{"0.", ",", "Rabbit"}], "}"}]}], "]"}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"RandomReal", "[", "]"}], "<", RowBox[{"rabbitGrowthRate", RowBox[{"(", RowBox[{"1.", "-", RowBox[{"rabbitPop", "/", "maxRabbits"}]}], ")"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"AppendTo", "[", RowBox[{"survivors", ",", RowBox[{"Join", "[", RowBox[{"nextLocation", ",", RowBox[{"{", RowBox[{"0.", ",", "Rabbit"}], "}"}]}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], RowBox[{"(*", " ", RowBox[{ RowBox[{ "Probabilistic", " ", "reproduction", " ", "with", " ", "logistic", " ", "growth", " ", "restriction"}], ";", " ", RowBox[{"adding", " ", "one", " ", "more", " ", "rabbit"}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"foxes", "'"}], " ", "behavior"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Norm", "[", RowBox[{ RowBox[{ RowBox[{"nearestRabbits", "[", "nextLocation", "]"}], "[", RowBox[{"[", "1", "]"}], "]"}], "-", "nextLocation"}], "]"}], ">", "0.02"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"agents", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], "<", "foxEndurance"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "starving", " ", "but", " ", "still", " ", "survive"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"survivors", "=", RowBox[{"{", RowBox[{"Join", "[", RowBox[{"nextLocation", ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"agents", "[", RowBox[{"[", RowBox[{"i", ",", "3"}], "]"}], "]"}], "+", "1."}], ",", "Fox"}], "}"}]}], "]"}], "}"}]}], ";"}]}], "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"just", " ", "ate", " ", "rabbit", RowBox[{"(", "s", ")"}], " ", "and", " ", "survive"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"survivors", "=", RowBox[{"{", RowBox[{"Join", "[", RowBox[{"nextLocation", ",", RowBox[{"{", RowBox[{"0.", ",", "Fox"}], "}"}]}], "]"}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"RandomReal", "[", "]"}], "<", RowBox[{"foxGrowthRate", RowBox[{"(", RowBox[{"1.", "-", RowBox[{"foxPop", "/", "maxFoxes"}]}], ")"}]}]}], ",", "\[IndentingNewLine]", RowBox[{"AppendTo", "[", RowBox[{"survivors", ",", RowBox[{"Join", "[", RowBox[{"nextLocation", ",", RowBox[{"{", RowBox[{"0.", ",", "Fox"}], "}"}]}], "]"}]}], "]"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], RowBox[{"(*", " ", RowBox[{ RowBox[{"Probabilistic", " ", "reproduction"}], ";", " ", RowBox[{"adding", " ", "one", " ", "more", " ", "fox"}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "survivors"}], "\[IndentingNewLine]", "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"i", ",", RowBox[{"Length", "[", "agents", "]"}]}], "}"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}], "//", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"#", ",", "1"}], "]"}], "&"}]}], "//", "Developer`ToPackedArray"}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.403283750546875*^9, 3.403283802375*^9}, { 3.41306236253125*^9, 3.413062402359375*^9}, {3.41306255884375*^9, 3.41306255965625*^9}, {3.41306268046875*^9, 3.413062707390625*^9}, { 3.41306273803125*^9, 3.413062805484375*^9}, {3.41306293971875*^9, 3.413062963265625*^9}, {3.413099488609375*^9, 3.413099542859375*^9}, { 3.413099590421875*^9, 3.413099700265625*^9}, {3.41310020765625*^9, 3.413100225046875*^9}, {3.413100415375*^9, 3.41310044275*^9}, { 3.41322154271875*^9, 3.41322158865625*^9}, {3.413221657125*^9, 3.413221662265625*^9}, {3.4132216996875*^9, 3.413221888265625*^9}, { 3.413221924609375*^9, 3.413222011984375*^9}, {3.4132221054375*^9, 3.413222121390625*^9}, {3.4132225985625*^9, 3.413222603375*^9}, { 3.413222665109375*^9, 3.413222835875*^9}, {3.41322293215625*^9, 3.413222952546875*^9}, {3.41322301365625*^9, 3.413223068125*^9}, { 3.413223235265625*^9, 3.413223235640625*^9}, {3.413224105453125*^9, 3.413224137109375*^9}, {3.41322416878125*^9, 3.413224274625*^9}, { 3.413224376765625*^9, 3.413224500703125*^9}, {3.413224658015625*^9, 3.413224735515625*^9}, {3.413226205375*^9, 3.413226239234375*^9}, 3.41322775375*^9, 3.41322783728125*^9}, CellID->323996531], Cell[BoxData[ RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Refresh", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{"moving", ",", RowBox[{"ag", "=", RowBox[{"updateAgents", "[", RowBox[{ "ag", ",", "rabbitGrowthRate", ",", "rabbitMobility", ",", "foxGrowthRate", ",", "foxMobility", ",", "foxEndurance"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"visualize", "[", "ag", "]"}]}], "\[IndentingNewLine]", ",", RowBox[{"UpdateInterval", "\[Rule]", RowBox[{"If", "[", RowBox[{"moving", ",", "0", ",", "Infinity"}], "]"}]}]}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "rabbitGrowthRate", ",", "0.5", ",", "\"\\""}], "}"}], ",", "0", ",", "1", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "rabbitMobility", ",", "0.03", ",", "\"\\""}], "}"}], ",", "0", ",", "0.05", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "foxGrowthRate", ",", "0.5", ",", "\"\\""}], "}"}], ",", "0", ",", "1", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"foxMobility", ",", "0.05", ",", "\"\\""}], "}"}], ",", "0", ",", "0.05", ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ "foxEndurance", ",", "10", ",", "\"\\""}], "}"}], ",", "1", ",", "20", ",", "1", ",", RowBox[{"Appearance", "\[Rule]", "\"\\""}], ",", RowBox[{"ImageSize", "\[Rule]", "Tiny"}]}], "}"}], "\[IndentingNewLine]", ",", "\"\< \>\"", "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"moving", ",", "False", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"True", ",", " ", "False"}], "}"}]}], "}"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"ag", ",", RowBox[{"initialAgents", "[", "]"}]}], "}"}], ",", RowBox[{"ControlType", "\[Rule]", "None"}]}], "}"}], "\[IndentingNewLine]", ",", "\"\< \>\"", "\[IndentingNewLine]", ",", RowBox[{"Button", "[", RowBox[{"\"\\"", ",", RowBox[{ RowBox[{"moving", "=", "False"}], ";", RowBox[{"ag", "=", RowBox[{"initialAgents", "[", "]"}]}]}], ",", RowBox[{"ImageSize", "\[Rule]", "Medium"}]}], "]"}], "\[IndentingNewLine]", ",", RowBox[{"SaveDefinitions", "\[Rule]", "True"}], ",", RowBox[{"AutorunSequencing", "\[Rule]", RowBox[{"{", "6", "}"}]}], ",", RowBox[{"TrackedSymbols", "\[RuleDelayed]", RowBox[{"{", RowBox[{"moving", ",", "ag"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"SynchronousUpdating", "\[Rule]", "True"}], ",", RowBox[{"ControlPlacement", "\[Rule]", "Left"}]}], "\[IndentingNewLine]", "]"}]], "Input", CellChangeTimes->{ 3.35696210375764*^9, {3.39277061965625*^9, 3.39277063709375*^9}, { 3.3930946172472615`*^9, 3.3930946192628736`*^9}, {3.393094659184493*^9, 3.3930948089335346`*^9}, {3.3930948869642854`*^9, 3.393094887479907*^9}, { 3.393095032150856*^9, 3.3930950693849926`*^9}, {3.3930951177128086`*^9, 3.393095161290655*^9}, {3.3930952078841066`*^9, 3.393095214712188*^9}, { 3.393134960328125*^9, 3.393135005484375*^9}, {3.393135098*^9, 3.393135100078125*^9}, {3.39313547115625*^9, 3.3931354996875*^9}, { 3.393135575234375*^9, 3.39313560240625*^9}, {3.393135647171875*^9, 3.39313566171875*^9}, {3.3931357040625*^9, 3.393135787375*^9}, { 3.393135846203125*^9, 3.393135880734375*^9}, {3.39313612671875*^9, 3.393136137703125*^9}, {3.393344439705454*^9, 3.3933444403617*^9}, { 3.394886271114541*^9, 3.3948862820833616`*^9}, {3.402225005859375*^9, 3.402225006109375*^9}, {3.413051118296875*^9, 3.413051124171875*^9}, { 3.41305125675*^9, 3.41305125796875*^9}, {3.41305133225*^9, 3.413051332609375*^9}, {3.413062440140625*^9, 3.413062481390625*^9}, { 3.4130628313125*^9, 3.413062919765625*^9}, {3.41306297046875*^9, 3.41306297765625*^9}, {3.413063013359375*^9, 3.4130630324375*^9}, { 3.413063245484375*^9, 3.41306325865625*^9}, 3.413063613109375*^9, { 3.41309974571875*^9, 3.413099843921875*^9}, {3.41310007334375*^9, 3.413100074046875*^9}, {3.413100464703125*^9, 3.413100466625*^9}, { 3.41310051540625*^9, 3.41310053109375*^9}, {3.413100691140625*^9, 3.413100714609375*^9}, {3.41310106871875*^9, 3.413101073921875*^9}, { 3.413118492816533*^9, 3.4131185644879494`*^9}, {3.4131247297262774`*^9, 3.4131247459764853`*^9}, {3.4131247797112923`*^9, 3.4131248370245256`*^9}, {3.41322235728125*^9, 3.41322235990625*^9}, { 3.413222414546875*^9, 3.4132224175625*^9}, 3.4135430135327787`*^9}, CellID->428012851] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`ag$$ = CompressedData[" 1:eJxllmlQ01cXxiMFW8EFeWklGBQVqYAaxFFpBM9fAXGAKEakKIsRUMSFJTMV pFEpDVYUKBYECoWBqizKYgEtr4QtQGVRoQRMZAkJWZCQTSlg3zdq+VpOZv6f fnNy7n3u85x714VGM04ZkEik8PnPcP5LvbXMODiJD3WuniHLmeNA+vePsJj0 snt6dwxqfn6uauYpEGd3vh0xuCgAXd/Xoj8ipIibJljJugu1sHixcI/STYX4 +gjHb4d7FCCjOeZUx2gRT4zKpNraSUE8yx64k1OF+NKdTSTvllGgsMYnbdPw +tl5bmFen6jAeTzFeqPlBOJ9edEOR3JqIN7dJ/wJ+zXi4sjzvezkOhDadz6r tJcv4DpIOqvr2D2jAf2FjwKG9xiqV1bn6dRZWog5ZO53QN+N97csOXrrgxao 2+a5YptEhPiLgkffcg9OgvjX1g+/7CtGnJmeu1Wf/QDWmw+bklPx+RSRN2wx aePCGcmSc32M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Ii JRTVTS42OfIQ8etTb9hdwUro6/jkyGJb7B/S1np55aFqeP14li69xUNcRjej ZnzUgDh6h39OfAnilJLbS4Mv9oP9Os+KG6ZYv6Lzi8bzv2yA10cD/LPmehDf tE721VTTMJCsF8XuiA5FXPT75t4Ynhxmq4DH+w3PP2Gn9E8zeg8QF/z84vLx /SoSnNmbQp737W5ZStAWDp4PPq22BVI5WFvdey/UNyDu77Sy/Pr/5t8PXTUv 7FyxPjH2+pjGq6PAOlR1VuGH12fqoqG7fNoP3MjjacJdQ3h+e9Buj0e2ADH3 ckouxvlhWgsEGvoY3DVcH7fy2DDiNlapspMsKSR2zGU/nUnEXJwVm/gTHzhG Yc53S3C+GXtp/b+yJmG9zLmr9zZ+v5Dot9UfTKqAyeRsd1fh8/1FWvrHV4wx cHINbJqJwv4k3C74pOpGoD9/omHJG9yfRC/N7E1iQdTam051s/j+J762eD9k oATLVcKI7avw/cSOU1Pfb3kFjjzKarUlzmdAh+LplFEr6M5dMm/nDuL+mz1y xxaVQX+xqfVfcXj/9bl3aocvSyDo9NWQd819+P0bNVyvPjkI71YH20U44vsl yVH4cnXs/NzddNho1iUV8QHq+aG043xga2tiDqzC6xMXLA9p8SiCd9Q9Ng2u vThfK5tdAp+NQGGljBxZuXC+6MA97MazbRYyiBk8abwqEPvnHxqHSDc= "], $CellContext`foxEndurance$$ = 10, $CellContext`foxGrowthRate$$ = 0.5, $CellContext`foxMobility$$ = 0.05, $CellContext`moving$$ = False, $CellContext`rabbitGrowthRate$$ = 0.5, $CellContext`rabbitMobility$$ = 0.03, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{{ Hold[$CellContext`rabbitGrowthRate$$], 0.5, "growth rate of rabbits"}, 0, 1}, {{ Hold[$CellContext`rabbitMobility$$], 0.03, "mobility of rabbits"}, 0, 0.05}, {{ Hold[$CellContext`foxGrowthRate$$], 0.5, "growth rate of foxes"}, 0, 1}, {{ Hold[$CellContext`foxMobility$$], 0.05, "mobility of foxes"}, 0, 0.05}, {{ Hold[$CellContext`foxEndurance$$], 10, "number of steps\nfoxes can survive\nwithout food"}, 1, 20, 1}, { Hold[" "], Manipulate`Dump`ThisIsNotAControl}, {{ Hold[$CellContext`moving$$], False, "run simulation"}, { True, False}}, {{ Hold[$CellContext`ag$$], CompressedData[" 1:eJxllmlQ01cXxiMFW8EFeWklGBQVqYAaxFFpBM9fAXGAKEakKIsRUMSFJTMV pFEpDVYUKBYECoWBqizKYgEtr4QtQGVRoQRMZAkJWZCQTSlg3zdq+VpOZv6f fnNy7n3u85x714VGM04ZkEik8PnPcP5LvbXMODiJD3WuniHLmeNA+vePsJj0 snt6dwxqfn6uauYpEGd3vh0xuCgAXd/Xoj8ipIibJljJugu1sHixcI/STYX4 +gjHb4d7FCCjOeZUx2gRT4zKpNraSUE8yx64k1OF+NKdTSTvllGgsMYnbdPw +tl5bmFen6jAeTzFeqPlBOJ9edEOR3JqIN7dJ/wJ+zXi4sjzvezkOhDadz6r tJcv4DpIOqvr2D2jAf2FjwKG9xiqV1bn6dRZWog5ZO53QN+N97csOXrrgxao 2+a5YptEhPiLgkffcg9OgvjX1g+/7CtGnJmeu1Wf/QDWmw+bklPx+RSRN2wx aePCGcmSc32M57g+kuKl3vAEOG7fUHfF4fMJ8qU51Cg04G9zTfOpSIK4okJp SXw+CZQbTpLoZCXS56GTQ9OaDC6EeJJm6qZluP8GypffC+d1O+ZpRl+Rgbhj /lLRov+2gv6Sn9NqP+yvzcYhA5laOYjvONeW67H+LSVHNXonOcT38G0D7r1E PHyZ1QmrGjWYVgRnXgtYuH4SsSa0WKe4NgW+/OlwT8MnaH/Ohmq37fsV4KOO uDkdOonqbV2G9kewJiAj0PSyWTfuTxj023TflIDvjzEpWy+1IB5Q94jfEfgn 6AhTd8aaZsQZuQ8qr1zRwI2mwnTeYdx/JOlWmKFcDceN1xKOP2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zGU/nUnEXJwVm/gTHzhG Yc53S3C+GXtp/b+yJmG9zLmr9zZ+v5Dot9UfTKqAyeRsd1fh8/1FWvrHV4wx cHINbJqJwv4k3C74pOpGoD9/omHJG9yfRC/N7E1iQdTam051s/j+J762eD9k oATLVcKI7avw/cSOU1Pfb3kFjjzKarUlzmdAh+LplFEr6M5dMm/nDuL+mz1y xxaVQX+xqfVfcXj/9bl3aocvSyDo9NWQd819+P0bNVyvPjkI71YH20U44vsl yVH4cnXs/NzddNho1iUV8QHq+aG043xga2tiDqzC6xMXLA9p8SiCd9Q9Ng2u vThfK5tdAp+NQGGljBxZuXC+6MA97MazbRYyiBk8abwqEPvnHxqHSDc= "]}}, { Hold[" "], Manipulate`Dump`ThisIsNotAControl}, { Hold[ Button[ "Reset", $CellContext`moving$$ = False; $CellContext`ag$$ = $CellContext`initialAgents[], ImageSize -> Medium]], Manipulate`Dump`ThisIsNotAControl}}, Typeset`size$$ = { 375., {185., 190.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = False, $CellContext`rabbitGrowthRate$776$$ = 0, $CellContext`rabbitMobility$777$$ = 0, $CellContext`foxGrowthRate$778$$ = 0, $CellContext`foxMobility$779$$ = 0, $CellContext`foxEndurance$780$$ = 0, $CellContext`moving$781$$ = False}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`ag$$ = CompressedData[" 1:eJxllmlQ01cXxiMFW8EFeWklGBQVqYAaxFFpBM9fAXGAKEakKIsRUMSFJTMV pFEpDVYUKBYECoWBqizKYgEtr4QtQGVRoQRMZAkJWZCQTSlg3zdq+VpOZv6f fnNy7n3u85x714VGM04ZkEik8PnPcP5LvbXMODiJD3WuniHLmeNA+vePsJj0 snt6dwxqfn6uauYpEGd3vh0xuCgAXd/Xoj8ipIibJljJugu1sHixcI/STYX4 +gjHb4d7FCCjOeZUx2gRT4zKpNraSUE8yx64k1OF+NKdTSTvllGgsMYnbdPw +tl5bmFen6jAe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8fm+2PzGwRAVt6r9hrE54/ZYpz172dxEBcm8prDMH1pz3+c7DhlRi4u94G hJ/C/tzj4zuS3fQadJdOOHRfxfWO9qR9Mzsegw1HlNO5VoD1b7T0jc0vBY2k sOPqE5zPvgmtzCX1N+j0OUzeP73Q3yTiL13Uxb2SCWCuCCRTzbE+6eP1zOIi JRTVTS42OfIQ8etTb9hdwUro6/jkyGJb7B/S1np55aFqeP14li69xUNcRjej ZnzUgDh6h39OfAnilJLbS4Mv9oP9Os+KG6ZYv6Lzi8bzv2yA10cD/LPmehDf tE721VTTMJCsF8XuiA5FXPT75t4Ynhxmq4DH+w3PP2Gn9E8zeg8QF/z84vLx /SoSnNmbQp737W5ZStAWDp4PPq22BVI5WFvdey/UNyDu77Sy/Pr/5t8PXTUv 7FyxPjH2+pjGq6PAOlR1VuGH12fqoqG7fNoP3MjjacJdQ3h+e9Buj0e2ADH3 ckouxvlhWgsEGvoY3DVcH7fy2DDiNlapspMsKSR2zGU/nUnEXJwVm/gTHzhG Yc53S3C+GXtp/b+yJmG9zLmr9zZ+v5Dot9UfTKqAyeRsd1fh8/1FWvrHV4wx cHINbJqJwv4k3C74pOpGoD9/omHJG9yfRC/N7E1iQdTam051s/j+J762eD9k oATLVcKI7avw/cSOU1Pfb3kFjjzKarUlzmdAh+LplFEr6M5dMm/nDuL+mz1y xxaVQX+xqfVfcXj/9bl3aocvSyDo9NWQd819+P0bNVyvPjkI71YH20U44vsl yVH4cnXs/NzddNho1iUV8QHq+aG043xga2tiDqzC6xMXLA9p8SiCd9Q9Ng2u vThfK5tdAp+NQGGljBxZuXC+6MA97MazbRYyiBk8abwqEPvnHxqHSDc= "], $CellContext`foxEndurance$$ = 10, $CellContext`foxGrowthRate$$ = 0.5, $CellContext`foxMobility$$ = 0.05, $CellContext`moving$$ = False, $CellContext`rabbitGrowthRate$$ = 0.5, $CellContext`rabbitMobility$$ = 0.03}, "ControllerVariables" :> { Hold[$CellContext`rabbitGrowthRate$$, \ $CellContext`rabbitGrowthRate$776$$, 0], Hold[$CellContext`rabbitMobility$$, $CellContext`rabbitMobility$777$$, 0], Hold[$CellContext`foxGrowthRate$$, $CellContext`foxGrowthRate$778$$, 0], Hold[$CellContext`foxMobility$$, $CellContext`foxMobility$779$$, 0], Hold[$CellContext`foxEndurance$$, $CellContext`foxEndurance$780$$, 0], Hold[$CellContext`moving$$, $CellContext`moving$781$$, False]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Refresh[If[$CellContext`moving$$, $CellContext`ag$$ = \ $CellContext`updateAgents[$CellContext`ag$$, $CellContext`rabbitGrowthRate$$, \ $CellContext`rabbitMobility$$, $CellContext`foxGrowthRate$$, \ $CellContext`foxMobility$$, $CellContext`foxEndurance$$]]; \ $CellContext`visualize[$CellContext`ag$$], UpdateInterval -> If[$CellContext`moving$$, 0, Infinity]], "Specifications" :> {{{$CellContext`rabbitGrowthRate$$, 0.5, "growth rate of rabbits"}, 0, 1, ImageSize -> Tiny}, {{$CellContext`rabbitMobility$$, 0.03, "mobility of rabbits"}, 0, 0.05, ImageSize -> Tiny}, {{$CellContext`foxGrowthRate$$, 0.5, "growth rate of foxes"}, 0, 1, ImageSize -> Tiny}, {{$CellContext`foxMobility$$, 0.05, "mobility of foxes"}, 0, 0.05, ImageSize -> Tiny}, {{$CellContext`foxEndurance$$, 10, "number of steps\nfoxes can survive\nwithout food"}, 1, 20, 1, Appearance -> "Labeled", ImageSize -> Tiny}, " ", {{$CellContext`moving$$, False, "run simulation"}, { True, False}}, {{$CellContext`ag$$, CompressedData[" 1:eJxllmlQ01cXxiMFW8EFeWklGBQVqYAaxFFpBM9fAXGAKEakKIsRUMSFJTMV pFEpDVYUKBYECoWBqizKYgEtr4QtQGVRoQRMZAkJWZCQTSlg3zdq+VpOZv6f fnNy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= "]}, ControlType -> None}, " ", Button[ "Reset", $CellContext`moving$$ = False; $CellContext`ag$$ = $CellContext`initialAgents[], ImageSize -> Medium]}, "Options" :> { AutorunSequencing -> {6}, TrackedSymbols :> {$CellContext`moving$$, $CellContext`ag$$}, SynchronousUpdating -> True, ControlPlacement -> Left}, "DefaultOptions" :> {ControllerLinking -> True}], ImageSizeCache->{648., {214., 219.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, Initialization:>(({$CellContext`updateAgents[ Pattern[$CellContext`agents, Blank[]], Pattern[$CellContext`rabbitGrowthRate, Blank[]], Pattern[$CellContext`rabbitMobility, Blank[]], Pattern[$CellContext`foxGrowthRate, Blank[]], Pattern[$CellContext`foxMobility, Blank[]], Pattern[$CellContext`foxEndurance, Blank[]]] := Module[{$CellContext`foxPop = Length[ Select[$CellContext`agents, Part[#, 4] == $CellContext`Fox& ]], $CellContext`rabbitPop = Length[ Select[$CellContext`agents, Part[#, 4] == $CellContext`Rabbit& ]], \ $CellContext`nearestFoxes = Nearest[ Append[ Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Fox& ]], $CellContext`dummyPoint]], \ $CellContext`nearestRabbits = Nearest[ Append[ Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Rabbit& ]], $CellContext`dummyPoint]], \ $CellContext`i, $CellContext`nextLocation, $CellContext`survivors}, Developer`ToPackedArray[ (Flatten[#, 1]& )[ Table[$CellContext`survivors = {}; $CellContext`nextLocation = Part[$CellContext`agents, $CellContext`i, {1, 2}] + If[Part[$CellContext`agents, $CellContext`i, 4] == $CellContext`Rabbit, RandomReal[{-$CellContext`rabbitMobility, \ $CellContext`rabbitMobility}, 2], RandomReal[{-$CellContext`foxMobility, \ $CellContext`foxMobility}, 2]]; $CellContext`nextLocation = Clip[$CellContext`nextLocation, {0., 1.}]; If[Part[$CellContext`agents, $CellContext`i, 4] == $CellContext`Rabbit, If[Norm[Part[ $CellContext`nearestFoxes[$CellContext`nextLocation], 1] - $CellContext`nextLocation] > 0.02, $CellContext`survivors = { Join[$CellContext`nextLocation, { 0., $CellContext`Rabbit}]}; If[RandomReal[] < $CellContext`rabbitGrowthRate ( 1. - $CellContext`rabbitPop/$CellContext`maxRabbits), AppendTo[$CellContext`survivors, Join[$CellContext`nextLocation, { 0., $CellContext`Rabbit}]]]; Null], If[Norm[Part[ $CellContext`nearestRabbits[$CellContext`nextLocation], 1] - $CellContext`nextLocation] > 0.02, If[ Part[$CellContext`agents, $CellContext`i, 3] < $CellContext`foxEndurance, $CellContext`survivors = { Join[$CellContext`nextLocation, { Part[$CellContext`agents, $CellContext`i, 3] + 1., $CellContext`Fox}]}; Null], $CellContext`survivors = { Join[$CellContext`nextLocation, {0., $CellContext`Fox}]}; If[RandomReal[] < $CellContext`foxGrowthRate ( 1. - $CellContext`foxPop/$CellContext`maxFoxes), AppendTo[$CellContext`survivors, Join[$CellContext`nextLocation, {0., $CellContext`Fox}]]]; Null]]; $CellContext`survivors, {$CellContext`i, Length[$CellContext`agents]}]]]], $CellContext`Fox = 1., $CellContext`Rabbit = 2., $CellContext`dummyPoint = {-1., -1.}, $CellContext`maxRabbits = 500., $CellContext`maxFoxes = 500., $CellContext`visualize[ Pattern[$CellContext`agents, Blank[]]] := Module[{$CellContext`foxes = Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Fox& ]], $CellContext`rabbits = Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Rabbit& ]], $CellContext`dummyList = \ {$CellContext`dummyPoint}}, Show[ Graphics[{ AbsolutePointSize[10], RGBColor[0.9, 0.42, 0.17], Point[ If[$CellContext`foxes == {}, $CellContext`dummyList, \ $CellContext`foxes]]}], Graphics[{ AbsolutePointSize[10], RGBColor[0.48, 0.11, 0.56], Point[ If[$CellContext`rabbits == {}, $CellContext`dummyList, \ $CellContext`rabbits]]}], ImageSize -> {375, 375}, AspectRatio -> Automatic, Frame -> False, Axes -> False, PlotRange -> {{0, 1}, {0, 1}}]], Attributes[PlotRange] = {ReadProtected}, $CellContext`initialAgents[] := Developer`ToPackedArray[ Table[ Join[ RandomReal[{0, 1}, 2], {0., If[ RandomReal[] < 0.1, $CellContext`Fox, $CellContext`Rabbit]}], { 100}]]}; Typeset`initDone$$ = True); ReleaseHold[ HoldComplete[{{ HoldComplete[$CellContext`Fox = 1.; Null], HoldComplete[Null], HoldComplete[$CellContext`Rabbit = 2.; Null], HoldComplete[Null], HoldComplete[$CellContext`maxRabbits = 500.; Null], HoldComplete[Null], HoldComplete[$CellContext`maxFoxes = 500.; Null], HoldComplete[Null], HoldComplete[$CellContext`dummyPoint = {-1., -1.}; Null]}, $CellContext`initialAgents[] := Developer`ToPackedArray[ Table[ Join[ RandomReal[{0, 1}, 2], {0., If[ RandomReal[] < 0.1, $CellContext`Fox, $CellContext`Rabbit]}], { 100}]], $CellContext`visualize[ Pattern[$CellContext`agents, Blank[]]] := Module[{$CellContext`foxes = Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Fox& ]], $CellContext`rabbits = Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Rabbit& ]], $CellContext`dummyList = \ {$CellContext`dummyPoint}}, Show[ Graphics[{ AbsolutePointSize[10], RGBColor[0.9, 0.42, 0.17], Point[ If[$CellContext`foxes == {}, $CellContext`dummyList, \ $CellContext`foxes]]}], Graphics[{ AbsolutePointSize[10], RGBColor[0.48, 0.11, 0.56], Point[ If[$CellContext`rabbits == {}, $CellContext`dummyList, \ $CellContext`rabbits]]}], ImageSize -> {375, 375}, AspectRatio -> Automatic, Frame -> False, Axes -> False, PlotRange -> {{0, 1}, {0, 1}}]], $CellContext`updateAgents[ Pattern[$CellContext`agents, Blank[]], Pattern[$CellContext`rabbitGrowthRate, Blank[]], Pattern[$CellContext`rabbitMobility, Blank[]], Pattern[$CellContext`foxGrowthRate, Blank[]], Pattern[$CellContext`foxMobility, Blank[]], Pattern[$CellContext`foxEndurance, Blank[]]] := Module[{$CellContext`foxPop = Length[ Select[$CellContext`agents, Part[#, 4] == $CellContext`Fox& ]], $CellContext`rabbitPop = Length[ Select[$CellContext`agents, Part[#, 4] == $CellContext`Rabbit& ]], $CellContext`nearestFoxes = Nearest[ Append[ Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Fox& ]], $CellContext`dummyPoint]], \ $CellContext`nearestRabbits = Nearest[ Append[ Map[Take[#, 2]& , Select[$CellContext`agents, Part[#, 4] == $CellContext`Rabbit& ]], $CellContext`dummyPoint]], \ $CellContext`i, $CellContext`nextLocation, $CellContext`survivors}, Developer`ToPackedArray[ (Flatten[#, 1]& )[ Table[$CellContext`survivors = {}; $CellContext`nextLocation = Part[$CellContext`agents, $CellContext`i, {1, 2}] + If[Part[$CellContext`agents, $CellContext`i, 4] == $CellContext`Rabbit, RandomReal[{-$CellContext`rabbitMobility, \ $CellContext`rabbitMobility}, 2], RandomReal[{-$CellContext`foxMobility, \ $CellContext`foxMobility}, 2]]; $CellContext`nextLocation = Clip[$CellContext`nextLocation, {0., 1.}]; If[Part[$CellContext`agents, $CellContext`i, 4] == $CellContext`Rabbit, If[Norm[Part[ $CellContext`nearestFoxes[$CellContext`nextLocation], 1] - $CellContext`nextLocation] > 0.02, $CellContext`survivors = { Join[$CellContext`nextLocation, { 0., $CellContext`Rabbit}]}; If[RandomReal[] < $CellContext`rabbitGrowthRate ( 1. - $CellContext`rabbitPop/$CellContext`maxRabbits), AppendTo[$CellContext`survivors, Join[$CellContext`nextLocation, { 0., $CellContext`Rabbit}]]]; Null], If[Norm[Part[ $CellContext`nearestRabbits[$CellContext`nextLocation], 1] - $CellContext`nextLocation] > 0.02, If[ Part[$CellContext`agents, $CellContext`i, 3] < $CellContext`foxEndurance, $CellContext`survivors = { Join[$CellContext`nextLocation, { Part[$CellContext`agents, $CellContext`i, 3] + 1., $CellContext`Fox}]}; Null], $CellContext`survivors = { Join[$CellContext`nextLocation, {0., $CellContext`Fox}]}; If[RandomReal[] < $CellContext`foxGrowthRate ( 1. - $CellContext`foxPop/$CellContext`maxFoxes), AppendTo[$CellContext`survivors, Join[$CellContext`nextLocation, {0., $CellContext`Fox}]]]; Null]]; $CellContext`survivors, {$CellContext`i, Length[$CellContext`agents]}]]]]}]]; Typeset`initDone$$ = True), SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellID->54188526], Cell[CellGroupData[{ Cell["CAPTION", "Section", CellFrame->{{0, 0}, {1, 0}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->12, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell["\<\ This Demonstration simulates the dynamics of predators (foxes, in orange) and \ prey (rabbits, in purple) in a 2D bounded square habitat. An individual of \ each species is simulated as a particle moving in a random walk. The initial \ condition is such that there are 100 particles randomly distributed in the \ space, 10% of which are foxes and the rest rabbits. A rabbit particle can \ replicate itself at a given growth rate. A fox particle has to eat (i.e., \ collide into) a rabbit particle in order to replicate itself, and will die if \ it doesn't eat any rabbit particles for a certain time period. The maximum \ population of each species is bounded to 500. Depending on the parameter \ settings, this ecosystem shows several distinct behaviors, including \ extinction of foxes (or both species), oscillation of populations, and \ spatial waves of foxes chasing clusters of rabbits. You can stop and restart \ the real-time simulation using the \"run simulation\" checkbox.\ \>", "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell["THIS NOTEBOOK IS THE SOURCE CODE FROM", "Text", CellFrame->{{0, 0}, {0, 0}}, CellMargins->{{48, 10}, {4, 28}}, CellGroupingRules->{"SectionGrouping", 25}, CellFrameMargins->{{48, 48}, {6, 5}}, CellFrameColor->RGBColor[0.87, 0.87, 0.87], FontFamily->"Helvetica", FontSize->10, FontWeight->"Bold", FontColor->RGBColor[0.597406, 0, 0.0527047]], Cell[TextData[{ "\"", ButtonBox["Predator-Prey Ecosystem: A Real-Time Agent-Based Simulation", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/\ PredatorPreyEcosystemARealTimeAgentBasedSimulation/"], None}, ButtonNote-> "http://demonstrations.wolfram.com/\ PredatorPreyEcosystemARealTimeAgentBasedSimulation/"], "\"", " from ", ButtonBox["the Wolfram Demonstrations Project", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], "\[ParagraphSeparator]\[NonBreakingSpace]", ButtonBox["http://demonstrations.wolfram.com/\ PredatorPreyEcosystemARealTimeAgentBasedSimulation/", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/\ PredatorPreyEcosystemARealTimeAgentBasedSimulation/"], None}, ButtonNote-> "http://demonstrations.wolfram.com/\ PredatorPreyEcosystemARealTimeAgentBasedSimulation/"] }], "Text", CellMargins->{{48, Inherited}, {0, Inherited}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.5]], Cell[TextData[{ "Contributed by: ", ButtonBox["Hiroki Sayama", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/author.html?author=Hiroki+Sayama"], None}, ButtonNote-> "http://demonstrations.wolfram.com/author.html?author=Hiroki+Sayama"] }], "Text", CellDingbat->"\[FilledSmallSquare]", CellMargins->{{66, 48}, {2, 4}}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.6]], Cell[CellGroupData[{ Cell[TextData[{ "A full-function Wolfram ", StyleBox["Mathematica", FontSlant->"Italic"], " system (Version 6 or higher) is required to edit this notebook.\n", StyleBox[ButtonBox["GET WOLFRAM MATHEMATICA \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://www.wolfram.com/products/mathematica/"], None}, ButtonNote->"http://www.wolfram.com/products/mathematica/"], FontFamily->"Helvetica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[1, 0.42, 0]] }], "Text", CellFrame->True, CellMargins->{{48, 68}, {8, 28}}, CellFrameMargins->12, CellFrameColor->RGBColor[0.87, 0.87, 0.87], CellChangeTimes->{3.3750111182355957`*^9}, ParagraphSpacing->{1., 1.}, FontFamily->"Verdana", FontSize->10, FontColor->GrayLevel[0.411765], Background->RGBColor[1, 1, 1]], Cell[TextData[{ "\[Copyright] ", StyleBox[ButtonBox["Wolfram Demonstrations Project & Contributors", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/"], None}, ButtonNote->"http://demonstrations.wolfram.com/"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Terms of Use", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/termsofuse.html"], None}, ButtonNote->"http://demonstrations.wolfram.com/termsofuse.html"], FontColor->GrayLevel[0.6]], "\[ThickSpace]\[ThickSpace]\[ThickSpace]|\[ThickSpace]\[ThickSpace]\ \[ThickSpace]", StyleBox[ButtonBox["Make a new version of this Demonstration \ \[RightGuillemet]", BaseStyle->"Hyperlink", ButtonData->{ URL["http://demonstrations.wolfram.com/participate/upload.jsp?id=\ PredatorPreyEcosystemARealTimeAgentBasedSimulation"], None}, ButtonNote->None], FontColor->GrayLevel[0.6]] }], "Text", CellFrame->{{0, 0}, {0, 0.5}}, CellMargins->{{48, 10}, {20, 50}}, CellFrameMargins->{{6, 0}, {6, 6}}, CellFrameColor->GrayLevel[0.6], FontFamily->"Verdana", FontSize->9, FontColor->GrayLevel[0.6]] }, Open ]] }, Open ]] }, Editable->True, Saveable->False, ScreenStyleEnvironment->"Working", CellInsertionPointCell->None, WindowSize->{780, 650}, WindowMargins->{{Inherited, Inherited}, {Inherited, 0}}, WindowElements->{ "StatusArea", "MemoryMonitor", "MagnificationPopUp", "VerticalScrollBar", "MenuBar"}, WindowTitle->"Predator-Prey Ecosystem: A Real-Time Agent-Based Simulation - \ Source", DockedCells->{}, CellContext->Notebook, FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (November 7, 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[663, 24, 179, 3, 70, "Section"], Cell[845, 29, 3700, 64, 70, "Section"], Cell[4548, 95, 903, 22, 70, "Input", CellID->12186613], Cell[5454, 119, 1536, 38, 70, "Input", CellID->179304614], Cell[6993, 159, 4007, 97, 70, "Input", CellID->581179032], Cell[11003, 258, 11394, 262, 70, "Input", CellID->323996531], Cell[22400, 522, 5392, 119, 70, "Input", CellID->428012851] }, Open ]], Cell[CellGroupData[{ Cell[27829, 646, 25366, 501, 70, "Output", CellID->54188526], Cell[CellGroupData[{ Cell[53220, 1151, 209, 6, 70, "Section"], Cell[53432, 1159, 1007, 14, 70, "Text"] }, Close]] }, Open ]], Cell[CellGroupData[{ Cell[54487, 1179, 355, 9, 70, "Text", CellGroupingRules->{"SectionGrouping", 25}], Cell[54845, 1190, 1104, 31, 70, "Text"], Cell[55952, 1223, 436, 14, 70, "Text"], Cell[CellGroupData[{ Cell[56413, 1241, 815, 24, 70, "Text"], Cell[57231, 1267, 1222, 33, 70, "Text"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *) (* NotebookSignature 7QzCT#C8LgL1bCpUX#NjC0UQ *)