(* Content-type: application/vnd.wolfram.cdf.text *) (*** Wolfram CDF File ***) (* http://www.wolfram.com/cdf *) (* CreatedBy='Mathematica 11.3' *) (***************************************************************************) (* *) (* *) (* Under the Wolfram FreeCDF terms of use, this file and its content are *) (* bound by the Creative Commons BY-SA Attribution-ShareAlike license. *) (* *) (* For additional information concerning CDF licensing, see: *) (* *) (* www.wolfram.com/cdf/adopting-cdf/licensing-options.html *) (* *) (* *) (***************************************************************************) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 1088, 20] NotebookDataLength[ 286117, 5704] NotebookOptionsPosition[ 281741, 5544] NotebookOutlinePosition[ 282946, 5581] CellTagsIndexPosition[ 282903, 5578] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Functions", "Section", CellChangeTimes->{{3.66599018585154*^9, 3.66599019432434*^9}, 3.7492941535585814`*^9, {3.749468764307332*^9, 3.749468765729116*^9}},ExpressionUUID->"ac127a91-3a33-4f9f-8b5a-\ e76b31ca1271"], Cell[CellGroupData[{ Cell[TextData[StyleBox["Make the first generation (neutral case)", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337061296988`*^9}, { 3.753529484842984*^9, 3.7535294941548653`*^9}, {3.7535297280866346`*^9, 3.7535297415275803`*^9}, {3.753780924928229*^9, 3.7537809254388633`*^9}, { 3.7942167693470383`*^9, 3.794216808802295*^9}, {3.819601821218094*^9, 3.819601823008196*^9}, {3.8196021536161056`*^9, 3.819602154031129*^9}},ExpressionUUID->"6e11c810-3d1d-46c3-a09a-\ 43f540dcdd77"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{ "a", " ", "vector", " ", "containing", " ", "expected", " ", "genic", " ", "variance"}]}], " ", ";", " ", RowBox[{ "the", " ", "number", " ", "of", " ", "loci", " ", "determining", " ", "the", " ", "trait"}], " ", ";", " ", RowBox[{"the", " ", "population", " ", "size"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Creates", " ", "initial", " ", "gametes", " ", "by", " ", "sampling", " ", "allelic", " ", "effects", " ", "in", " ", "a", " ", "normal", " ", "distribution", " ", "with", " ", "a", " ", "mean", " ", "of", " ", RowBox[{"(", RowBox[{"mean", " ", RowBox[{"genotype", "/", "2"}], "*", "loci", " ", "number"}], ")"}], " ", "and", " ", "a", " ", "standard", " ", "deviation", " ", "of", RowBox[{"(", RowBox[{"genetic", " ", RowBox[{"variance", "/", "2"}], "*", "loci", " ", "number"}], ")"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "a", " ", "female", " ", "allele", " ", "matrix", " ", "and", " ", "a", " ", "male", " ", "allele", " ", "matrix", " ", "of", " ", "dimension", RowBox[{"(", RowBox[{ RowBox[{"pop", " ", "size"}], ",", " ", RowBox[{"loci", " ", "number"}]}], ")"}], " ", "containing", " ", "allelic", " ", "effects"}], " ", "*)"}], RowBox[{ RowBox[{ RowBox[{"individualsgametes", "[", RowBox[{"genicvariance_", ",", "nbloci_", ",", "size_"}], "]"}], ":=", " ", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"femalegamete", ",", "malegamete"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"femalegamete", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "genicvariance", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "/", "2"}], "/", "nbloci"}], ",", RowBox[{"Sqrt", "[", RowBox[{ RowBox[{ RowBox[{ "genicvariance", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "/", "2"}], "/", "nbloci"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"size", ",", "nbloci"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegamete", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "genicvariance", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "/", "2"}], "/", "nbloci"}], ",", RowBox[{"Sqrt", "[", RowBox[{ RowBox[{ RowBox[{ "genicvariance", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "/", "2"}], "/", "nbloci"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"size", ",", "nbloci"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"femalegamete", ",", "malegamete"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.663405834614233*^9, 3.663405858881233*^9}, { 3.663405946329633*^9, 3.6634059512768335`*^9}, {3.663405992176433*^9, 3.663406054846033*^9}, {3.6634095687264333`*^9, 3.663409571191233*^9}, { 3.6634097911644335`*^9, 3.663409805240633*^9}, {3.6634103657752333`*^9, 3.6634103679748335`*^9}, {3.66347835657993*^9, 3.6634783831587296`*^9}, { 3.6636763245557337`*^9, 3.6636763295297337`*^9}, {3.6636764418837337`*^9, 3.663676448392734*^9}, {3.6639256471695333`*^9, 3.6639256587009335`*^9}, { 3.6639305184361334`*^9, 3.663930552908533*^9}, {3.663930583508133*^9, 3.6639307139087334`*^9}, {3.6639314035577335`*^9, 3.663931404572733*^9}, { 3.663931440198533*^9, 3.6639314417585335`*^9}, {3.6639314808807335`*^9, 3.663931492739733*^9}, {3.663931621477733*^9, 3.663931699690933*^9}, { 3.663932251394533*^9, 3.663932258105533*^9}, {3.6639322964467335`*^9, 3.6639323231035333`*^9}, {3.6639334701931334`*^9, 3.663933473205933*^9}, { 3.663994494328333*^9, 3.663994535699933*^9}, {3.663994575557333*^9, 3.663994598513933*^9}, {3.663994993662333*^9, 3.663995012749133*^9}, { 3.664014255512533*^9, 3.6640142775915327`*^9}, {3.664014314711933*^9, 3.664014315195533*^9}, {3.664014363302333*^9, 3.664014382341333*^9}, { 3.664014442000133*^9, 3.664014467669133*^9}, {3.664014839880933*^9, 3.664014936185533*^9}, {3.664015249898933*^9, 3.664015263005933*^9}, { 3.664015784800733*^9, 3.664015981596333*^9}, {3.664016017797333*^9, 3.6640160334023333`*^9}, {3.664016482212533*^9, 3.664016596328333*^9}, 3.664016812991733*^9, {3.6640169377879333`*^9, 3.664017020995133*^9}, 3.664017080931733*^9, 3.6640875775339475`*^9, {3.6640968073899474`*^9, 3.6640968123179474`*^9}, 3.6640968975929475`*^9, {3.6641082992309475`*^9, 3.6641083011019473`*^9}, {3.665133880763406*^9, 3.665133883477811*^9}, 3.665133923554281*^9, 3.6653095450871325`*^9, {3.6653098432451863`*^9, 3.66530987337391*^9}, {3.6696312892125263`*^9, 3.669631324457526*^9}, 3.6696318582035265`*^9, {3.7489444091445084`*^9, 3.74894445956246*^9}, 3.748944738754159*^9, 3.753603511730878*^9, {3.753612085639209*^9, 3.753612100357993*^9}, {3.7537804163715315`*^9, 3.753780441999002*^9}, { 3.753780475267065*^9, 3.753780479347159*^9}, {3.7537809783521824`*^9, 3.7537810017327003`*^9}, 3.7537866301463556`*^9, {3.794122769190228*^9, 3.794122770479705*^9}, {3.8196018947222977`*^9, 3.819601945957228*^9}, { 3.8196026093841743`*^9, 3.8196026096591897`*^9}},ExpressionUUID->"a88bc089-2d2a-481b-9c30-\ 8b8a707ee7e6"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Build individual flowering phenologies from trait z", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.665133734708949*^9}, 3.7493805804232616`*^9, {3.7535296495273247`*^9, 3.753529653240358*^9}, 3.7537815241278887`*^9, {3.794216758218402*^9, 3.794216764906784*^9}, { 3.794216831977621*^9, 3.7942168379379616`*^9}, {3.819601838337073*^9, 3.8196018409282207`*^9}},ExpressionUUID->"933f82ad-426a-4cb7-9ecc-\ 1917276fedaa"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{ "a", " ", "list", " ", "of", " ", "phenotypic", " ", "values", " ", "with", " ", "dimension", " ", RowBox[{"(", "pop_size", ")"}]}]}], " ", ";", " ", RowBox[{ "a", " ", "vector", " ", "of", " ", "flower", " ", "distribution", " ", "for", " ", "an", " ", "individual", " ", "plant"}], ";", " ", RowBox[{ "the", " ", "number", " ", "of", " ", "flowers", " ", "produced", " ", "per", " ", "plant"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Constructs", " ", "individual", " ", "flowering", " ", RowBox[{"phenologies", " ", ":", " ", RowBox[{ "flowering", " ", "schedule", " ", "is", " ", "added", " ", "to", " ", "the", " ", "rounded", " ", RowBox[{"(", RowBox[{"lower", " ", "ou", " ", "upper"}], ")"}], " ", "phenotypic", " ", "value", " ", "to", " ", "obtain", " ", "an", " ", "individual", " ", "flowering", " ", "schedule"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "a", " ", "matrix", " ", "of", " ", "individual", " ", "flowering", " ", "phenologies", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"pop_size", ",", " ", RowBox[{"flower_number", "_per", "_plant"}], ",", " ", "2"}], ")"}], " ", "containing", " ", "for", " ", "each", " ", "individual", " ", RowBox[{"(", RowBox[{"ie", ".", " ", "line"}], ")"}], " ", "an", " ", "individual", " ", "identification", " ", "number", " ", "and", " ", "the", " ", "days", " ", "at", " ", "which", " ", "its", " ", "flowers", " ", "are", " ", "opened", " ", "in", " ", "the", " ", "season"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"buildconstantphenology", "[", RowBox[{ "phenotypicvalues_", ",", "floweringschedule_", ",", "nbflowers_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"scheduleindividuals", ",", "z"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"z", "=", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"FractionalPart", "[", "#", "]"}], ">", "0"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"RandomReal", "[", "]"}], ">", RowBox[{"FractionalPart", "[", "#", "]"}]}], ",", RowBox[{"Floor", "[", "#", "]"}], ",", RowBox[{"Ceiling", "[", "#", "]"}]}], "]"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "0"}], "}"}], "]"}], ">", RowBox[{"FractionalPart", "[", "#", "]"}]}], ",", RowBox[{"Floor", "[", "#", "]"}], ",", RowBox[{"Ceiling", "[", "#", "]"}]}], "]"}]}], "]"}], "&"}], ",", "phenotypicvalues"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"scheduleindividuals", "=", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"#", "+", "floweringschedule"}], "&"}], ",", "z"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Partition", "[", RowBox[{ RowBox[{"Riffle", "[", RowBox[{ RowBox[{"Flatten", "[", "scheduleindividuals", "]"}], ",", RowBox[{"Flatten", "[", RowBox[{"Transpose", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"Range", "[", RowBox[{ RowBox[{"Dimensions", "[", "phenotypicvalues", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}], ",", RowBox[{"{", "nbflowers", "}"}]}], "]"}], "]"}], "]"}]}], "]"}], ",", "2"}], "]"}], ",", "nbflowers"}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.6639305048133335`*^9, 3.6639305121639333`*^9}, { 3.664284234767937*^9, 3.664284236480937*^9}, {3.665316004704602*^9, 3.6653160066237116`*^9}, {3.6696313705355263`*^9, 3.6696313822455263`*^9}, 3.6697209992205267`*^9, {3.7492915772982283`*^9, 3.749291607007927*^9}, { 3.753529304955912*^9, 3.753529309870163*^9}, {3.75352935853906*^9, 3.753529358971649*^9}, 3.753603523521139*^9, {3.753611693769127*^9, 3.7536118013852167`*^9}, {3.7536150890613775`*^9, 3.753615096212287*^9}, { 3.753781017840598*^9, 3.7537810415741415`*^9}, {3.7537811759997125`*^9, 3.7537812076959896`*^9}, {3.7537815799047775`*^9, 3.7537815802238994`*^9}, {3.7537816301294956`*^9, 3.7537816599846597`*^9}, 3.7537866319215617`*^9, {3.759020181690334*^9, 3.759020200532118*^9}, { 3.7590202390168877`*^9, 3.7590202439149303`*^9}, {3.759020277369232*^9, 3.759020366078785*^9}, {3.759022277249444*^9, 3.7590223195372744`*^9}, { 3.7590223986294603`*^9, 3.759022407088212*^9}, {3.7941228431682024`*^9, 3.794122848071515*^9}, {3.794236203352723*^9, 3.79423620790075*^9}, { 3.819601960835079*^9, 3.8196020135520945`*^9}, {3.8196026367167377`*^9, 3.8196026616181617`*^9}},ExpressionUUID->"a697e225-d385-4d1f-80c6-\ 31926ece180d"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Change environemental conditions at each generations", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.665133734708949*^9}, 3.7493805804232616`*^9, {3.7494498737817883`*^9, 3.7494498816541605`*^9}, { 3.7535295021385703`*^9, 3.7535295153861494`*^9}, {3.7535301499223857`*^9, 3.753530151923439*^9}, {3.753783834229612*^9, 3.753783834438054*^9}, { 3.7942167092766027`*^9, 3.7942167121147647`*^9}, {3.7942168215220227`*^9, 3.7942168290174513`*^9}, {3.8196021432975154`*^9, 3.8196021439185505`*^9}},ExpressionUUID->"1dab6764-22b0-479e-89b3-\ 9f3fc10f5e99"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{"optimum", " ", "value"}]}], " ", ";", " ", RowBox[{ "width", " ", "of", " ", "the", " ", "selection", " ", "function"}], " ", ";", " ", RowBox[{ "speed", " ", "of", " ", "the", " ", "optimum", " ", "change", " ", "per", " ", "generation"}], " ", ";", " ", RowBox[{"variance", " ", RowBox[{"(", "fluctuations", ")"}], " ", "of", " ", "the", " ", "optimum"}], " ", ";", " ", RowBox[{"variance", " ", RowBox[{"(", "fluctuations", ")"}], " ", "of", " ", "the", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Changes", " ", "the", " ", "value", " ", "of", " ", "optimum", " ", "and", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function", " ", "at", " ", "each", " ", "generation"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "a", " ", "vector", " ", "containing", " ", "the", " ", "new", " ", "values", " ", "for", " ", "the", " ", "optimum", " ", "and", " ", "the", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"changeoptimum", "[", RowBox[{ "moptimum_", ",", " ", "voptimum_", ",", "optimumdisplacement_", ",", " ", "optimumfluct_", ",", "intensityfluct_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"mtheta", ",", " ", "vtheta"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"mtheta", " ", "=", RowBox[{"optimumdisplacement", " ", "+", " ", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", RowBox[{"Sqrt", "[", "optimumfluct", "]"}]}], "]"}], ",", "1"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"vtheta", "=", " ", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", RowBox[{"Sqrt", "[", "intensityfluct", "]"}]}], "]"}], ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"mtheta", ",", "vtheta"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.7535274961984034`*^9, 3.753527508902993*^9}, { 3.753528498146819*^9, 3.7535285052332797`*^9}, {3.753528598274989*^9, 3.7535286040672035`*^9}, 3.7536035346720786`*^9, 3.753611665227792*^9, { 3.7537824638412724`*^9, 3.753782464800707*^9}, {3.7537825106092544`*^9, 3.753782547013918*^9}, 3.753786633553156*^9, {3.760384755208293*^9, 3.760384762151681*^9}, 3.760384823399856*^9, {3.7941230690688925`*^9, 3.794123071346486*^9}, {3.7942362997181144`*^9, 3.7942364644996276`*^9}, { 3.794236529664586*^9, 3.7942365499491014`*^9}, {3.8196020323081675`*^9, 3.8196021090745583`*^9}, {3.8196026809492674`*^9, 3.8196026933589773`*^9}},ExpressionUUID->"c3f402bf-8413-49e0-8a0e-\ 0187c39d2397"] }, Closed]], Cell[CellGroupData[{ Cell["Selection functions on individual flowers", "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.665133750044776*^9}, { 3.749207377003476*^9, 3.749207389761779*^9}, 3.7536033991042323`*^9, { 3.753783836821681*^9, 3.753783836998209*^9}, {3.7942167226993704`*^9, 3.7942167241544533`*^9}, {3.7942168431132574`*^9, 3.794216849897646*^9}, 3.8196021641757097`*^9}, FontColor->GrayLevel[ 0],ExpressionUUID->"fa7a722a-295d-4969-9ec3-a2ab1bb1a5fe"], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "\[IndentingNewLine]", "For"}], " ", "each", " ", "function", " ", "of", " ", "this", " ", RowBox[{"section", " ", ":", "\[IndentingNewLine]", RowBox[{ RowBox[{ "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**"}], "*", "\[IndentingNewLine]", RowBox[{"Inputs", " ", ":", " ", RowBox[{ "the", " ", "matrix", " ", "of", " ", "flowers", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"pop_size", ",", " ", RowBox[{"flower_number", "_per", "_plant"}], ",", " ", "2"}], ")"}], " ", "obtained", " ", "from", " ", "buildconstantphenology", " ", "and", " ", "containing", " ", "for", " ", "each", " ", "individual", " ", RowBox[{"(", RowBox[{"ie", ".", " ", "line"}], ")"}], " ", "its", " ", "individual", " ", "identification", " ", "number", " ", "and", " ", "the", " ", "days", " ", "at", " ", "which", " ", "its", " ", "flowers", " ", "are", " ", "opened", " ", "in", " ", "the", " ", "season"}]}]}]}]}], " ", ";", " ", RowBox[{"the", " ", "value", " ", "of", " ", "optimum"}]}], ",", " ", RowBox[{ RowBox[{ "the", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function"}], " ", ";", " ", RowBox[{"the", " ", "population", " ", RowBox[{ "size", ".", "\[IndentingNewLine]", "\[IndentingNewLine]", "evaluates"}], " ", "fitness", " ", "for", " ", "each", " ", "flower"}]}], ",", " ", RowBox[{ "samples", " ", "with", " ", "replacement", " ", "population_size", " ", "number", " ", "of", " ", "female", " ", "flowers", " ", "according", " ", "to", " ", "their", " ", RowBox[{"fitness", " ", ":", "\[IndentingNewLine]", RowBox[{ RowBox[{"-", "for"}], " ", "random", " ", "mating"}]}]}], ",", " ", RowBox[{ RowBox[{ "male", " ", "flowers", " ", "are", " ", "sampled", " ", "independently", " ", "of", " ", "the", " ", "female", " ", "flowers"}], "\[IndentingNewLine]", " ", "-", RowBox[{"for", " ", "assortative", " ", "mating"}]}], ",", " ", RowBox[{ "male", " ", "flowers", " ", "are", " ", "randomly", " ", "sampled", " ", "with", " ", "replacement", " ", "each", " ", "day", " ", "at", " ", "which", " ", "female", " ", "flowers", " ", "were", " ", "previously", " ", "selected", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "Returns", " ", "the", " ", "list", " ", "of", " ", "selected", " ", "female", " ", "and", " ", "male", " ", "flowers"}], ",", " ", RowBox[{ "including", " ", "the", " ", "individual", " ", "identification", " ", "number", " ", "and", " ", "the", " ", "day", " ", "of", " ", RowBox[{ "flowering", "\[IndentingNewLine]", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**"}], "*"}]}], " ", "*)"}]], "Input", CellChangeTimes->{{3.75378263683173*^9, 3.7537826960065117`*^9}, { 3.7537828349609737`*^9, 3.7537829041151023`*^9}, 3.7537866358429728`*^9, { 3.7942365998308144`*^9, 3.794236605345337*^9}, {3.7942401881356106`*^9, 3.794240211293716*^9}, {3.819602176547417*^9, 3.8196023152183485`*^9}, { 3.81960271718434*^9, 3.8196028050363646`*^9}},ExpressionUUID->"f1163826-1168-44e0-8500-\ 66c118b673c9"], Cell[CellGroupData[{ Cell["selection function for random mating", "Subsubsection", CellChangeTimes->{{3.79421733618246*^9, 3.794217340261693*^9}, { 3.794217388357444*^9, 3.7942173912936115`*^9}, {3.794217441598489*^9, 3.7942174454537096`*^9}, {3.819602326591999*^9, 3.8196023272620373`*^9}},ExpressionUUID->"e3b7fdbc-7231-4981-8052-\ 4a5bc29424ce"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"flowerrandomselection", "[", RowBox[{ "flowerlist_", ",", "thetamean_", ",", "thetavariance_", ",", "size_"}], "]"}], " ", ":=", " ", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "allflowers", ",", "flowerfitness", ",", "idfemaleflowers", ",", "idmaleflowers"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"allflowers", "=", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", "flowerlist", "]"}], ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"flowerfitness", "=", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{ RowBox[{"(", RowBox[{"#", "-", "thetamean"}], ")"}], "^", "2"}]}], "/", "2"}], "/", "thetavariance"}], "]"}], "&"}], ",", RowBox[{"allflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"idfemaleflowers", "=", RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{ RowBox[{"Flatten", "[", "flowerfitness", "]"}], "\[Rule]", RowBox[{"Range", "[", RowBox[{ RowBox[{"Dimensions", "[", "allflowers", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}]}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"idmaleflowers", "=", RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{ RowBox[{"Flatten", "[", "flowerfitness", "]"}], "\[Rule]", RowBox[{"Range", "[", RowBox[{ RowBox[{"Dimensions", "[", "allflowers", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}]}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ "allflowers", "\[LeftDoubleBracket]", "idfemaleflowers", "\[RightDoubleBracket]"}], ",", RowBox[{ "allflowers", "\[LeftDoubleBracket]", "idmaleflowers", "\[RightDoubleBracket]"}]}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.664008996710733*^9, 3.664009019589333*^9}, { 3.6640090954419327`*^9, 3.664009119161933*^9}, {3.664015277144533*^9, 3.664015279423133*^9}, {3.664101534958947*^9, 3.6641015380139475`*^9}, { 3.6641117667109475`*^9, 3.6641117703899474`*^9}, {3.664189508820937*^9, 3.6641895444509373`*^9}, 3.664281101475937*^9, {3.664877546879937*^9, 3.664877550190937*^9}, {3.664884536975937*^9, 3.6648845373759375`*^9}, { 3.664885607635937*^9, 3.6648856084349375`*^9}, {3.6653179503678875`*^9, 3.665317973230195*^9}, {3.665318012287429*^9, 3.6653180177277403`*^9}, { 3.665319589985668*^9, 3.665319595858004*^9}, {3.666591015882142*^9, 3.6665910346971416`*^9}, {3.666591112246142*^9, 3.6665911131731415`*^9}, { 3.6665911684821415`*^9, 3.666591169474142*^9}, {3.6665915766831417`*^9, 3.666591613384142*^9}, {3.666591670599142*^9, 3.6665916752371416`*^9}, 3.666591799182142*^9, {3.666593079186142*^9, 3.666593079557142*^9}, { 3.6665931175711417`*^9, 3.6665931597441416`*^9}, {3.6665932858171415`*^9, 3.6665932977681417`*^9}, {3.6665934262251415`*^9, 3.666593427842142*^9}, { 3.6665938530641418`*^9, 3.666593863655142*^9}, {3.6665939074131417`*^9, 3.6665939211571417`*^9}, {3.666618766301136*^9, 3.666618869888936*^9}, { 3.666619659967136*^9, 3.666619680690936*^9}, {3.666700736863736*^9, 3.666700883560536*^9}, 3.6667019022335396`*^9, {3.66670201648674*^9, 3.6667020181091394`*^9}, {3.667743469952128*^9, 3.667743479331728*^9}, 3.6683207998645573`*^9, {3.6696130142085266`*^9, 3.6696130601095266`*^9}, { 3.669613288464526*^9, 3.6696132920325265`*^9}, {3.669719216299526*^9, 3.669719218235526*^9}, {3.748168686109008*^9, 3.748168839262379*^9}, 3.7482597031978903`*^9, {3.748260969054513*^9, 3.748261014734311*^9}, { 3.748576527362182*^9, 3.748576562866458*^9}, {3.7485766401620646`*^9, 3.74857664120312*^9}, {3.7485803315801487`*^9, 3.7485804729718494`*^9}, { 3.7485805111647224`*^9, 3.748580530444786*^9}, {3.748580670318924*^9, 3.7485806726227236`*^9}, {3.7485811250229073`*^9, 3.7485811262876043`*^9}, {3.7485812224810658`*^9, 3.7485812358076367`*^9}, {3.748940703756565*^9, 3.7489407570066566`*^9}, { 3.748942145351385*^9, 3.7489421838987637`*^9}, {3.7489484137576094`*^9, 3.74894842742205*^9}, {3.7489484731653323`*^9, 3.7489484807660484`*^9}, { 3.7489485454538937`*^9, 3.748948601053023*^9}, {3.748948674432132*^9, 3.7489486754224043`*^9}, {3.7492030603929396`*^9, 3.7492031579119463`*^9}, {3.749203305301693*^9, 3.7492033212378516`*^9}, { 3.749203436138748*^9, 3.7492034681556025`*^9}, {3.7492053890062246`*^9, 3.7492054144310293`*^9}, {3.7492055012976456`*^9, 3.7492055515388327`*^9}, {3.7492058443615675`*^9, 3.749205845672165*^9}, { 3.749206235895405*^9, 3.749206241479253*^9}, {3.7493679724926577`*^9, 3.7493679729408717`*^9}, {3.7493680974840612`*^9, 3.7493680978033767`*^9}, {3.7493763844052167`*^9, 3.7493763845800285`*^9}, {3.749470547780262*^9, 3.7494705480527334`*^9}, { 3.7535303086120405`*^9, 3.753530313732354*^9}, {3.753530856984909*^9, 3.753530869048849*^9}, 3.7535309448271494`*^9, 3.753531271136207*^9, { 3.753599902032708*^9, 3.753599980113484*^9}, {3.7536000245279565`*^9, 3.753600147280027*^9}, {3.7536002524627438`*^9, 3.753600280174463*^9}, { 3.7536119055929728`*^9, 3.7536119062492476`*^9}, 3.7536119846801324`*^9, { 3.753612048422958*^9, 3.75361205244069*^9}, {3.7536121548216515`*^9, 3.7536121674616756`*^9}, {3.753612682450071*^9, 3.753612693104777*^9}, { 3.7537825996960487`*^9, 3.7537826183571615`*^9}, {3.7537828459206696`*^9, 3.7537828659471235`*^9}, {3.7537829153480716`*^9, 3.753782918724039*^9}, { 3.7537829672323065`*^9, 3.7537829717602253`*^9}},ExpressionUUID->"502434a9-042f-40b6-a019-\ bbb80982d12e"] }, Open ]], Cell[CellGroupData[{ Cell["selection function for assorative mating", "Subsubsection", CellChangeTimes->{{3.79421733618246*^9, 3.794217340261693*^9}, { 3.7942174163120427`*^9, 3.794217426805643*^9}, {3.7942175085493183`*^9, 3.7942175087753315`*^9}, {3.815194889009218*^9, 3.815194890289651*^9}, { 3.8196023607499533`*^9, 3.8196023667022934`*^9}},ExpressionUUID->"07bb5691-8579-4435-978b-\ be4fbbc356fb"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"flowerassortativeselection", "[", RowBox[{ "flowerlist_", ",", "thetamean_", ",", "thetavariance_", ",", "size_"}], "]"}], " ", ":=", " ", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "allflowers", ",", "flowerfitness", ",", "idfemaleflowers", ",", "chosenfemaleflowers", ",", "days", ",", "countflowers", ",", "availableflowers", ",", "numberavailables", ",", "idmaleflowers", ",", "chosenmaleflowers"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"allflowers", "=", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", "flowerlist", "]"}], ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"flowerfitness", "=", RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{ RowBox[{"(", RowBox[{"#", "-", "thetamean"}], ")"}], "^", "2"}]}], "/", "2"}], "/", "thetavariance"}], "]"}], "&"}], ",", RowBox[{"allflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"idfemaleflowers", "=", RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{ RowBox[{"Flatten", "[", "flowerfitness", "]"}], "\[Rule]", RowBox[{"Range", "[", RowBox[{ RowBox[{"Dimensions", "[", "allflowers", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}]}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"chosenfemaleflowers", "=", RowBox[{ "allflowers", "\[LeftDoubleBracket]", "idfemaleflowers", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"days", "=", RowBox[{"Union", "[", RowBox[{"chosenfemaleflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"countflowers", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{"chosenfemaleflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ "days", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"availableflowers", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"Position", "[", RowBox[{ RowBox[{"allflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ "days", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"numberavailables", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Dimensions", "[", RowBox[{ "availableflowers", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}], "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"idmaleflowers", "=", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{ "availableflowers", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}], ",", RowBox[{ "countflowers", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"chosenmaleflowers", "=", RowBox[{ "allflowers", "\[LeftDoubleBracket]", "idmaleflowers", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Sort", "[", "chosenfemaleflowers", "]"}], ",", "chosenmaleflowers"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.748948633406804*^9, 3.748948645181057*^9}, { 3.7489486956302114`*^9, 3.7489487784787483`*^9}, 3.7489488796131444`*^9, { 3.7489489242574368`*^9, 3.7489489409588137`*^9}, {3.748949010398076*^9, 3.7489490127973366`*^9}, {3.7492036661290245`*^9, 3.749203700497532*^9}, { 3.7492038753336616`*^9, 3.7492038963110294`*^9}, {3.749204032474655*^9, 3.749204063129588*^9}, {3.7492042719464817`*^9, 3.749204283067026*^9}, { 3.749204632600577*^9, 3.7492046838818216`*^9}, {3.749204874761869*^9, 3.7492049103804245`*^9}, {3.7492049523810606`*^9, 3.74920502841523*^9}, { 3.749205614038303*^9, 3.749205672358902*^9}, 3.749205774631138*^9, { 3.7492061243426037`*^9, 3.749206133061689*^9}, {3.749206164039441*^9, 3.7492062067129545`*^9}, {3.7492062450164976`*^9, 3.7492063989504633`*^9}, 3.749206430938958*^9, {3.7492066207117577`*^9, 3.7492066213181643`*^9}, 3.7492066752392898`*^9, {3.749207033449269*^9, 3.74920722596838*^9}, { 3.7492072942590885`*^9, 3.7492073056335487`*^9}, {3.7492914825948114`*^9, 3.7492914889801764`*^9}, 3.749291519438918*^9, {3.7493679757258496`*^9, 3.7493679759006433`*^9}, {3.7493680996274786`*^9, 3.7493680998032484`*^9}, {3.7493763869658623`*^9, 3.7493763871406736`*^9}, {3.7494705494443884`*^9, 3.7494705497647133`*^9}, {3.7535309546517453`*^9, 3.7535309642986*^9}, 3.753531272432155*^9, {3.7535313304483695`*^9, 3.7535313600022388`*^9}, 3.753603550145097*^9, {3.753612124469476*^9, 3.753612125798629*^9}, 3.753612205812096*^9},ExpressionUUID->"325aac06-f5b0-4b7d-810e-\ 4e11bf6a8067"] }, Open ]], Cell[CellGroupData[{ Cell["neutral conditions for random mating", "Subsubsection", CellChangeTimes->{{3.79421733618246*^9, 3.794217340261693*^9}, { 3.794217388357444*^9, 3.7942173912936115`*^9}, {3.794217441598489*^9, 3.7942175056471524`*^9}, {3.815194892153222*^9, 3.8151948926738405`*^9}},ExpressionUUID->"0e889c2e-f722-49ea-b917-\ ccb8c3da2ce6"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"flowerrandomneutral", "[", RowBox[{ "flowerlist_", ",", "thetamean_", ",", "thetavar_", ",", "size_"}], "]"}], ":=", " ", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", "allflowers", "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"allflowers", "=", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", "flowerlist", "]"}], ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{"allflowers", ",", "size"}], "]"}], ",", RowBox[{"RandomChoice", "[", RowBox[{"allflowers", ",", "size"}], "]"}]}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.7492928052864647`*^9, 3.749292806854554*^9}, { 3.7493763890284414`*^9, 3.749376389187627*^9}, {3.7494705515489616`*^9, 3.7494705523722353`*^9}, {3.7535314214396315`*^9, 3.7535314313598948`*^9}},ExpressionUUID->"f5988994-f6b7-470d-a115-\ 5511867e4e51"] }, Open ]], Cell[CellGroupData[{ Cell["neutral conditions for assortative mating", "Subsubsection", CellChangeTimes->{{3.79421733618246*^9, 3.794217340261693*^9}, { 3.794217388357444*^9, 3.7942173912936115`*^9}, {3.794217441598489*^9, 3.7942174454537096`*^9}, {3.794217482613835*^9, 3.7942174987967606`*^9}, { 3.815194894993874*^9, 3.8151948953649216`*^9}},ExpressionUUID->"9181f045-c2f6-4901-a96e-\ 9a8ae3229d15"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"flowerassortativeneutral", "[", RowBox[{ "flowerlist_", ",", "thetamean_", ",", "thetavar_", ",", "size_"}], "]"}], ":=", " ", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "allflowers", ",", "chosenfemaleflowers", ",", "days", ",", "countflowers", ",", "availableflowers", ",", "numberavailables", ",", "idmaleflowers", ",", "chosenmaleflowers"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"allflowers", "=", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", "flowerlist", "]"}], ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"chosenfemaleflowers", "=", RowBox[{"RandomChoice", "[", RowBox[{"allflowers", ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"days", "=", RowBox[{"Union", "[", RowBox[{"chosenfemaleflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"countflowers", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{"chosenfemaleflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ "days", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"availableflowers", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"Position", "[", RowBox[{ RowBox[{"allflowers", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ "days", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"numberavailables", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Dimensions", "[", RowBox[{ "availableflowers", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}], "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"idmaleflowers", "=", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{ "availableflowers", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}], ",", RowBox[{ "countflowers", "\[LeftDoubleBracket]", "i", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"chosenmaleflowers", "=", RowBox[{ "allflowers", "\[LeftDoubleBracket]", "idmaleflowers", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Sort", "[", "chosenfemaleflowers", "]"}], ",", "chosenmaleflowers"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.7492928213323827`*^9, 3.749292822389443*^9}, { 3.7493763909005833`*^9, 3.7493763910441437`*^9}, {3.749470557875376*^9, 3.749470558148824*^9}, {3.7535314412152853`*^9, 3.753531445135358*^9}},ExpressionUUID->"3dc5f16c-d1a7-4722-86dd-\ f2388d9f57a7"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Build offspring genotypes", "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.75360341678411*^9, 3.7536034175194893`*^9}, {3.7537838417335477`*^9, 3.753783841910076*^9}, {3.794216748170827*^9, 3.794216749002875*^9}}, FontColor->GrayLevel[ 0],ExpressionUUID->"2b6cd278-af6b-4e56-b4f4-85b463ca03f3"], Cell[CellGroupData[{ Cell["get genotypes that will reproduce", "Subsubsection", CellChangeTimes->{{3.7942172384628706`*^9, 3.794217246759345*^9}},ExpressionUUID->"4d791c57-1bfd-4deb-8e2c-\ 0366959be309"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{ "matrix", " ", "of", " ", "the", " ", "genotypes", " ", "of", " ", "all", " ", "individual", " ", "in", " ", "the", " ", "population"}]}], " ", ",", " ", RowBox[{ RowBox[{"and", " ", "of", " ", "dimensions", " ", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}], " ", ";", " ", RowBox[{ RowBox[{ "the", " ", "vector", " ", "of", " ", "selected", " ", "flowers", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"2", ",", " ", "population_size", ",", " ", "2"}], ")"}]}], " ", ":", " ", RowBox[{ "the", " ", "first", " ", "dimension", " ", "is", " ", "for", " ", "the", " ", "female", " ", "flowers"}]}]}], ",", " ", RowBox[{ "and", " ", "the", " ", "second", " ", "for", " ", "the", " ", "male", " ", "flowers"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "two", " ", "matrices", " ", "each", " ", "with", " ", "the", " ", "genotypes", " ", RowBox[{"(", RowBox[{"alle", " ", "allelic", " ", "effects"}], ")"}], " ", "of", " ", "either", " ", "selected", " ", "females", " ", "or", " ", "selected", " ", "males", " ", "and", " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"takegenotypes", "[", RowBox[{"genotypes_", ",", "chosenflowers_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"genotypes", "\[LeftDoubleBracket]", RowBox[{"chosenflowers", "\[LeftDoubleBracket]", RowBox[{"1", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], ",", RowBox[{"genotypes", "\[LeftDoubleBracket]", RowBox[{"chosenflowers", "\[LeftDoubleBracket]", RowBox[{"2", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], "}"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.663921907226733*^9, 3.6639219211917334`*^9}, { 3.663921987498133*^9, 3.663922019067933*^9}, {3.663922190101533*^9, 3.663922219392733*^9}, {3.663922252393733*^9, 3.663922408347133*^9}, { 3.6639224439241333`*^9, 3.6639225403435335`*^9}, {3.6639226588575335`*^9, 3.663922661384733*^9}, 3.663922796985733*^9, {3.6639230153637333`*^9, 3.663923050320733*^9}, {3.6639231698175335`*^9, 3.6639232059903336`*^9}, 3.663925165338333*^9, 3.663937194112533*^9, {3.6651338191840973`*^9, 3.665133825721509*^9}, {3.665133920169075*^9, 3.6651339399343095`*^9}, { 3.665315571304813*^9, 3.6653155727548957`*^9}, 3.665321373370672*^9, { 3.665321424700608*^9, 3.665321448830988*^9}, {3.6696335149725266`*^9, 3.6696335203155265`*^9}, {3.6696340431985264`*^9, 3.6696340466865263`*^9}, {3.6696355796385264`*^9, 3.6696355820215263`*^9}, {3.7481646753311987`*^9, 3.748164711233945*^9}, { 3.7481692677365074`*^9, 3.7481692775757523`*^9}, {3.748170075331986*^9, 3.748170159525033*^9}, {3.74929366644672*^9, 3.7492936784954095`*^9}, { 3.753599812176404*^9, 3.7535998347046127`*^9}, {3.7536003426689854`*^9, 3.7536003697260666`*^9}, {3.753612734943612*^9, 3.753612736064749*^9}, { 3.753783001583459*^9, 3.7537831947380247`*^9}, 3.7537866386733303`*^9, 3.794240421428626*^9, {3.815195059430601*^9, 3.8151950719933615`*^9}, { 3.819602412432909*^9, 3.819602537025035*^9}}, FontColor->GrayLevel[ 0],ExpressionUUID->"d56f53be-8cd8-41bf-889c-08695fbbe396"] }, Closed]], Cell[CellGroupData[{ Cell["build haploid gametes from female and male diploid genotypes", \ "Subsubsection", CellChangeTimes->{{3.7942171914151793`*^9, 3.7942172275912485`*^9}},ExpressionUUID->"6c7016b6-b317-4f0c-9dec-\ baa88876f268"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Inputs", " ", ":", " ", RowBox[{ "the", " ", "matrix", " ", "of", " ", "chosen", " ", "genotypes", " ", RowBox[{"(", RowBox[{"allelic", " ", "effects"}], ")"}], " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Uses", " ", "the", " ", "freerecombination", " ", "function", " ", "to", " ", "make", " ", "gametes", " ", "for", " ", "both", " ", "female", " ", "and", " ", "male", " ", "parents"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "a", " ", "matrix", " ", "of", " ", "genotypes", " ", "for", " ", "female", " ", "gametes", " ", "and", " ", "male", " ", "gametes", " ", "with", " ", "dimensions", " ", RowBox[{"(", RowBox[{"2", ",", " ", "population_size", ",", " ", "loci_number"}], ")"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"makegametes", "[", "parentgenotypes_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "nindiv", ",", "locinb", ",", "femalegamete", ",", "malegamete"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"nindiv", "=", RowBox[{ RowBox[{"Dimensions", "[", RowBox[{ "parentgenotypes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"locinb", "=", RowBox[{ RowBox[{ RowBox[{"Dimensions", "[", RowBox[{ "parentgenotypes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "/", "2"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"femalegamete", "=", " ", RowBox[{"freerecombination", "[", RowBox[{ RowBox[{ "parentgenotypes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", "nindiv", ",", "locinb"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegamete", "=", " ", RowBox[{"freerecombination", "[", RowBox[{ RowBox[{ "parentgenotypes", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "nindiv", ",", "locinb"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"femalegamete", ",", "malegamete"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.663921907226733*^9, 3.6639219211917334`*^9}, { 3.663921987498133*^9, 3.663922019067933*^9}, {3.663922190101533*^9, 3.663922219392733*^9}, {3.663922252393733*^9, 3.663922408347133*^9}, { 3.6639224439241333`*^9, 3.6639225403435335`*^9}, {3.6639226588575335`*^9, 3.663922661384733*^9}, 3.663922796985733*^9, {3.6639230153637333`*^9, 3.663923050320733*^9}, {3.6639231698175335`*^9, 3.6639232059903336`*^9}, 3.663925165338333*^9, 3.663937194112533*^9, {3.6651338191840973`*^9, 3.665133825721509*^9}, {3.665133920169075*^9, 3.6651339399343095`*^9}, { 3.665315571304813*^9, 3.6653155727548957`*^9}, {3.665321373370672*^9, 3.6653213756428022`*^9}, {3.665321735109362*^9, 3.665321754949497*^9}, { 3.6696314736975265`*^9, 3.6696315007035265`*^9}, {3.6696331647365265`*^9, 3.6696331696965265`*^9}, {3.6696343315335264`*^9, 3.6696343407165265`*^9}, {3.669635776299526*^9, 3.6696357816425266`*^9}, { 3.7481701626449504`*^9, 3.7481701665324016`*^9}, {3.7481705372943316`*^9, 3.7481706204882646`*^9}, {3.7481706565619154`*^9, 3.7481706993291826`*^9}, {3.748173210256487*^9, 3.748173226802044*^9}, { 3.753600394767004*^9, 3.753600395133229*^9}, {3.7536004683319817`*^9, 3.7536004847330017`*^9}, {3.7536005308932924`*^9, 3.753600561260007*^9}, { 3.753612922464913*^9, 3.75361296355162*^9}, 3.7536130743663893`*^9, { 3.753783214857179*^9, 3.753783234162595*^9}, {3.7537832957759523`*^9, 3.7537832960815*^9}, 3.7537866417959194`*^9, {3.8151952841709137`*^9, 3.815195288633666*^9}, {3.8196025554240875`*^9, 3.8196025650556383`*^9}, { 3.819602841262437*^9, 3.8196028415184517`*^9}}, FontColor->GrayLevel[ 0],ExpressionUUID->"3d69318b-1c9b-4fec-92d8-92335c4fa951"] }, Closed]], Cell[CellGroupData[{ Cell["recombination", "Subsubsection", CellChangeTimes->{{3.794217169975953*^9, 3.7942171848228025`*^9}},ExpressionUUID->"d8f2fc7f-e8ef-44ea-94ee-\ 1633767a31f3"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{ "a", " ", "matrix", " ", "of", " ", "genotypes", " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}]}], " ", ";", " ", RowBox[{"the", " ", "population", " ", "size"}], " ", ";", " ", RowBox[{"the", " ", "number", " ", "of", " ", "loci"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"generates", " ", "a", " ", "cache", " ", RowBox[{"(", "picking", ")"}]}], ",", " ", RowBox[{"and", " ", "its", " ", "conmplement", " ", RowBox[{"(", "complement", ")"}]}], ",", " ", RowBox[{ "containing", " ", "0", " ", "and", " ", "1", " ", "at", " ", "frequency", " ", "0.5", " ", "from", " ", "a", " ", "single", " ", "sample", " ", "of", " ", "a", " ", "large", " ", "binary", " ", "number", " ", "of", " ", "approprita", " ", "size"}], ",", " ", RowBox[{ RowBox[{ "maps", " ", "this", " ", "cache", " ", "on", " ", "each", " ", "genotype", " ", RowBox[{"(", RowBox[{"allelic", " ", "effects"}], ")"}], " ", "to", " ", "define", " ", "which", " ", "of", " ", "the", " ", "two", " ", "alleles", " ", "at", " ", "each", " ", "locus", " ", "will", " ", "eventually", " ", "recombine", " ", "to", " ", "produce", " ", "the", " ", "offspring", " ", "genotype"}], " ", "=", " ", RowBox[{ "builds", " ", "up", " ", "a", " ", "maternal", " ", "or", " ", "a", " ", "paternal", " ", "haplotype"}]}], ",", " ", RowBox[{"i", ".", "e", ".", " ", "gamete"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Returns", " ", "haplotypes", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"population_size", ",", " ", "loci_number"}], ")"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"freerecombination", "[", RowBox[{"genotypes_", ",", "nindiv_", ",", "nloci_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"picking", ",", "complement", ",", "gametes"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"picking", "=", RowBox[{"Partition", "[", RowBox[{ RowBox[{"IntegerDigits", "[", RowBox[{ RowBox[{"IntegerPart", "[", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"{", RowBox[{"0", ",", RowBox[{ SuperscriptBox["2", RowBox[{"nindiv", " ", "nloci"}]], "-", "1"}]}], "}"}], ",", RowBox[{"WorkingPrecision", "\[Rule]", RowBox[{"Ceiling", "[", RowBox[{"Log", "[", RowBox[{"10", ",", RowBox[{ RowBox[{"1.", " ", SuperscriptBox["2", RowBox[{"nindiv", " ", "nloci"}]]}], "-", "1"}]}], "]"}], "]"}]}]}], "]"}], "]"}], ",", "2", ",", RowBox[{"nindiv", "*", "nloci"}]}], "]"}], ",", "nloci"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"complement", "=", RowBox[{ RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"ConstantArray", "[", RowBox[{"1", ",", RowBox[{"{", RowBox[{ RowBox[{"nindiv", "*", "nloci"}], ",", "1"}], "}"}]}], "]"}], "]"}], ",", "nloci"}], "]"}], "-", "picking"}]}], ";", "\[IndentingNewLine]", RowBox[{"gametes", "=", RowBox[{"genotypes", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"Riffle", "[", RowBox[{"picking", ",", "complement"}], "]"}], "]"}], ",", RowBox[{"2", "*", "nloci"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"gametes", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;", "nindiv"}], ",", RowBox[{"1", ";;", "nloci"}]}], "\[RightDoubleBracket]"}], "+", RowBox[{"gametes", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;", "nindiv"}], ",", RowBox[{ RowBox[{"nloci", "+", "1"}], ";;", RowBox[{"2", "*", "nloci"}]}]}], "\[RightDoubleBracket]"}]}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.663921907226733*^9, 3.6639219211917334`*^9}, { 3.663921987498133*^9, 3.663922019067933*^9}, {3.663922190101533*^9, 3.663922219392733*^9}, {3.663922252393733*^9, 3.663922408347133*^9}, { 3.6639224439241333`*^9, 3.6639225403435335`*^9}, {3.6639226588575335`*^9, 3.663922661384733*^9}, 3.663922796985733*^9, {3.6639230153637333`*^9, 3.663923050320733*^9}, {3.6639231698175335`*^9, 3.6639232059903336`*^9}, 3.663925165338333*^9, 3.663937194112533*^9, {3.6651338191840973`*^9, 3.665133825721509*^9}, {3.665133920169075*^9, 3.6651339399343095`*^9}, { 3.665315571304813*^9, 3.6653155727548957`*^9}, {3.665321373370672*^9, 3.6653213779949365`*^9}, 3.665321714545186*^9, {3.7536005799003716`*^9, 3.7536007691631184`*^9}, 3.7536035693602486`*^9, 3.7536131441236043`*^9, { 3.7537833029226294`*^9, 3.753783303918053*^9}, {3.7537834411845713`*^9, 3.7537835353846626`*^9}, 3.7537866408823647`*^9, {3.819602861633602*^9, 3.819602990909996*^9}, {3.819603023535862*^9, 3.819603259404353*^9}}, FontColor->GrayLevel[ 0],ExpressionUUID->"09c20ba4-3eca-4612-8763-5d67af72b25e"] }, Closed]], Cell[CellGroupData[{ Cell["mutation", "Subsubsection", CellChangeTimes->{{3.794217254998816*^9, 3.7942172659584427`*^9}},ExpressionUUID->"fa0e5c43-186d-4b9f-95e7-\ 3c46b140178d"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{ "a", " ", "vector", " ", "containing", " ", "the", " ", "mutation", " ", "rate", " ", RowBox[{"(", "U", ")"}], " ", "for", " ", "the", " ", "trait", " ", "and", " ", "the", " ", "mutation", " ", "variance", " ", RowBox[{"(", "Vm", ")"}], " ", "for", " ", "the", " ", "trait"}]}], ";", " ", RowBox[{ "the", " ", "matrix", " ", "of", " ", "gametes", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"population_size", ",", " ", "loci_number"}], ")"}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ "Random", " ", "samples", " ", "an", " ", "expected", " ", "number", " ", "of", " ", "mutants", " ", "for", " ", "each", " ", "locus", " ", "in", " ", "a", " ", "Poisson", " ", "distribution", " ", "of", " ", "mean", " ", "allelic", " ", "mutation", " ", "rate", " ", RowBox[{"(", RowBox[{ RowBox[{"U", "/", "2"}], "L"}], ")"}]}], ",", " ", RowBox[{ "then", " ", "random", " ", "samples", " ", "individuals", " ", "that", " ", "mutate", " ", "and", " ", "finaly", " ", "samples", " ", "the", " ", "allelic", " ", "effect", " ", "of", " ", "mutation", " ", "in", " ", "a", " ", "normal", " ", "distribution", " ", "with", " ", "a", " ", "mean", " ", "0", " ", "and", " ", "an", " ", "allelic", " ", "mutational", " ", "variance", " ", "of", " ", RowBox[{"Vm", "/", "U"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "gametes", " ", "after", " ", "mutation", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"population_size", ",", " ", "loci_number"}], ")"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"gametemutation", "[", RowBox[{"mutation_", ",", "gametes_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "nindiv", ",", "nloci", ",", "nbmutants", ",", "mutants", ",", "mutationeffect", ",", "mutatedgametes", ",", "locus"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"nindiv", "=", RowBox[{ RowBox[{"Dimensions", "[", "gametes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nloci", "=", RowBox[{ RowBox[{"Dimensions", "[", "gametes", "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nbmutants", "=", RowBox[{"RandomInteger", "[", RowBox[{ RowBox[{"PoissonDistribution", "[", RowBox[{"nindiv", "*", RowBox[{ RowBox[{ RowBox[{ "mutation", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "/", "2"}], "/", "nloci"}]}], "]"}], ",", "nloci"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"mutants", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomSample", "[", RowBox[{ RowBox[{"Range", "[", "nindiv", "]"}], ",", RowBox[{ "nbmutants", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "nbmutants", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", RowBox[{"mutationeffect", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", RowBox[{"Sqrt", "[", RowBox[{ RowBox[{ "mutation", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "/", RowBox[{ "mutation", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], "]"}], ",", RowBox[{ "nbmutants", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", "nloci"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"mutatedgametes", "=", "gametes"}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"locus", "=", "1"}], ",", RowBox[{"locus", "\[LessEqual]", "nloci"}], ",", RowBox[{"locus", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"mutatedgametes", "\[LeftDoubleBracket]", RowBox[{ RowBox[{ "mutants", "\[LeftDoubleBracket]", "locus", "\[RightDoubleBracket]"}], ",", "locus"}], "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{"gametes", "\[LeftDoubleBracket]", RowBox[{ RowBox[{ "mutants", "\[LeftDoubleBracket]", "locus", "\[RightDoubleBracket]"}], ",", "locus"}], "\[RightDoubleBracket]"}], "+", RowBox[{ "mutationeffect", "\[LeftDoubleBracket]", "locus", "\[RightDoubleBracket]"}]}]}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "mutatedgametes"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.663921907226733*^9, 3.6639219211917334`*^9}, { 3.663921987498133*^9, 3.663922019067933*^9}, {3.663922190101533*^9, 3.663922219392733*^9}, {3.663922252393733*^9, 3.663922408347133*^9}, { 3.6639224439241333`*^9, 3.6639225403435335`*^9}, {3.6639226588575335`*^9, 3.663922661384733*^9}, 3.663922796985733*^9, {3.6639230153637333`*^9, 3.663923050320733*^9}, {3.6639231698175335`*^9, 3.6639232059903336`*^9}, 3.663925165338333*^9, 3.663937194112533*^9, {3.6651338191840973`*^9, 3.665133825721509*^9}, {3.665133920169075*^9, 3.6651339399343095`*^9}, { 3.665315571304813*^9, 3.6653155727548957`*^9}, {3.665321373370672*^9, 3.6653213779949365`*^9}, {3.6653217803629503`*^9, 3.665321798678998*^9}, { 3.6653224736346035`*^9, 3.665322479214923*^9}, {3.6653225397103825`*^9, 3.665322541565489*^9}, {3.6653225793576508`*^9, 3.6653225870540905`*^9}, { 3.6653851120135612`*^9, 3.665385113772561*^9}, {3.74817088205264*^9, 3.7481708897804756`*^9}, {3.7481709217390413`*^9, 3.748171176966933*^9}, { 3.749294138005692*^9, 3.7492941391097555`*^9}, {3.753600848138685*^9, 3.753600856104972*^9}, {3.7536008909389315`*^9, 3.7536008976583233`*^9}, { 3.7536009413370037`*^9, 3.7536010667754946`*^9}, {3.7536029220295105`*^9, 3.753602985631562*^9}, {3.753603578639902*^9, 3.7536035791994934`*^9}, { 3.753613183901499*^9, 3.7536132060781317`*^9}, {3.7536132770686707`*^9, 3.753613292715215*^9}, {3.7537835473516655`*^9, 3.7537835721573706`*^9}, { 3.753783699975581*^9, 3.753783724231724*^9}, 3.753786643602024*^9, { 3.7942409329465036`*^9, 3.794240971165251*^9}, {3.7942849806615257`*^9, 3.7942849817546577`*^9}, {3.8151955981370993`*^9, 3.8151955990364246`*^9}, {3.8151956951212883`*^9, 3.8151957382698855`*^9}, {3.8196032827186866`*^9, 3.819603315946587*^9}}, FontColor->GrayLevel[ 0],ExpressionUUID->"e88c6ba3-5eaa-41a1-b0fb-96f82b726fae"] }, Closed]], Cell[CellGroupData[{ Cell["merge inherited male and female gametes", "Subsubsection", CellChangeTimes->{{3.794217276847066*^9, 3.7942172922469463`*^9}},ExpressionUUID->"93254ca7-ddef-42ce-9fc9-\ aeb421972a48"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{"female", " ", "gametes", " ", "after", " ", "mutation"}]}], " ", ";", " ", RowBox[{"male", " ", "gametes", " ", "after", " ", "mutation"}], ";", " ", RowBox[{"each", " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"population_size", ",", " ", "loci_number"}], ")"}]}], ";", " ", RowBox[{"the", " ", "number", " ", "of", " ", "loci"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "merges", " ", "matrices", " ", "of", " ", "female", " ", "and", " ", "male", " ", "gametes", " ", "in", " ", "a", " ", "unique", " ", "matrix", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Returns", " ", "a", " ", "matrix", " ", "of", " ", "offspring", " ", "genotypes", " ", RowBox[{"(", RowBox[{"allelic", " ", "effects"}], ")"}], " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"makeoffsprings", "[", RowBox[{"femalegametes_", ",", "malegametes_", ",", "nbloci_"}], "]"}], ":=", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"Riffle", "[", RowBox[{"femalegametes", ",", "malegametes"}], "]"}], "]"}], ",", RowBox[{"2", "*", "nbloci"}]}], "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.6653155826114597`*^9, 3.66531561461329*^9}, 3.665315650395336*^9, {3.665397155550561*^9, 3.665397178748561*^9}, { 3.667742830194728*^9, 3.6677428330651283`*^9}, {3.669548809445526*^9, 3.6695489331985264`*^9}, {3.669548966108526*^9, 3.6695489725715265`*^9}, { 3.6695505092175264`*^9, 3.6695505352035265`*^9}, {3.6695505960805264`*^9, 3.6695506126545267`*^9}, 3.6695506690355263`*^9, {3.6695507377515264`*^9, 3.669550738695526*^9}, {3.6696095912845263`*^9, 3.6696096083715267`*^9}, { 3.6696119301755266`*^9, 3.6696119314225264`*^9}, {3.6696315677415266`*^9, 3.6696316828055267`*^9}, {3.6696319261675262`*^9, 3.669631950405526*^9}, 3.6697189400435266`*^9, {3.748171185398034*^9, 3.74817137598841*^9}, { 3.7489448500032005`*^9, 3.7489448956205015`*^9}, {3.7489449754471235`*^9, 3.748945087253804*^9}, {3.7489451689175467`*^9, 3.748945255122999*^9}, { 3.748945472035398*^9, 3.7489455778115735`*^9}, {3.7489456101144295`*^9, 3.748945632754267*^9}, {3.748945696833521*^9, 3.748945697489729*^9}, { 3.748945756608363*^9, 3.748945864928958*^9}, {3.7489459078746195`*^9, 3.7489459123367043`*^9}, {3.748945970065797*^9, 3.7489459814900637`*^9}, 3.7489461673747363`*^9, {3.7493735861014643`*^9, 3.7493736275408697`*^9}, { 3.753527235295807*^9, 3.753527239727618*^9}, {3.753527316834094*^9, 3.753527318161294*^9}, {3.7536030686415854`*^9, 3.753603099314638*^9}, { 3.7536133222031627`*^9, 3.75361333162718*^9}, {3.753783736598657*^9, 3.7537837375750465`*^9}, {3.753783772699137*^9, 3.753783824521617*^9}, 3.7537866455367966`*^9, {3.815196501927801*^9, 3.81519650619742*^9}, { 3.81960333243053*^9, 3.819603387962706*^9}}, FontColor->GrayLevel[ 0],ExpressionUUID->"01b913ae-0b27-41b5-ac6a-06108029e2f2"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Make one generation", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.6651338492463503`*^9, 3.665133857139964*^9}, {3.749205761446435*^9, 3.749205764084938*^9}, {3.7493780303948536`*^9, 3.7493780340590563`*^9}, { 3.7536034276155806`*^9, 3.753603428319709*^9}, 3.753783865573803*^9, { 3.794216855241951*^9, 3.7942168564500203`*^9}, {3.819603482200096*^9, 3.8196034830301437`*^9}},ExpressionUUID->"11e61799-4f02-404b-8d39-\ 1ba6c5ed31c7"], Cell[BoxData[ RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{ RowBox[{" ", RowBox[{ RowBox[{ "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "\[IndentingNewLine]", "For"}], " ", "each", " ", RowBox[{"function", " ", ":", "\[IndentingNewLine]", RowBox[{ RowBox[{ "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**", "**"}], "*", "\n", "Inputs"}], " ", ":", " ", RowBox[{"the", " ", "matrix", " ", "of", " ", RowBox[{"genotypes", " ", "'"}], "allelic", " ", "effects"}]}]}], ")"}], " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}], " ", ";", " ", RowBox[{ RowBox[{ "a", " ", "vector", " ", "of", " ", "environmental", " ", "effects", " ", "with", " ", "dimension", RowBox[{"(", "population_size", ")"}], " ", "for", " ", "the", " ", "previous"}], " ", "=", " ", RowBox[{"current", " ", "generation"}]}], " ", ";", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{ "the", " ", "matrix", " ", "of", " ", "individual", " ", "flowering", " ", "phenologies", " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"pop_size", ",", " ", RowBox[{"flower_number", "_per", "_plant"}], ",", " ", "2"}], ")"}], " ", "containing", " ", "for", " ", "each", " ", "individual", " ", RowBox[{"(", RowBox[{"ie", ".", " ", "line"}], ")"}], " ", "an", " ", "individual", " ", "identification", " ", "number", " ", "and", " ", "the", " ", "days", " ", "at", " ", "which", " ", "its", " ", "flowers", " ", "are", " ", "opened", " ", "in", " ", "the", " ", "season", " ", "and", " ", "for", " ", "the", " ", "previous"}], " ", "=", " ", RowBox[{"current", " ", "generation"}]}], ";", RowBox[{ "the", " ", "vector", " ", "of", " ", "selected", " ", "female", " ", "and", " ", "male", " ", "flowers", " ", "of", " ", "dimension", " ", RowBox[{"(", RowBox[{"2", ",", " ", "population_size", ",", " ", "2"}], ")"}]}], " ", ";", " ", RowBox[{ "parameters", " ", "for", " ", "the", " ", "optimum", " ", "and", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function"}], " ", ";", " ", RowBox[{"parameters", " ", "for", " ", "environmental", " ", "effects"}], " ", ";", " ", RowBox[{"parameters", " ", "for", " ", "mutation"}], " ", ";", " ", RowBox[{ "the", " ", "distribution", " ", "of", " ", "open", " ", "flowers", " ", "for", " ", "an", " ", "individual", " ", "plant"}], " ", ";", " ", RowBox[{ "the", " ", "number", " ", "of", " ", "flowers", " ", "produced", " ", "per", " ", "plant"}], " ", ";", " ", RowBox[{"the", " ", "population", " ", "size"}], " ", ";", " ", RowBox[{"the", " ", "speed", " ", "of", " ", "the", " ", "optimum"}], " ", ";", " ", RowBox[{"the", " ", "variance", " ", "in", " ", "the", " ", "optimum"}], " ", ";", " ", RowBox[{ RowBox[{ "the", " ", "variance", " ", "of", " ", "the", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function", " ", "\[IndentingNewLine]", "\[IndentingNewLine]", "Computes", " ", "phenotypes", " ", "as", " ", "genotypic_values"}], "+", RowBox[{ "environmental_effects", " ", "for", " ", "the", " ", "current", " ", "generation"}]}]}], ",", " ", RowBox[{"individual", " ", "flowering", " ", "phenologies"}], ",", " ", RowBox[{ "samples", " ", "flowers", " ", "which", " ", "reproduce", " ", "and", " ", "builds", " ", "genotypes", " ", "for", " ", "parents", " ", "of", " ", "the", " ", "current", " ", "generation"}], ",", " ", RowBox[{ "creates", " ", "maternal", " ", "and", " ", "paternal", " ", "gametes", " ", "to", " ", "make", " ", "offspring", " ", "genotypes"}], ",", " ", RowBox[{ "while", " ", "including", " ", "recombination", " ", "and", " ", "mutation"}], ",", " ", RowBox[{ "modifies", " ", "optimum", " ", "of", " ", "selection", " ", "function", " ", "according", " ", "climate", " ", "scenario", " ", RowBox[{"(", RowBox[{ "width", " ", "of", " ", "the", " ", "selection", " ", "function", " ", "is", " ", "kept", " ", "constant"}], ")"}]}], ",", " ", RowBox[{"samples", " ", "environmental", " ", "effects", " ", "for", " ", RowBox[{"theseoffsprings", ".", "\[IndentingNewLine]", "Only"}], " ", "the", " ", "genotypes", " ", "are", " ", "used", " ", "to", " ", "make", " ", "the", " ", "next", " ", "generation"}], ",", " ", RowBox[{ RowBox[{ "and", " ", "the", " ", "other", " ", "variables", " ", "are", " ", "used", " ", "to", " ", "estimate", " ", "quantitative", " ", "genetics", " ", "parameters", "\[IndentingNewLine]", "\[IndentingNewLine]", "Returns", " ", "the", " ", "matrix", " ", "of", " ", "genotypes", " ", "of", " ", "the", " ", "next", " ", "generation", " ", "of", " ", "dimensions", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}], " ", ";", " ", RowBox[{ "a", " ", "vector", " ", "of", " ", "environmental", " ", "effects", " ", "of", " ", "dimension", RowBox[{"(", "population_size", ")"}]}], " ", ";", " ", RowBox[{ "the", " ", "matrix", " ", "of", " ", "individual", " ", "flowering", " ", "phenologies", " ", "of", " ", "dimension", RowBox[{"(", RowBox[{"pop_size", ",", " ", RowBox[{"flower_number", "_per", "_plant"}], ",", " ", "2"}], ")"}]}], " ", ";", RowBox[{ "the", " ", "vector", " ", "of", " ", "selected", " ", "female", " ", "and", " ", "male", " ", "flowers", " ", "of", " ", "the", " ", "dimensions", RowBox[{"(", RowBox[{"2", ",", " ", "population_size", ",", " ", "2"}], ")"}]}], " ", ";", " ", RowBox[{ "the", " ", "vector", " ", "containing", " ", "values", " ", "for", " ", "the", " ", "optimum", " ", "and", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function"}]}]}], "*)"}]], "Input", CellChangeTimes->{{3.8196035088246193`*^9, 3.8196035094806566`*^9}, { 3.8243712066200156`*^9, 3.8243712358792152`*^9}}, ExpressionUUID -> "87b5eb75-2dd0-437b-afa3-268430b59a79"], Cell[CellGroupData[{ Cell["\<\ make the next generation when environment changes among generations \ (stabilizing, directional and fluctuating selection)\ \>", "Subsubsection", CellChangeTimes->{{3.794217604619813*^9, 3.794217645196134*^9}, { 3.7942177544913855`*^9, 3.794217771235343*^9}},ExpressionUUID->"8ae587c6-560b-45b3-aceb-\ 30c5a1b0fd05"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"makeonegeneration", "[", RowBox[{ RowBox[{"{", RowBox[{ "genotypes_", ",", "environmentaleffects_", ",", "popflowers_", ",", "previousselectedflowers_", ",", "optimumstats_"}], " ", "}"}], ",", "environmental_", ",", "mutational_", ",", "individualflowering_", ",", "flowernb_", ",", "size_", ",", "optimumdisplacement_", ",", " ", "optimumfluct_", ",", "intensityfluct_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"phenotypes", ",", "listofflowers", ",", "selectedflowers", StyleBox[",", FontWeight->"Plain"], "parentalgenotypes", ",", "allgametes", ",", "femalegametesmut", ",", "malegametesmut", ",", "nextgenotypes", ",", "nextoptimumstats", ",", "nextenvironmentaleffects"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"phenotypes", " ", "=", " ", RowBox[{ RowBox[{"Total", "[", RowBox[{"Transpose", "[", "genotypes", "]"}], "]"}], "+", "environmentaleffects"}]}], ";", "\[IndentingNewLine]", RowBox[{"listofflowers", " ", "=", " ", RowBox[{"buildconstantphenology", "[", RowBox[{"phenotypes", ",", "individualflowering", ",", "flowernb"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"selectedflowers", "=", RowBox[{"flowerselectionfunction", "[", RowBox[{"listofflowers", ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"parentalgenotypes", "=", RowBox[{"takegenotypes", "[", RowBox[{"genotypes", ",", "selectedflowers"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"allgametes", "=", RowBox[{"makegametes", "[", "parentalgenotypes", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"femalegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextgenotypes", "=", RowBox[{"makeoffsprings", "[", RowBox[{"femalegametesmut", ",", "malegametesmut", ",", RowBox[{ RowBox[{"Dimensions", "[", "femalegametesmut", "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextoptimumstats", "=", RowBox[{"Flatten", "[", " ", RowBox[{"changeoptimum", "[", RowBox[{ RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", " ", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "k", ",", " ", "optimumfluct", ",", "intensityfluct"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextenvironmentaleffects", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ "environmental", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"Sqrt", "[", RowBox[{ "environmental", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "]"}]}], "]"}], ",", RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ "nextgenotypes", ",", "nextenvironmentaleffects", ",", "listofflowers", ",", "selectedflowers", ",", "nextoptimumstats"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.749372843545705*^9, 3.7493729342698917`*^9}, { 3.7493729800148125`*^9, 3.749373045601315*^9}, {3.749373094467449*^9, 3.7493730946256585`*^9}, {3.7493732244525623`*^9, 3.7493732379091334`*^9}, {3.7493733112514462`*^9, 3.7493733519080963`*^9}, {3.749373385938807*^9, 3.749373433253831*^9}, { 3.7493736377336445`*^9, 3.7493738099417105`*^9}, {3.7493738493790865`*^9, 3.7493739442925406`*^9}, {3.7493739751065383`*^9, 3.749374011890492*^9}, { 3.7493740474286737`*^9, 3.749374147668069*^9}, {3.7493742352669873`*^9, 3.74937426595487*^9}, 3.7493743635394306`*^9, {3.749374401106512*^9, 3.7493744021465907`*^9}, {3.749374486801838*^9, 3.7493745056179905`*^9}, { 3.749374750130747*^9, 3.7493749188000183`*^9}, {3.749374954591817*^9, 3.7493749700474887`*^9}, {3.749375131439827*^9, 3.7493752155201006`*^9}, { 3.7493753225894523`*^9, 3.7493753698234844`*^9}, {3.7493757366054564`*^9, 3.749375737837799*^9}, {3.749375975869536*^9, 3.749376015100771*^9}, { 3.749376510056526*^9, 3.74937660697138*^9}, {3.7493766442200747`*^9, 3.7493767071181183`*^9}, {3.7493767447810125`*^9, 3.749376756798075*^9}, { 3.7493768233741884`*^9, 3.749376838495863*^9}, 3.749376953601498*^9, { 3.7493772206059813`*^9, 3.7493773855040417`*^9}, {3.749377498669488*^9, 3.749377560765937*^9}, {3.7493778041570973`*^9, 3.749377807566059*^9}, { 3.749378005694414*^9, 3.7493780262736015`*^9}, 3.749379655747858*^9, { 3.749379788054034*^9, 3.749379806358448*^9}, {3.7493799702055597`*^9, 3.749380009662153*^9}, {3.7494497378335886`*^9, 3.749449745896637*^9}, { 3.7494497900064573`*^9, 3.7494498103324337`*^9}, 3.749449852822443*^9, { 3.749450095815463*^9, 3.749450105847047*^9}, {3.7494513024968786`*^9, 3.7494513176005435`*^9}, {3.7535291551178446`*^9, 3.753529234812224*^9}, { 3.753529391083872*^9, 3.7535294514995923`*^9}, {3.753531932717682*^9, 3.753531978075614*^9}, {3.753532029948481*^9, 3.753532050541602*^9}, { 3.7535998173133197`*^9, 3.75359982859305*^9}, {3.7536003884777*^9, 3.7536003888449016`*^9}, {3.753600860201423*^9, 3.7536008609846563`*^9}, { 3.753603449521695*^9, 3.7536034512815285`*^9}, {3.7536035906724615`*^9, 3.753603788077252*^9}, {3.753613412572009*^9, 3.753613456429162*^9}, { 3.7536135095991726`*^9, 3.753613515582801*^9}, {3.753613584465328*^9, 3.753613591328873*^9}, {3.7536136365796347`*^9, 3.7536137744862967`*^9}, { 3.7536138201042595`*^9, 3.7536138496249247`*^9}, {3.7536139588579493`*^9, 3.7536139698984118`*^9}, {3.7536140047787247`*^9, 3.753614142875419*^9}, { 3.7536142019632697`*^9, 3.75361422457156*^9}, {3.7536142861560383`*^9, 3.75361431465182*^9}, {3.7537838623514194`*^9, 3.7537838633208275`*^9}, { 3.753783924966998*^9, 3.7537841700297837`*^9}, {3.753784222357836*^9, 3.7537842290978785`*^9}, {3.753784316951936*^9, 3.753784323896366*^9}, { 3.753784362750507*^9, 3.7537843730379534`*^9}, 3.753786646976907*^9, { 3.760384687352818*^9, 3.7603847437419558`*^9}, {3.760392040447057*^9, 3.760392045095048*^9}, 3.760454015859486*^9, {3.784912261006554*^9, 3.784912326093529*^9}, {3.78548245259118*^9, 3.7854824541545*^9}, 3.785482498855853*^9, {3.785485650062641*^9, 3.78548568148351*^9}, 3.794123523912916*^9, {3.794217570260848*^9, 3.794217595951318*^9}},ExpressionUUID->"1240a2f5-1a55-4afa-8ca9-\ a2730b77a672"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ make the next generation when environment does not change among generations \ (no selection or stabilizing selection)\ \>", "Subsubsection", CellChangeTimes->{{3.794217604619813*^9, 3.79421765491669*^9}, { 3.7942851831164913`*^9, 3.794285197655957*^9}, {3.815197021012006*^9, 3.8151970216353545`*^9}},ExpressionUUID->"04b9d738-2b0d-4bee-9f92-\ df8c788cf716"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "Same", " ", "function", " ", "than", " ", "previous", " ", "except", " ", "optimum", " ", "and", " ", "width", " ", "of", " ", "the", " ", "selection", " ", "function", " ", RowBox[{"don", "'"}], "t", " ", "change"}], " ", "=", RowBox[{">", " ", RowBox[{ "used", " ", "for", " ", "neutral", " ", "and", " ", "stabilizing", " ", "scenarii"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"makeonegenerationnofluctuation", "[", RowBox[{ RowBox[{"{", RowBox[{ "genotypes_", ",", "environmentaleffects_", ",", "popflowers_", ",", "previousselectedflowers_", ",", "optimumstats_"}], " ", "}"}], ",", "environmental_", ",", "mutational_", ",", "individualflowering_", ",", "flowernb_", ",", "size_", ",", "optimumdisplacement_", ",", " ", "optimumfluct_", ",", "intensityfluct_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"phenotypes", ",", "listofflowers", ",", "selectedflowers", StyleBox[",", FontWeight->"Plain"], "parentalgenotypes", ",", "allgametes", ",", "femalegametesmut", ",", "malegametesmut", ",", "nextgenotypes", ",", "nextoptimumstats", ",", "nextenvironmentaleffects"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"phenotypes", " ", "=", " ", RowBox[{ RowBox[{"Total", "[", RowBox[{"Transpose", "[", "genotypes", "]"}], "]"}], "+", "environmentaleffects"}]}], ";", "\[IndentingNewLine]", RowBox[{"listofflowers", " ", "=", " ", RowBox[{"buildconstantphenology", "[", RowBox[{"phenotypes", ",", "individualflowering", ",", "flowernb"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"selectedflowers", "=", RowBox[{"flowerselectionfunction", "[", RowBox[{"listofflowers", ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"parentalgenotypes", "=", RowBox[{"takegenotypes", "[", RowBox[{"genotypes", ",", "selectedflowers"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"allgametes", "=", RowBox[{"makegametes", "[", "parentalgenotypes", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"femalegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextgenotypes", "=", RowBox[{"makeoffsprings", "[", RowBox[{"femalegametesmut", ",", "malegametesmut", ",", RowBox[{ RowBox[{"Dimensions", "[", "femalegametesmut", "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextenvironmentaleffects", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ "environmental", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"Sqrt", "[", RowBox[{ "environmental", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "]"}]}], "]"}], ",", RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ "nextgenotypes", ",", "nextenvironmentaleffects", ",", "listofflowers", ",", "selectedflowers", ",", "optimumstats"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.7536034540814404`*^9, 3.7536034642742147`*^9}, 3.7536034984669337`*^9, {3.753614456890648*^9, 3.753614621911915*^9}, { 3.7537843884547276`*^9, 3.753784403654112*^9}, 3.785482471068448*^9, 3.78548250311128*^9, {3.7942850761148186`*^9, 3.7942850799101353`*^9}},ExpressionUUID->"9ef258f0-7ddd-4be8-8024-\ b8de163c3ac3"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ make the next generation when environment changes among generations with no \ fluctuations (directional selection)\ \>", "Subsubsection", CellChangeTimes->{{3.794217604619813*^9, 3.794217645196134*^9}, { 3.794217677331972*^9, 3.794217680228138*^9}, {3.7942851758052835`*^9, 3.794285179773952*^9}},ExpressionUUID->"b0c84ef7-e781-4fbc-864d-\ 7f024215dc34"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "Same", " ", "function", " ", "than", " ", "previous", " ", "except", " ", "there", " ", "is", " ", "a", " ", "directional", " ", "change", " ", "of", " ", "the", " ", "optimum", " ", "and", " ", "no", " ", "fluctuation", " ", "on", " ", "optimum"}], " ", "=", RowBox[{">", " ", RowBox[{"used", " ", "for", " ", "directional", " ", "scenarii"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"makeonegenerationdirectional", "[", RowBox[{ RowBox[{"{", RowBox[{ "genotypes_", ",", "environmentaleffects_", ",", "popflowers_", ",", "previousselectedflowers_", ",", "optimumstats_"}], " ", "}"}], ",", "environmental_", ",", "mutational_", ",", "individualflowering_", ",", "flowernb_", ",", "size_", ",", "optimumdisplacement_", ",", " ", "optimumfluct_", ",", "intensityfluct_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"phenotypes", ",", "listofflowers", ",", "selectedflowers", StyleBox[",", FontWeight->"Plain"], "parentalgenotypes", ",", "allgametes", ",", "femalegametesmut", ",", "malegametesmut", ",", "nextgenotypes", ",", "nextoptimumstats", ",", "nextenvironmentaleffects"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"phenotypes", " ", "=", " ", RowBox[{ RowBox[{"Total", "[", RowBox[{"Transpose", "[", "genotypes", "]"}], "]"}], "+", "environmentaleffects"}]}], ";", "\[IndentingNewLine]", RowBox[{"listofflowers", " ", "=", " ", RowBox[{"buildconstantphenology", "[", RowBox[{"phenotypes", ",", "individualflowering", ",", "flowernb"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"selectedflowers", "=", RowBox[{"flowerselectionfunction", "[", RowBox[{"listofflowers", ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"parentalgenotypes", "=", RowBox[{"takegenotypes", "[", RowBox[{"genotypes", ",", "selectedflowers"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"allgametes", "=", RowBox[{"makegametes", "[", "parentalgenotypes", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"femalegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextgenotypes", "=", RowBox[{"makeoffsprings", "[", RowBox[{"femalegametesmut", ",", "malegametesmut", ",", RowBox[{ RowBox[{"Dimensions", "[", "femalegametesmut", "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextoptimumstats", "=", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "+", "optimumdisplacement"}], ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextenvironmentaleffects", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ "environmental", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"Sqrt", "[", RowBox[{ "environmental", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "]"}]}], "]"}], ",", RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ "nextgenotypes", ",", "nextenvironmentaleffects", ",", "listofflowers", ",", "selectedflowers", ",", "nextoptimumstats"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.758049986876483*^9, 3.7580500013555546`*^9}, { 3.7580506992087727`*^9, 3.758050705794963*^9}, {3.7580512781568317`*^9, 3.758051283323493*^9}, {3.758051468504441*^9, 3.7580514773582964`*^9}, { 3.758051920924689*^9, 3.75805192710266*^9}, {3.758052412877043*^9, 3.7580524180872035`*^9}, {3.758053278290374*^9, 3.758053287815153*^9}, { 3.758053590026953*^9, 3.7580535982801995`*^9}, {3.7580541824822187`*^9, 3.758054252066574*^9}, {3.760387832332215*^9, 3.7603878350658655`*^9}, { 3.785482479492505*^9, 3.785482508487834*^9}, {3.794285107763492*^9, 3.7942851167778463`*^9}, {3.8151971382812943`*^9, 3.815197144898595*^9}},ExpressionUUID->"828ede0b-9e33-4852-afb5-\ 53203cae8208"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ make the next generation when only fluctuations of the environment among \ generations (fluctuating selection)\ \>", "Subsubsection", CellChangeTimes->{{3.794217604619813*^9, 3.794217645196134*^9}, { 3.794217714380091*^9, 3.794217723507613*^9}, {3.7942852040959682`*^9, 3.7942852099117327`*^9}},ExpressionUUID->"45b6fd24-3290-4010-a0e1-\ d070408ce1da"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "Same", " ", "function", " ", "than", " ", "previous", " ", "except", " ", "there", " ", "are", " ", "fluctuations", " ", "on", " ", "optimum", " ", "and", " ", "no", " ", "directional", " ", "change", " ", "of", " ", "the", " ", "optimum"}], " ", "=", RowBox[{">", " ", RowBox[{"used", " ", "for", " ", "fluctuating", " ", "scenarii"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"makeonegenerationoptimumfluct", "[", RowBox[{ RowBox[{"{", RowBox[{ "genotypes_", ",", "environmentaleffects_", ",", "popflowers_", ",", "previousselectedflowers_", ",", "optimumstats_"}], " ", "}"}], ",", "environmental_", ",", "mutational_", ",", "individualflowering_", ",", "flowernb_", ",", "size_", ",", "optimumdisplacement_", ",", " ", "optimumfluct_", ",", "intensityfluct_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"phenotypes", ",", "listofflowers", ",", "selectedflowers", StyleBox[",", FontWeight->"Plain"], "parentalgenotypes", ",", "allgametes", ",", "femalegametesmut", ",", "malegametesmut", ",", "nextgenotypes", ",", "nextoptimumstats", ",", "nextenvironmentaleffects"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"phenotypes", " ", "=", " ", RowBox[{ RowBox[{"Total", "[", RowBox[{"Transpose", "[", "genotypes", "]"}], "]"}], "+", "environmentaleffects"}]}], ";", "\[IndentingNewLine]", RowBox[{"listofflowers", " ", "=", " ", RowBox[{"buildconstantphenology", "[", RowBox[{"phenotypes", ",", "individualflowering", ",", "flowernb"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"selectedflowers", "=", RowBox[{"flowerselectionfunction", "[", RowBox[{"listofflowers", ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "size"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"parentalgenotypes", "=", RowBox[{"takegenotypes", "[", RowBox[{"genotypes", ",", "selectedflowers"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"allgametes", "=", RowBox[{"makegametes", "[", "parentalgenotypes", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"femalegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegametesmut", "=", RowBox[{"gametemutation", "[", RowBox[{"mutational", ",", RowBox[{ "allgametes", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextgenotypes", "=", RowBox[{"makeoffsprings", "[", RowBox[{"femalegametesmut", ",", "malegametesmut", ",", RowBox[{ RowBox[{"Dimensions", "[", "femalegametesmut", "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextoptimumstats", "=", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"{", RowBox[{ RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"0", ",", RowBox[{"Sqrt", "[", "optimumfluct", "]"}]}], "]"}], ",", "1"}], "]"}], ",", RowBox[{ "optimumstats", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], "}"}], "]"}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{"nextenvironmentaleffects", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ "environmental", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"Sqrt", "[", RowBox[{ "environmental", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "]"}]}], "]"}], ",", RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ "nextgenotypes", ",", "nextenvironmentaleffects", ",", "listofflowers", ",", "selectedflowers", ",", "nextoptimumstats"}], "}"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.7580496143655005`*^9, 3.7580496278191423`*^9}, { 3.758049658209957*^9, 3.7580496602657003`*^9}, {3.7580542291830683`*^9, 3.758054247956065*^9}, {3.7603850667165275`*^9, 3.7603850759029827`*^9}, { 3.7603854859640865`*^9, 3.7603855064503307`*^9}, {3.7603856718958063`*^9, 3.760385689261407*^9}, 3.760453959755743*^9, {3.760454278970047*^9, 3.760454287057308*^9}, {3.76045437975272*^9, 3.760454391816986*^9}, { 3.76045457095921*^9, 3.760454571118723*^9}, {3.76045466117727*^9, 3.760454696496689*^9}, 3.760454737903734*^9, {3.760454858655308*^9, 3.7604548641340933`*^9}, {3.760454916046589*^9, 3.7604549168055363`*^9}, { 3.7604550065500097`*^9, 3.760455015190852*^9}, {3.760455187093246*^9, 3.7604551872523127`*^9}, {3.7849123663182178`*^9, 3.7849123921630063`*^9}, {3.7849138352145367`*^9, 3.7849138380929165`*^9}, {3.7849138764610167`*^9, 3.7849138765770082`*^9}, {3.7849143323546977`*^9, 3.7849143388746877`*^9}, {3.785482413600634*^9, 3.785482439196425*^9}, { 3.794285216991726*^9, 3.7942852208622336`*^9}, {3.794285509401*^9, 3.794285536464622*^9}, {3.815197151401226*^9, 3.815197152245982*^9}},ExpressionUUID->"49a22f93-72fd-4d16-8468-\ e53baa2ab7b9"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Describe individual and population traits", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.6651338492463503`*^9, 3.665133857139964*^9}, {3.749205761446435*^9, 3.749205764084938*^9}, 3.7942167544281855`*^9, {3.794216860322242*^9, 3.7942168625213675`*^9}},ExpressionUUID->"9e7a2df9-58c0-48c3-8756-\ fa1a3035c945"], Cell[CellGroupData[{ Cell["statistics at the population level, mostly variances", "Subsubsection", CellChangeTimes->{{3.7942170042414737`*^9, 3.7942170364643164`*^9}},ExpressionUUID->"211cf2fe-a318-4064-abd0-\ 3702af4f9ff1"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Inputs", " ", ":", " ", RowBox[{"the", " ", "matrix", " ", "of", " ", "genotypes", " ", RowBox[{"(", RowBox[{"allelic", " ", "effects"}], ")"}], " ", "of", " ", "dimension", RowBox[{"(", RowBox[{"population_size", ",", " ", RowBox[{"2", "*", "loci_number"}]}], ")"}]}]}], " ", ";", " ", RowBox[{ "the", " ", "list", " ", "of", " ", "phenotypes", " ", "of", " ", "dimension", RowBox[{"(", "pop_size", ")"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ "Computes", " ", "the", " ", "genetic", " ", "and", " ", "genic", " ", "variances"}], ",", " ", RowBox[{ "counts", " ", "the", " ", "number", " ", "of", " ", "alleles", " ", "per", " ", "locus"}], ",", " ", RowBox[{ "computes", " ", "the", " ", "effective", " ", "number", " ", "of", " ", "loci"}], ",", " ", RowBox[{ "as", " ", "well", " ", "as", " ", "observed", " ", "and", " ", "expected", " ", "heterozygosity"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ "Returns", " ", "phenotypic", " ", "mean", " ", "and", " ", "variance"}], ",", " ", RowBox[{"genetic", " ", "variance"}], ",", " ", RowBox[{"genic", " ", "variance"}], ",", " ", RowBox[{ "the", " ", "number", " ", "of", " ", "alleles", " ", "per", " ", "locus"}], ",", " ", RowBox[{"the", " ", "effective", " ", "number", " ", "of", " ", "loci"}], ",", " ", RowBox[{ "the", " ", "observed", " ", "and", " ", "expected", " ", "homozygosity"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"popstats", "[", RowBox[{"genotypes_", ",", "phenotypes_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "size", ",", "nbloci", ",", "femalegametes", ",", "malegametes", ",", "geneticvalues", ",", "totalgeneticvariance", ",", "vargenic", ",", "nallelesbylocus", ",", "vectorstandarddeviation", ",", "matrixstandarddeviation", ",", "neloci", ",", "intersexlocicovariance", ",", "femalelocicovariance", ",", "malelocicovariance", ",", "ht", ",", "he"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"size", "=", RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nbloci", "=", RowBox[{ RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "/", "2"}]}], ";", "\[IndentingNewLine]", RowBox[{"femalegametes", "=", RowBox[{"genotypes", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;", "nbloci"}]}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"malegametes", "=", RowBox[{"genotypes", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{ RowBox[{"1", "+", "nbloci"}], ";;", RowBox[{"2", "*", "nbloci"}]}]}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"geneticvalues", "=", RowBox[{"Total", "[", RowBox[{"Transpose", "[", "genotypes", "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"totalgeneticvariance", "=", RowBox[{"Variance", "[", "geneticvalues", "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"vargenic", "=", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"Total", "[", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{"femalegametes", "-", RowBox[{"(", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "1", "}"}], ",", RowBox[{"{", "size", "}"}]}], "]"}], ".", RowBox[{"{", RowBox[{"Mean", "[", "femalegametes", "]"}], "}"}]}], ")"}]}], ")"}], " ", RowBox[{"(", RowBox[{"femalegametes", "-", RowBox[{"(", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "1", "}"}], ",", RowBox[{"{", "size", "}"}]}], "]"}], ".", RowBox[{"{", RowBox[{"Mean", "[", "femalegametes", "]"}], "}"}]}], ")"}]}], ")"}]}], "]"}], "]"}], "+", RowBox[{"Total", "[", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{"malegametes", "-", RowBox[{"(", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "1", "}"}], ",", RowBox[{"{", "size", "}"}]}], "]"}], ".", RowBox[{"{", RowBox[{"Mean", "[", "malegametes", "]"}], "}"}]}], ")"}]}], ")"}], " ", RowBox[{"(", RowBox[{"malegametes", "-", RowBox[{"(", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "1", "}"}], ",", RowBox[{"{", "size", "}"}]}], "]"}], ".", RowBox[{"{", RowBox[{"Mean", "[", "malegametes", "]"}], "}"}]}], ")"}]}], ")"}]}], "]"}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{"size", "-", "1"}], ")"}]}], ")"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", StyleBox[ RowBox[{"nallelesbylocus", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"Dimensions", "[", RowBox[{"Union", "[", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"{", RowBox[{"femalegametes", ",", "malegametes"}], "}"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;"}], ",", "i"}], "\[RightDoubleBracket]"}], "]"}], "]"}], "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "nbloci"}], "}"}]}], "]"}]}], FontColor->GrayLevel[0]], StyleBox[";", FontColor->GrayLevel[0]], StyleBox["\[IndentingNewLine]", FontColor->GrayLevel[0]], "\[IndentingNewLine]", RowBox[{"vectorstandarddeviation", "=", RowBox[{"StandardDeviation", "[", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"{", RowBox[{"femalegametes", ",", "malegametes"}], "}"}], "]"}], ",", "nbloci"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"matrixstandarddeviation", "=", RowBox[{ RowBox[{"Partition", "[", RowBox[{"vectorstandarddeviation", ",", "1"}], "]"}], ".", RowBox[{"Transpose", "[", RowBox[{"Partition", "[", RowBox[{"vectorstandarddeviation", ",", "1"}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"neloci", "=", RowBox[{ RowBox[{"Total", "[", RowBox[{"Total", "[", "matrixstandarddeviation", "]"}], "]"}], "/", RowBox[{"Total", "[", RowBox[{"Diagonal", "[", "matrixstandarddeviation", "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"ht", "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"nbloci", "*", "size"}], "-", RowBox[{"Count", "[", RowBox[{ RowBox[{ RowBox[{"Flatten", "[", RowBox[{"femalegametes", "-", "malegametes"}], "]"}], "//", "N"}], ",", "0."}], "]"}]}], ")"}], "/", RowBox[{"(", RowBox[{"nbloci", "*", "size"}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"he", "=", RowBox[{"Mean", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"1", "-", RowBox[{"Total", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Tally", "[", RowBox[{"Union", "[", RowBox[{"Flatten", "[", RowBox[{ RowBox[{"{", RowBox[{"femalegametes", ",", "malegametes"}], "}"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;"}], ",", "l"}], "\[RightDoubleBracket]"}], "]"}], "]"}], "]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "/", "2"}], "/", "size"}], ")"}], "^", "2"}], "]"}]}], ",", RowBox[{"{", RowBox[{"l", ",", "1", ",", "nbloci"}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Mean", "[", "phenotypes", "]"}], ",", RowBox[{"Variance", "[", "phenotypes", "]"}], ",", "totalgeneticvariance", ",", "vargenic", ",", "nallelesbylocus", ",", "neloci", ",", "ht", ",", "he"}], "}"}], "//", "N"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.6653155826114597`*^9, 3.66531561461329*^9}, 3.665315650395336*^9, {3.665397155550561*^9, 3.665397178748561*^9}, { 3.667742830194728*^9, 3.6677428330651283`*^9}, {3.669548809445526*^9, 3.6695489331985264`*^9}, {3.669548966108526*^9, 3.6695489725715265`*^9}, { 3.6695505092175264`*^9, 3.6695505352035265`*^9}, {3.6695505960805264`*^9, 3.6695506126545267`*^9}, 3.6695506690355263`*^9, {3.6695507377515264`*^9, 3.669550738695526*^9}, {3.6696095912845263`*^9, 3.6696096083715267`*^9}, { 3.6696119301755266`*^9, 3.6696119314225264`*^9}, {3.6696315677415266`*^9, 3.6696316828055267`*^9}, {3.6696319261675262`*^9, 3.669631950405526*^9}, 3.6697189400435266`*^9, {3.748171185398034*^9, 3.74817137598841*^9}, { 3.7489448500032005`*^9, 3.7489448956205015`*^9}, {3.7489449754471235`*^9, 3.748945087253804*^9}, {3.7489451689175467`*^9, 3.748945255122999*^9}, { 3.748945472035398*^9, 3.7489455778115735`*^9}, {3.7489456101144295`*^9, 3.748945632754267*^9}, {3.748945696833521*^9, 3.748945697489729*^9}, { 3.748945756608363*^9, 3.748945864928958*^9}, {3.7489459078746195`*^9, 3.7489459123367043`*^9}, {3.748945970065797*^9, 3.7489459814900637`*^9}, 3.7489461673747363`*^9, {3.748946758173329*^9, 3.748946794668209*^9}, { 3.7489468712945127`*^9, 3.7489469561919565`*^9}, {3.748947009083093*^9, 3.748947015737941*^9}, {3.7489472944458184`*^9, 3.7489472953725376`*^9}, { 3.74894735111718*^9, 3.748947351452154*^9}, {3.748947726123777*^9, 3.7489478044801936`*^9}, {3.7489478369453077`*^9, 3.7489479059245186`*^9}, {3.74920085523526*^9, 3.749200914240108*^9}, { 3.749200946483534*^9, 3.749201044273389*^9}, 3.7492020563322344`*^9, 3.749202115131946*^9, {3.7492985320919833`*^9, 3.7492985562836733`*^9}, 3.749298595403587*^9, 3.7494600119123106`*^9, {3.7498855871807685`*^9, 3.7498857052429085`*^9}, {3.749890532418069*^9, 3.7498906044810357`*^9}, { 3.749890715663443*^9, 3.7498907742251406`*^9}, {3.749892805165744*^9, 3.749892823759416*^9}, {3.7498942845115585`*^9, 3.749894291009502*^9}, { 3.749895257489876*^9, 3.7498952583228307`*^9}, 3.7498959648000717`*^9, { 3.7498988793681464`*^9, 3.749898883047912*^9}, 3.7498989162782407`*^9, { 3.7499006252657557`*^9, 3.7499006364497795`*^9}, {3.7536038559034133`*^9, 3.753603873678893*^9}, {3.753609321446944*^9, 3.7536093349520965`*^9}, { 3.753609519014134*^9, 3.7536095457192607`*^9}, {3.7536096926441298`*^9, 3.7536097027089696`*^9}, {3.7536154765151625`*^9, 3.753615502435819*^9}, 3.7536156166565685`*^9, {3.753616131994733*^9, 3.753616175819826*^9}, { 3.753616402382169*^9, 3.7536164188730392`*^9}, {3.7536165568402185`*^9, 3.7536165604731703`*^9}, {3.7536794442288585`*^9, 3.7536795317633276`*^9}, {3.7536796854244556`*^9, 3.7536796994077225`*^9}, {3.7536800062064743`*^9, 3.753680006605863*^9}, { 3.753680884870982*^9, 3.753680893269859*^9}, {3.753680931847962*^9, 3.7536809536857147`*^9}, {3.75368104159011*^9, 3.7536810723242407`*^9}, { 3.753681537919585*^9, 3.753681556447747*^9}, {3.753681607520229*^9, 3.753681662030764*^9}, {3.7536817485589104`*^9, 3.7536817494709616`*^9}, 3.7536819806930437`*^9, {3.75368205218407*^9, 3.7536820573190327`*^9}, { 3.7536821478986826`*^9, 3.7536821729221044`*^9}, {3.753682224443614*^9, 3.7536822500295577`*^9}, {3.7536822867184663`*^9, 3.753682312830797*^9}, { 3.753682826024746*^9, 3.753682887277215*^9}, {3.7536836449189806`*^9, 3.7536836562942286`*^9}, {3.753683814805106*^9, 3.7536838184517307`*^9}, { 3.7536839577324367`*^9, 3.7536839593282013`*^9}, {3.753683998946248*^9, 3.7536840018106155`*^9}, {3.753684081699078*^9, 3.75368408504198*^9}, { 3.753684142529854*^9, 3.753684156084072*^9}, {3.7536842170245543`*^9, 3.753684335568136*^9}, {3.7536844084309387`*^9, 3.7536844535518117`*^9}, 3.7536867174270673`*^9, {3.753710112173229*^9, 3.753710112491568*^9}, { 3.753784429607692*^9, 3.7537844303377995`*^9}, {3.753784469589788*^9, 3.753784511401991*^9}, {3.7537845870297775`*^9, 3.75378461067857*^9}, { 3.753784729162777*^9, 3.753784746569236*^9}, {3.7537849402662945`*^9, 3.7537849459112015`*^9}, {3.7537849965976763`*^9, 3.7537850530686893`*^9}, {3.7537851464230733`*^9, 3.753785160935271*^9}, { 3.753785503339533*^9, 3.7537855164555*^9}, 3.753786651250368*^9, { 3.754219691735039*^9, 3.7542197199599094`*^9}, {3.7542210437985067`*^9, 3.7542210813352633`*^9}, 3.7573367083648157`*^9, {3.757338471356853*^9, 3.757338484037957*^9}, {3.7576917154182224`*^9, 3.7576917462287836`*^9}, { 3.757793285550473*^9, 3.7577934180833197`*^9}, {3.762776593497406*^9, 3.762776605813877*^9}, {3.762776664022366*^9, 3.7627766944662914`*^9}, 3.7643125293059206`*^9, {3.784970275428687*^9, 3.78497028651604*^9}, 3.7849707943318653`*^9, {3.794123700568482*^9, 3.7941237791784124`*^9}, { 3.8196042786286497`*^9, 3.819604292468441*^9}, {3.81960432339721*^9, 3.8196043512848053`*^9}},ExpressionUUID->"d8e84239-0997-41ae-8730-\ 0947774ef220"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ statistics describing the shape of the distribution of flowers at the \ population level\ \>", "Subsubsection", CellChangeTimes->{{3.7942170042414737`*^9, 3.7942170364643164`*^9}, { 3.794217076992635*^9, 3.7942171062873106`*^9}, 3.8151973640624447`*^9},ExpressionUUID->"03409142-25a7-4727-9460-\ 0e060257de24"], Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Inputs", " ", ":", " ", RowBox[{ RowBox[{ "list", " ", "of", " ", "flowers", " ", "at", " ", "the", " ", "poulation", " ", "level", " ", "of", " ", "dimension", RowBox[{"(", RowBox[{"population_size", ",", " ", "2"}], ")"}]}], " ", ":", " ", RowBox[{ "for", " ", "each", " ", "flower", " ", "the", " ", "flowering", " ", "day", " ", "and", " ", "individual", " ", "identification", " ", "number"}]}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ "Identifies", " ", "days", " ", "with", " ", "open", " ", "flowers"}], ",", " ", RowBox[{ "counts", " ", "the", " ", "number", " ", "of", " ", "flowers", " ", "on", " ", "those", " ", "days"}], ",", " ", RowBox[{ "computes", " ", "moments", " ", "1", " ", "to", " ", "4", " ", "of", " ", "the", " ", "population", " ", "phenology"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ "Retuns", " ", "days", " ", "with", " ", "opened", " ", "flowers"}], ",", " ", RowBox[{ "the", " ", "number", " ", "of", " ", "flowers", " ", "on", " ", "those", " ", "days"}], ",", " ", RowBox[{ "moments", " ", "1", " ", "to", " ", "4", " ", "of", " ", "the", " ", "population", " ", "phenology"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"popmoments", "[", "flowerlist_", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "days", ",", "nbflowersperday", ",", "pm1", ",", "pm2", ",", "pm3", ",", "pm4"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"days", "=", RowBox[{"Union", "[", RowBox[{"Flatten", "[", RowBox[{"flowerlist", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"nbflowersperday", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"flowerlist", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}], "]"}], ",", RowBox[{ "days", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", RowBox[{ RowBox[{"Dimensions", "[", "days", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "}"}]}], "]"}]}], ";", "\n", "\[IndentingNewLine]", RowBox[{"pm1", "=", RowBox[{"days", " ", "nbflowersperday"}]}], ";", "\[IndentingNewLine]", RowBox[{"pm2", "=", RowBox[{"days", " ", "pm1"}]}], ";", "\[IndentingNewLine]", RowBox[{"pm3", "=", RowBox[{"days", " ", "pm2"}]}], ";", "\[IndentingNewLine]", RowBox[{"pm4", "=", RowBox[{"days", " ", "pm3"}]}], ";", "\n", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{"days", ",", "nbflowersperday", ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Total", "[", "pm1", "]"}], ",", RowBox[{"Total", "[", "pm2", "]"}], ",", RowBox[{"Total", "[", "pm3", "]"}], ",", RowBox[{"Total", "[", "pm4", "]"}]}], "}"}], "/", RowBox[{"Total", "[", "nbflowersperday", "]"}]}]}], "}"}], "//", "N"}]}]}], "\[IndentingNewLine]", "]"}]}], ";"}]}]], "Input", CellChangeTimes->{{3.7494507297302284`*^9, 3.74945077241763*^9}, 3.7494600166151342`*^9, {3.7495470826432858`*^9, 3.7495470865662875`*^9}, { 3.7498915904009466`*^9, 3.749891624497959*^9}, 3.7498922983819904`*^9, { 3.7498928568936996`*^9, 3.7498928699813623`*^9}, {3.749895263120375*^9, 3.7498952638556795`*^9}, {3.753609734275524*^9, 3.753609741188301*^9}, { 3.7536097829153366`*^9, 3.7536098899736257`*^9}, {3.753609922327407*^9, 3.7536099227922688`*^9}, {3.75361476858353*^9, 3.7536147729362364`*^9}, { 3.75368449790283*^9, 3.75368449841354*^9}, {3.7537857294938364`*^9, 3.753785750218456*^9}, 3.75378665556771*^9, {3.8196043780353355`*^9, 3.8196044243549843`*^9}},ExpressionUUID->"f3c00624-9f7d-4ba1-b922-\ 73ea0be0e81f"] }, Closed]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Initialize parameters", "Section", CellChangeTimes->{{3.665134097998788*^9, 3.6651341014931936`*^9}, { 3.665325653970561*^9, 3.6653256608495607`*^9}, {3.665325937537561*^9, 3.6653259396175613`*^9}, {3.665481086818561*^9, 3.6654811121905613`*^9}, { 3.665481193577561*^9, 3.665481193978561*^9}, {3.6665859040461416`*^9, 3.666585906109142*^9}, {3.6665910416241417`*^9, 3.6665910417681417`*^9}, { 3.6666033433221416`*^9, 3.666603346410142*^9}, {3.667743851632128*^9, 3.667743852271728*^9}, {3.669606600990526*^9, 3.669606608141526*^9}, { 3.6697221724015265`*^9, 3.6697221731535263`*^9}, {3.6697230748305264`*^9, 3.6697230841575265`*^9}, {3.6707589666307335`*^9, 3.6707589672703333`*^9}, {3.670758999312733*^9, 3.670758999546733*^9}, 3.670759171536733*^9, {3.6707599610527334`*^9, 3.670759977760333*^9}, { 3.670760055385933*^9, 3.670760056384333*^9}, 3.6709295282759333`*^9, 3.6709296452915335`*^9, {3.6710232837077656`*^9, 3.671023315110562*^9}, { 3.6710280409527717`*^9, 3.671028042918375*^9}, {3.6710744544218197`*^9, 3.6710744580930295`*^9}, {3.671295951946676*^9, 3.6712959586234875`*^9}, { 3.7492941302332478`*^9, 3.749294131365312*^9}, {3.7492994954552345`*^9, 3.7492994982795615`*^9}, {3.7493001087227335`*^9, 3.7493001101952953`*^9}, {3.749300236466891*^9, 3.7493002395080233`*^9}, { 3.7493006069823446`*^9, 3.7493006171077332`*^9}, {3.7494687690912056`*^9, 3.749468798451666*^9}, {3.7494689408016453`*^9, 3.7494689474889207`*^9}, { 3.753786664320077*^9, 3.753786676209991*^9}, {3.7542226190275326`*^9, 3.7542226505305405`*^9}, {3.754223347832672*^9, 3.7542233752850156`*^9}, { 3.754223448976694*^9, 3.7542234511471405`*^9}, {3.75804699006446*^9, 3.758047010766096*^9}, {3.758047241604327*^9, 3.7580472418611727`*^9}, { 3.758054532353079*^9, 3.7580545330493946`*^9}, {3.7601087408995423`*^9, 3.760108752376873*^9}, {3.7601485134186335`*^9, 3.7601485166902437`*^9}, { 3.7601485573080144`*^9, 3.760148583518982*^9}, {3.7601486598578506`*^9, 3.7601486605151024`*^9}, {3.7601974744378853`*^9, 3.760197476569803*^9}, { 3.760391738798439*^9, 3.7603917427001963`*^9}, {3.76045605100177*^9, 3.760456068337573*^9}, {3.760471437006361*^9, 3.760471471750039*^9}, { 3.760481801153389*^9, 3.7604818024605746`*^9}, 3.760481839467579*^9, { 3.7604818704769955`*^9, 3.76048187149382*^9}, 3.7604819101545353`*^9, { 3.7604819409567423`*^9, 3.760481941224*^9}, {3.7604819737822995`*^9, 3.760481974006692*^9}, {3.7644746191757326`*^9, 3.76447461965545*^9}, { 3.7644749823422523`*^9, 3.7644749825516925`*^9}, 3.764477040877225*^9, { 3.78505003959067*^9, 3.785050042133733*^9}, {3.7942164867978773`*^9, 3.7942164945963235`*^9}},ExpressionUUID->"0d40be68-f6ab-405d-b932-\ b1d086c64fa9"], Cell[CellGroupData[{ Cell[TextData[StyleBox["Parameters common to all cases", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.6651338492463503`*^9, 3.665133857139964*^9}, {3.749205761446435*^9, 3.749205764084938*^9}, 3.7942167544281855`*^9, {3.794216860322242*^9, 3.7942169000655155`*^9}},ExpressionUUID->"9e7a2df9-58c0-48c3-8756-\ fa1a3035c945"], Cell[CellGroupData[{ Cell["constant population size and history", "Subsubsection", CellChangeTimes->{{3.7942179260021954`*^9, 3.7942179692816706`*^9}},ExpressionUUID->"ac5e5e45-456b-4d2a-9392-\ d2eebc852e3c"], Cell[BoxData[{ RowBox[{ RowBox[{"popsize", "=", "1000"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"nbsimulations", "=", "10"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"stop", "=", RowBox[{"{", RowBox[{"2001", ",", "10001"}], "}"}]}], ";"}], " ", RowBox[{"(*", RowBox[{"nbgeneration", "+", RowBox[{ "1", " ", "to", " ", "record", " ", "nbgeneration", " ", "values", " ", "for", " ", "each", " ", "parameters"}]}], "*)"}]}]}], "Input", CellChangeTimes->{{3.6648715896219373`*^9, 3.6648716700009375`*^9}, { 3.664871712829937*^9, 3.6648717129899373`*^9}, {3.664871743115937*^9, 3.664871825510937*^9}, 3.664871883123937*^9, {3.6648719384019375`*^9, 3.664871958815937*^9}, {3.664871997517937*^9, 3.6648720308289375`*^9}, { 3.664872087112937*^9, 3.664872102999937*^9}, {3.664872169748937*^9, 3.664872173107937*^9}, {3.664876779839937*^9, 3.664876819946937*^9}, { 3.664877050237937*^9, 3.6648770993709373`*^9}, {3.664877180230937*^9, 3.664877182788937*^9}, {3.6648772927839375`*^9, 3.6648773082399373`*^9}, { 3.6648773733569374`*^9, 3.664877386074937*^9}, {3.664877461286937*^9, 3.6648774679899373`*^9}, {3.6648775039889374`*^9, 3.664877517091937*^9}, { 3.664877593678937*^9, 3.6648776040149374`*^9}, {3.664877650635937*^9, 3.664877651402937*^9}, {3.664877681498937*^9, 3.6648777015129375`*^9}, { 3.6648778508329372`*^9, 3.664877866591937*^9}, 3.6648779008619375`*^9, { 3.664877935819937*^9, 3.664877936171937*^9}, {3.664878006359937*^9, 3.6648780075269375`*^9}, {3.664878069523937*^9, 3.664878070451937*^9}, { 3.664878121376937*^9, 3.664878121839937*^9}, {3.6648781754379373`*^9, 3.664878179116937*^9}, {3.664878393537937*^9, 3.664878422975937*^9}, 3.6648787653719373`*^9, {3.6648788376869373`*^9, 3.664878840998937*^9}, { 3.6648790134379373`*^9, 3.6648790137579374`*^9}, {3.6648795830219374`*^9, 3.6648795868129373`*^9}, {3.664879630442937*^9, 3.664879641977937*^9}, { 3.6648796810629373`*^9, 3.664879788899937*^9}, 3.6648799688569374`*^9, { 3.664880010407937*^9, 3.664880016806937*^9}, {3.6648807270409374`*^9, 3.664880741629937*^9}, {3.664881075786937*^9, 3.664881076859937*^9}, { 3.6648812232039375`*^9, 3.6648812263379374`*^9}, 3.6648813756279373`*^9, { 3.664884048975937*^9, 3.664884050159937*^9}, {3.664884081678937*^9, 3.664884082286937*^9}, {3.664884573954937*^9, 3.6648845803689375`*^9}, { 3.664884829893937*^9, 3.664884830787937*^9}, {3.6648871699369373`*^9, 3.6648871834369373`*^9}, {3.6648882929899373`*^9, 3.664888294492937*^9}, { 3.6648883527139373`*^9, 3.664888385751937*^9}, {3.6648884938899374`*^9, 3.664888506001937*^9}, {3.664889366511937*^9, 3.664889369390937*^9}, 3.6648895378789372`*^9, {3.664889709435937*^9, 3.6648897443309374`*^9}, { 3.664890330617937*^9, 3.664890332392937*^9}, {3.665133978450777*^9, 3.665133993208403*^9}, {3.665315445635625*^9, 3.665315448786805*^9}, { 3.6653157354882035`*^9, 3.665315738992404*^9}, {3.665315780849798*^9, 3.6653157827659073`*^9}, {3.665323192747734*^9, 3.665323207519579*^9}, { 3.665323308633363*^9, 3.6653233281274776`*^9}, {3.665325291239561*^9, 3.665325291590561*^9}, {3.665325349299561*^9, 3.6653253703225613`*^9}, { 3.665325965792561*^9, 3.665325965984561*^9}, 3.6653268807645607`*^9, 3.665385144122561*^9, {3.665386399027561*^9, 3.665386403570561*^9}, 3.6653864412645607`*^9, 3.665399697755561*^9, {3.6654070097385607`*^9, 3.665407011577561*^9}, {3.665480946545561*^9, 3.665480950824561*^9}, { 3.665480992005561*^9, 3.6654810500985613`*^9}, {3.665481197402561*^9, 3.665481197562561*^9}, {3.66589680184194*^9, 3.66589685197474*^9}, { 3.66598509252314*^9, 3.66598512551194*^9}, {3.6659851667839403`*^9, 3.66598519412674*^9}, {3.6659879330325403`*^9, 3.6659879551135397`*^9}, { 3.6659879910503397`*^9, 3.6659879957167397`*^9}, 3.66598803512074*^9, 3.6659885764363403`*^9, 3.66598979376014*^9, {3.6659898251315403`*^9, 3.66598982564734*^9}, {3.66599001328454*^9, 3.6659900541851397`*^9}, { 3.6659901698253403`*^9, 3.66599017634814*^9}, {3.66599344464494*^9, 3.6659934480613403`*^9}, {3.66599665578874*^9, 3.6659966624197397`*^9}, { 3.66599879944554*^9, 3.66599882015574*^9}, {3.66606632431854*^9, 3.6660663402687397`*^9}, 3.6665859769861417`*^9, {3.666591046952142*^9, 3.6665910860861416`*^9}, {3.666593791212142*^9, 3.666593802267142*^9}, { 3.666596281278142*^9, 3.666596287165142*^9}, {3.6666033066371417`*^9, 3.6666033297551417`*^9}, 3.666603388919142*^9, 3.6666034661311417`*^9, { 3.666619050528936*^9, 3.666619084972136*^9}, 3.666619242280136*^9, { 3.66670178366774*^9, 3.66670182831234*^9}, {3.66670214680534*^9, 3.6667021477101398`*^9}, {3.6667022502497396`*^9, 3.66670225583554*^9}, 3.66670243707954*^9, {3.66670287930814*^9, 3.6667028813049397`*^9}, { 3.66670305280074*^9, 3.66670309847034*^9}, {3.666952950395542*^9, 3.6669529706505423`*^9}, {3.6669533102475424`*^9, 3.6669533108065424`*^9}, {3.6669546917205424`*^9, 3.6669546953675423`*^9}, {3.6669553620185423`*^9, 3.6669553630095425`*^9}, {3.667732642023328*^9, 3.667732645816128*^9}, 3.667732784491728*^9, {3.6677428965117283`*^9, 3.6677429076999283`*^9}, { 3.667743511150128*^9, 3.667743511713728*^9}, {3.6677438475595284`*^9, 3.667743850696128*^9}, {3.667743892061728*^9, 3.667743893075728*^9}, { 3.667743935582128*^9, 3.667743942452128*^9}, {3.667795676513328*^9, 3.6677956775117283`*^9}, {3.667915565177328*^9, 3.667915565972928*^9}, { 3.667917592883128*^9, 3.6679175934291277`*^9}, {3.668428988497557*^9, 3.668429012319557*^9}, 3.668429052045557*^9, {3.6684290876275573`*^9, 3.668429088731557*^9}, {3.6695349591475267`*^9, 3.6695349605715265`*^9}, { 3.6695349939305267`*^9, 3.6695350277675266`*^9}, 3.6695370781465263`*^9, { 3.6695510068715267`*^9, 3.669551007622526*^9}, {3.6695510515725265`*^9, 3.6695510539395266`*^9}, {3.6696146253805265`*^9, 3.6696146264035263`*^9}, {3.6696146645295267`*^9, 3.6696146709445267`*^9}, {3.6696150918815265`*^9, 3.6696150926645265`*^9}, {3.6696317963355265`*^9, 3.6696318295325265`*^9}, {3.6696321980715265`*^9, 3.6696321997035265`*^9}, {3.6696325801775265`*^9, 3.6696325895695267`*^9}, {3.6696356840645266`*^9, 3.669635693360526*^9}, { 3.6696365964285264`*^9, 3.669636604700526*^9}, {3.669638665846526*^9, 3.6696386738455267`*^9}, 3.6697102027505264`*^9, {3.6697163605425262`*^9, 3.6697163608625264`*^9}, {3.669716393516526*^9, 3.6697164109075265`*^9}, { 3.6697187035275264`*^9, 3.669718722582526*^9}, {3.6697205917085266`*^9, 3.6697206106995263`*^9}, {3.669720641306526*^9, 3.6697206543125267`*^9}, { 3.6697208326545267`*^9, 3.6697208423815265`*^9}, {3.6697214296125264`*^9, 3.6697214300285263`*^9}, {3.6697218029515266`*^9, 3.6697218595075264`*^9}, {3.6697219332635264`*^9, 3.669721936575526*^9}, { 3.6697221612985263`*^9, 3.6697221643385267`*^9}, {3.6697227056195264`*^9, 3.6697227059395266`*^9}, {3.6697227575525265`*^9, 3.6697227599685264`*^9}, {3.6697228277565265`*^9, 3.669722842747526*^9}, { 3.6697228748895264`*^9, 3.6697228796095266`*^9}, {3.6697229889475265`*^9, 3.6697229912835264`*^9}, 3.6697231936235266`*^9, {3.6697242665695267`*^9, 3.6697242822175264`*^9}, {3.669726195419526*^9, 3.6697262028115263`*^9}, { 3.670758937973533*^9, 3.6707589515143332`*^9}, {3.6707591860603333`*^9, 3.670759187214733*^9}, {3.670759971489133*^9, 3.6707599815979333`*^9}, { 3.6707600588491335`*^9, 3.670760059036333*^9}, 3.670760336685133*^9, 3.6709294809923334`*^9, 3.6709343832879333`*^9, 3.671023159987689*^9, { 3.671023458655772*^9, 3.6710234940287952`*^9}, {3.6710237339775195`*^9, 3.6710237353886003`*^9}, {3.6710237830743275`*^9, 3.6710238189583807`*^9}, {3.671024008366214*^9, 3.6710240172517223`*^9}, { 3.671074487083688*^9, 3.671074492799014*^9}, {3.67129598275673*^9, 3.671296027873009*^9}, {3.6712960778198977`*^9, 3.671296078209898*^9}, { 3.671517861531059*^9, 3.671517862981861*^9}, {3.671537982601802*^9, 3.6715379967822266`*^9}, {3.677406515777542*^9, 3.6774065438235426`*^9}, { 3.6774065944125423`*^9, 3.6774066379465427`*^9}, {3.6774084352685423`*^9, 3.6774084414115424`*^9}, {3.748594752877228*^9, 3.7485947532444296`*^9}, 3.7485948377421293`*^9, {3.7485949762067165`*^9, 3.748594979660951*^9}, { 3.748595515247923*^9, 3.7485955154549627`*^9}, {3.7485977298164864`*^9, 3.748597731832959*^9}, {3.748764806618795*^9, 3.7487648085854654`*^9}, { 3.748768709780711*^9, 3.748768775264629*^9}, 3.7487694957123847`*^9, { 3.748769918510087*^9, 3.7487699243808827`*^9}, {3.7487700513262625`*^9, 3.748770063675123*^9}, {3.748770263789324*^9, 3.748770268765568*^9}, 3.7487703793893294`*^9, 3.7489383006075697`*^9, {3.7489422722790775`*^9, 3.748942274358259*^9}, {3.7489423785660152`*^9, 3.7489424555413947`*^9}, { 3.748942586564638*^9, 3.7489425983077865`*^9}, {3.748942637157911*^9, 3.748942726581896*^9}, {3.748943987808711*^9, 3.748944039901924*^9}, { 3.7489441403180666`*^9, 3.7489441579034157`*^9}, {3.748946396750352*^9, 3.74894639687731*^9}, {3.749296582891738*^9, 3.749296583226678*^9}, { 3.7492989815772333`*^9, 3.7492989824884014`*^9}, {3.7492990688403177`*^9, 3.7492990699428988`*^9}, {3.749299511926371*^9, 3.749299614390433*^9}, { 3.7492996549332232`*^9, 3.7492996722927*^9}, {3.7493000297795115`*^9, 3.7493000312676973`*^9}, {3.7493002451889057`*^9, 3.7493002797019496`*^9}, {3.7493006428460264`*^9, 3.749300661942463*^9}, { 3.749361134988944*^9, 3.7493611363023367`*^9}, 3.749368230044001*^9, { 3.7493727543752885`*^9, 3.7493727633033657`*^9}, 3.7493752574054527`*^9, 3.749378058091799*^9, {3.7493800735679274`*^9, 3.749380075087517*^9}, 3.7493802875413017`*^9, {3.7493803564064264`*^9, 3.749380357046034*^9}, 3.749380431239832*^9, {3.749440871703183*^9, 3.7494408979896636`*^9}, { 3.7494414082745357`*^9, 3.7494414084356747`*^9}, 3.7494418131279073`*^9, { 3.7494419346169147`*^9, 3.749441935271237*^9}, {3.749442252294484*^9, 3.749442255110916*^9}, {3.7494675866325293`*^9, 3.7494675869674687`*^9}, 3.749467626934312*^9, {3.749468627860849*^9, 3.749468628180197*^9}, { 3.7494692252807727`*^9, 3.7494692271050615`*^9}, {3.749469346625128*^9, 3.749469347631899*^9}, {3.749547401271004*^9, 3.7495474053180346`*^9}, 3.74954781021434*^9, {3.749551077300151*^9, 3.7495510798869*^9}, 3.749791427385586*^9, 3.7497967387289343`*^9, {3.7498189288274536`*^9, 3.7498189294192734`*^9}, 3.7498973530613976`*^9, 3.74990794306636*^9, { 3.749907974248556*^9, 3.7499079822011724`*^9}, {3.7499080396888638`*^9, 3.749908040072667*^9}, {3.7499081334333267`*^9, 3.7499081338317795`*^9}, { 3.749909495015021*^9, 3.7499094965043354`*^9}, {3.7499790464134765`*^9, 3.749979049477071*^9}, {3.749982833100074*^9, 3.7499828333393407`*^9}, { 3.7499828751635275`*^9, 3.749982879868786*^9}, 3.749983817705352*^9, { 3.7499853445026526`*^9, 3.749985345414797*^9}, {3.7535276297998667`*^9, 3.7535276388705273`*^9}, 3.7535280758774443`*^9, {3.7536038103183403`*^9, 3.753603814447405*^9}, {3.75368464914781*^9, 3.75368466935645*^9}, 3.753684965464896*^9, {3.7536850961678476`*^9, 3.753685101927447*^9}, { 3.7537929268396006`*^9, 3.753792926983173*^9}, 3.7537935415823994`*^9, 3.753793626520288*^9, {3.754222426068798*^9, 3.754222427797409*^9}, { 3.7542225122974477`*^9, 3.7542225190721054`*^9}, 3.7542234821334295`*^9, { 3.7542255403803596`*^9, 3.7542255466268435`*^9}, {3.7542259312335033`*^9, 3.7542259327773857`*^9}, {3.7577934878368726`*^9, 3.7577934920166397`*^9}, {3.7577936787705307`*^9, 3.757793681266836*^9}, { 3.7580471209008207`*^9, 3.7580471455866537`*^9}, {3.7580472225915036`*^9, 3.7580472337841463`*^9}, 3.7580472938608694`*^9, {3.7580488293881903`*^9, 3.758048831590423*^9}, {3.758049801709608*^9, 3.758049804510497*^9}, { 3.7580502839894543`*^9, 3.758050323803483*^9}, {3.7580505584922905`*^9, 3.758050564986992*^9}, 3.758050612688388*^9, {3.7580517971523905`*^9, 3.758051801548682*^9}, {3.7580543735606112`*^9, 3.7580543746083956`*^9}, { 3.7580544623927317`*^9, 3.7580544662327228`*^9}, {3.758054513989504*^9, 3.758054514686725*^9}, {3.7580547341641593`*^9, 3.758054736893756*^9}, { 3.760384813102412*^9, 3.7603848135920687`*^9}, {3.760384862184715*^9, 3.760384862731246*^9}, {3.7603849613793244`*^9, 3.7603849619169245`*^9}, { 3.760385130055154*^9, 3.7603851322632155`*^9}, {3.760385206899543*^9, 3.7603852099354386`*^9}, {3.760386234906005*^9, 3.760386235727845*^9}, { 3.760387959242777*^9, 3.7603879612264595`*^9}, {3.760391435731744*^9, 3.76039143738583*^9}, 3.7603925365342903`*^9, {3.76044974491711*^9, 3.7604497553959618`*^9}, {3.760453577749151*^9, 3.760453579292432*^9}, { 3.760453610164253*^9, 3.7604536483798857`*^9}, {3.760454098049994*^9, 3.760454099873564*^9}, {3.7604541892905407`*^9, 3.7604541919375772`*^9}, 3.760454888197476*^9, 3.7604551102930937`*^9, 3.7604556535399933`*^9, 3.760456041458219*^9, {3.7604561888087597`*^9, 3.760456204623962*^9}, { 3.7604715448736954`*^9, 3.760471546236084*^9}, {3.760472545421132*^9, 3.760472545977127*^9}, {3.760472646217716*^9, 3.7604726474628735`*^9}, 3.76047742397609*^9, {3.7604775336118665`*^9, 3.7604775343029785`*^9}, { 3.760477598374628*^9, 3.760477602381877*^9}, 3.764301641685611*^9, { 3.764474651420169*^9, 3.764474689839425*^9}, 3.7645936316193943`*^9, 3.768712840484685*^9, 3.7849125576087265`*^9, {3.7849138983590136`*^9, 3.7849139003828354`*^9}, {3.784915457395995*^9, 3.784915459039815*^9}, { 3.785042735967092*^9, 3.785042806648767*^9}, {3.785042897627165*^9, 3.7850428985693207`*^9}, {3.7850429289977093`*^9, 3.7850429885741568`*^9}, {3.7850435404583473`*^9, 3.785043557900482*^9}, { 3.78504363260196*^9, 3.7850436329845867`*^9}, {3.7850441983864813`*^9, 3.785044199560014*^9}, {3.7850443287058487`*^9, 3.785044331855242*^9}, { 3.7850446857740192`*^9, 3.78504468780606*^9}, {3.785044759262548*^9, 3.785044763066691*^9}, {3.785044889423337*^9, 3.7850448956588917`*^9}, { 3.785045058563389*^9, 3.7850450624133177`*^9}, {3.78504515547069*^9, 3.7850451619488163`*^9}, {3.785045911357325*^9, 3.7850459559291983`*^9}, { 3.7850460606052237`*^9, 3.785046066089663*^9}, {3.785053302535205*^9, 3.785053304856895*^9}, 3.785475568404909*^9, 3.785475813039476*^9, { 3.785476374351667*^9, 3.785476396007793*^9}, {3.785476503507984*^9, 3.785476507203307*^9}, {3.785476574692485*^9, 3.7854766107072487`*^9}, 3.7854767311878557`*^9, {3.7854857226075363`*^9, 3.785485754828389*^9}, { 3.785485895088513*^9, 3.785485922780839*^9}, 3.7854859647216177`*^9, { 3.785491333342083*^9, 3.785491336089031*^9}, 3.785566795165312*^9, { 3.7855671552938137`*^9, 3.785567158010968*^9}, 3.785567193663268*^9, { 3.7941145588733263`*^9, 3.794114570198476*^9}, {3.7941153689808035`*^9, 3.7941154082780557`*^9}, {3.79411643358989*^9, 3.7941164363362513`*^9}, { 3.7941191618188725`*^9, 3.7941191625539465`*^9}, {3.794120722426812*^9, 3.794120723196542*^9}, {3.7941213148543215`*^9, 3.7941213354951334`*^9}, { 3.7942179029468765`*^9, 3.7942179068911023`*^9}, {3.815197382928948*^9, 3.8151973851440473`*^9}, {3.81519773013524*^9, 3.815197742670725*^9}, { 3.815197775085017*^9, 3.81519780125262*^9}, {3.8196042282607684`*^9, 3.819604228707794*^9}},ExpressionUUID->"cb7e7ff3-8324-4856-bdcf-\ 74272f9f57f1"] }, Closed]], Cell[CellGroupData[{ Cell["micro-environmental and mutational effects", "Subsubsection", CellChangeTimes->{{3.7942179260021954`*^9, 3.7942179344336777`*^9}, { 3.7942179936100626`*^9, 3.794217996434224*^9}},ExpressionUUID->"af5fab54-9e1a-4d2c-8d85-\ df23627f56b1"], Cell[BoxData[{ RowBox[{ RowBox[{"environmentalparameters", "=", RowBox[{"{", RowBox[{"0", ",", "4"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"locinb", "=", RowBox[{"{", RowBox[{"5", ",", "50"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"mutationmodel", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0.1", ",", "0.04"}], "}"}], ",", RowBox[{"{", RowBox[{"0.01", ",", "0.004"}], "}"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"initialgenicvariance", "=", RowBox[{"{", RowBox[{"0", ",", RowBox[{"10", "^", RowBox[{"-", "20"}]}]}], "}"}]}], ";"}]}], "Input", CellChangeTimes->{{3.6648715896219373`*^9, 3.6648716700009375`*^9}, { 3.664871712829937*^9, 3.6648717129899373`*^9}, {3.664871743115937*^9, 3.664871825510937*^9}, 3.664871883123937*^9, {3.6648719384019375`*^9, 3.664871958815937*^9}, {3.664871997517937*^9, 3.6648720308289375`*^9}, { 3.664872087112937*^9, 3.664872102999937*^9}, {3.664872169748937*^9, 3.664872173107937*^9}, {3.664876779839937*^9, 3.664876819946937*^9}, { 3.664877050237937*^9, 3.6648770993709373`*^9}, {3.664877180230937*^9, 3.664877182788937*^9}, {3.6648772927839375`*^9, 3.6648773082399373`*^9}, { 3.6648773733569374`*^9, 3.664877386074937*^9}, {3.664877461286937*^9, 3.6648774679899373`*^9}, {3.6648775039889374`*^9, 3.664877517091937*^9}, { 3.664877593678937*^9, 3.6648776040149374`*^9}, {3.664877650635937*^9, 3.664877651402937*^9}, {3.664877681498937*^9, 3.6648777015129375`*^9}, { 3.6648778508329372`*^9, 3.664877866591937*^9}, 3.6648779008619375`*^9, { 3.664877935819937*^9, 3.664877936171937*^9}, {3.664878006359937*^9, 3.6648780075269375`*^9}, {3.664878069523937*^9, 3.664878070451937*^9}, { 3.664878121376937*^9, 3.664878121839937*^9}, {3.6648781754379373`*^9, 3.664878179116937*^9}, {3.664878393537937*^9, 3.664878422975937*^9}, 3.6648787653719373`*^9, {3.6648788376869373`*^9, 3.664878840998937*^9}, { 3.6648790134379373`*^9, 3.6648790137579374`*^9}, {3.6648795830219374`*^9, 3.6648795868129373`*^9}, {3.664879630442937*^9, 3.664879641977937*^9}, { 3.6648796810629373`*^9, 3.664879788899937*^9}, 3.6648799688569374`*^9, { 3.664880010407937*^9, 3.664880016806937*^9}, {3.6648807270409374`*^9, 3.664880741629937*^9}, {3.664881075786937*^9, 3.664881076859937*^9}, { 3.6648812232039375`*^9, 3.6648812263379374`*^9}, 3.6648813756279373`*^9, { 3.664884048975937*^9, 3.664884050159937*^9}, {3.664884081678937*^9, 3.664884082286937*^9}, {3.664884573954937*^9, 3.6648845803689375`*^9}, { 3.664884829893937*^9, 3.664884830787937*^9}, {3.6648871699369373`*^9, 3.6648871834369373`*^9}, {3.6648882929899373`*^9, 3.664888294492937*^9}, { 3.6648883527139373`*^9, 3.664888385751937*^9}, {3.6648884938899374`*^9, 3.664888506001937*^9}, {3.664889366511937*^9, 3.664889369390937*^9}, 3.6648895378789372`*^9, {3.664889709435937*^9, 3.6648897443309374`*^9}, { 3.664890330617937*^9, 3.664890332392937*^9}, {3.665133978450777*^9, 3.665133993208403*^9}, {3.665315445635625*^9, 3.665315448786805*^9}, { 3.6653157354882035`*^9, 3.665315738992404*^9}, {3.665315780849798*^9, 3.6653157827659073`*^9}, {3.665323192747734*^9, 3.665323207519579*^9}, { 3.665323308633363*^9, 3.6653233281274776`*^9}, {3.665325291239561*^9, 3.665325291590561*^9}, {3.665325349299561*^9, 3.6653253703225613`*^9}, { 3.665325965792561*^9, 3.665325965984561*^9}, 3.6653268807645607`*^9, 3.665385144122561*^9, {3.665386399027561*^9, 3.665386403570561*^9}, 3.6653864412645607`*^9, 3.665399697755561*^9, {3.6654070097385607`*^9, 3.665407011577561*^9}, {3.665480946545561*^9, 3.665480950824561*^9}, { 3.665480992005561*^9, 3.6654810500985613`*^9}, {3.665481197402561*^9, 3.665481197562561*^9}, {3.66589680184194*^9, 3.66589685197474*^9}, { 3.66598509252314*^9, 3.66598512551194*^9}, {3.6659851667839403`*^9, 3.66598519412674*^9}, {3.6659879330325403`*^9, 3.6659879551135397`*^9}, { 3.6659879910503397`*^9, 3.6659879957167397`*^9}, 3.66598803512074*^9, 3.6659885764363403`*^9, 3.66598979376014*^9, {3.6659898251315403`*^9, 3.66598982564734*^9}, {3.66599001328454*^9, 3.6659900541851397`*^9}, { 3.6659901698253403`*^9, 3.66599017634814*^9}, {3.66599344464494*^9, 3.6659934480613403`*^9}, {3.66599665578874*^9, 3.6659966624197397`*^9}, { 3.66599879944554*^9, 3.66599882015574*^9}, {3.66606632431854*^9, 3.6660663402687397`*^9}, 3.6665859769861417`*^9, {3.666591046952142*^9, 3.6665910860861416`*^9}, {3.666593791212142*^9, 3.666593802267142*^9}, { 3.666596281278142*^9, 3.666596287165142*^9}, {3.6666033066371417`*^9, 3.6666033297551417`*^9}, 3.666603388919142*^9, 3.6666034661311417`*^9, { 3.666619050528936*^9, 3.666619084972136*^9}, 3.666619242280136*^9, { 3.66670178366774*^9, 3.66670182831234*^9}, {3.66670214680534*^9, 3.6667021477101398`*^9}, {3.6667022502497396`*^9, 3.66670225583554*^9}, 3.66670243707954*^9, {3.66670287930814*^9, 3.6667028813049397`*^9}, { 3.66670305280074*^9, 3.66670309847034*^9}, {3.666952950395542*^9, 3.6669529706505423`*^9}, {3.6669533102475424`*^9, 3.6669533108065424`*^9}, {3.6669546917205424`*^9, 3.6669546953675423`*^9}, {3.6669553620185423`*^9, 3.6669553630095425`*^9}, {3.667732642023328*^9, 3.667732645816128*^9}, 3.667732784491728*^9, {3.6677428965117283`*^9, 3.6677429076999283`*^9}, { 3.667743511150128*^9, 3.667743511713728*^9}, {3.6677438475595284`*^9, 3.667743850696128*^9}, {3.667743892061728*^9, 3.667743893075728*^9}, { 3.667743935582128*^9, 3.667743942452128*^9}, {3.667795676513328*^9, 3.6677956775117283`*^9}, {3.667915565177328*^9, 3.667915565972928*^9}, { 3.667917592883128*^9, 3.6679175934291277`*^9}, {3.668428988497557*^9, 3.668429012319557*^9}, 3.668429052045557*^9, {3.6684290876275573`*^9, 3.668429088731557*^9}, {3.6695349591475267`*^9, 3.6695349605715265`*^9}, { 3.6695349939305267`*^9, 3.6695350277675266`*^9}, 3.6695370781465263`*^9, { 3.6695510068715267`*^9, 3.669551007622526*^9}, {3.6695510515725265`*^9, 3.6695510539395266`*^9}, {3.6696146253805265`*^9, 3.6696146264035263`*^9}, {3.6696146645295267`*^9, 3.6696146709445267`*^9}, {3.6696150918815265`*^9, 3.6696150926645265`*^9}, {3.6696317963355265`*^9, 3.6696318295325265`*^9}, {3.6696321980715265`*^9, 3.6696321997035265`*^9}, {3.6696325801775265`*^9, 3.6696325895695267`*^9}, {3.6696356840645266`*^9, 3.669635693360526*^9}, { 3.6696365964285264`*^9, 3.669636604700526*^9}, {3.669638665846526*^9, 3.6696386738455267`*^9}, 3.6697102027505264`*^9, {3.6697163605425262`*^9, 3.6697163608625264`*^9}, {3.669716393516526*^9, 3.6697164109075265`*^9}, { 3.6697187035275264`*^9, 3.669718722582526*^9}, {3.6697205917085266`*^9, 3.6697206106995263`*^9}, {3.669720641306526*^9, 3.6697206543125267`*^9}, { 3.6697208326545267`*^9, 3.6697208423815265`*^9}, {3.6697214296125264`*^9, 3.6697214300285263`*^9}, {3.6697218029515266`*^9, 3.6697218595075264`*^9}, {3.6697219332635264`*^9, 3.669721936575526*^9}, { 3.6697221612985263`*^9, 3.6697221643385267`*^9}, {3.6697227056195264`*^9, 3.6697227059395266`*^9}, {3.6697227575525265`*^9, 3.6697227599685264`*^9}, {3.6697228277565265`*^9, 3.669722842747526*^9}, { 3.6697228748895264`*^9, 3.6697228796095266`*^9}, {3.6697229889475265`*^9, 3.6697229912835264`*^9}, 3.6697231936235266`*^9, {3.6697242665695267`*^9, 3.6697242822175264`*^9}, {3.669726195419526*^9, 3.6697262028115263`*^9}, { 3.670758937973533*^9, 3.6707589515143332`*^9}, {3.6707591860603333`*^9, 3.670759187214733*^9}, {3.670759971489133*^9, 3.6707599815979333`*^9}, { 3.6707600588491335`*^9, 3.670760059036333*^9}, 3.670760336685133*^9, 3.6709294809923334`*^9, 3.6709343832879333`*^9, 3.671023159987689*^9, { 3.671023458655772*^9, 3.6710234940287952`*^9}, {3.6710237339775195`*^9, 3.6710237353886003`*^9}, {3.6710237830743275`*^9, 3.6710238189583807`*^9}, {3.671024008366214*^9, 3.6710240172517223`*^9}, { 3.671074487083688*^9, 3.671074492799014*^9}, {3.67129598275673*^9, 3.671296027873009*^9}, {3.6712960778198977`*^9, 3.671296078209898*^9}, { 3.671517861531059*^9, 3.671517862981861*^9}, {3.671537982601802*^9, 3.6715379967822266`*^9}, {3.677406515777542*^9, 3.6774065438235426`*^9}, { 3.6774065944125423`*^9, 3.6774066379465427`*^9}, {3.6774084352685423`*^9, 3.6774084414115424`*^9}, {3.748594752877228*^9, 3.7485947532444296`*^9}, 3.7485948377421293`*^9, {3.7485949762067165`*^9, 3.748594979660951*^9}, { 3.748595515247923*^9, 3.7485955154549627`*^9}, {3.7485977298164864`*^9, 3.748597731832959*^9}, {3.748764806618795*^9, 3.7487648085854654`*^9}, { 3.748768709780711*^9, 3.748768775264629*^9}, 3.7487694957123847`*^9, { 3.748769918510087*^9, 3.7487699243808827`*^9}, {3.7487700513262625`*^9, 3.748770063675123*^9}, {3.748770263789324*^9, 3.748770268765568*^9}, 3.7487703793893294`*^9, 3.7489383006075697`*^9, {3.7489422722790775`*^9, 3.748942274358259*^9}, {3.7489423785660152`*^9, 3.7489424555413947`*^9}, { 3.748942586564638*^9, 3.7489425983077865`*^9}, {3.748942637157911*^9, 3.748942726581896*^9}, {3.748943987808711*^9, 3.748944039901924*^9}, { 3.7489441403180666`*^9, 3.7489441579034157`*^9}, {3.748946396750352*^9, 3.74894639687731*^9}, {3.749296582891738*^9, 3.749296583226678*^9}, { 3.7492989815772333`*^9, 3.7492989824884014`*^9}, {3.7492990688403177`*^9, 3.7492990699428988`*^9}, {3.749299511926371*^9, 3.749299614390433*^9}, { 3.7492996549332232`*^9, 3.7492996722927*^9}, {3.7493000297795115`*^9, 3.7493000312676973`*^9}, {3.7493002451889057`*^9, 3.7493002797019496`*^9}, {3.7493006428460264`*^9, 3.749300661942463*^9}, { 3.749361134988944*^9, 3.7493611363023367`*^9}, 3.749368230044001*^9, { 3.7493727543752885`*^9, 3.7493727633033657`*^9}, 3.7493752574054527`*^9, 3.749378058091799*^9, {3.7493800735679274`*^9, 3.749380075087517*^9}, 3.7493802875413017`*^9, {3.7493803564064264`*^9, 3.749380357046034*^9}, 3.749380431239832*^9, {3.749440871703183*^9, 3.7494408979896636`*^9}, { 3.7494414082745357`*^9, 3.7494414084356747`*^9}, 3.7494418131279073`*^9, { 3.7494419346169147`*^9, 3.749441935271237*^9}, {3.749442252294484*^9, 3.749442255110916*^9}, {3.7494675866325293`*^9, 3.7494675869674687`*^9}, 3.749467626934312*^9, {3.749468627860849*^9, 3.749468628180197*^9}, { 3.7494692252807727`*^9, 3.7494692271050615`*^9}, {3.749469346625128*^9, 3.749469347631899*^9}, {3.749547401271004*^9, 3.7495474053180346`*^9}, 3.74954781021434*^9, {3.749551077300151*^9, 3.7495510798869*^9}, 3.749791427385586*^9, 3.7497967387289343`*^9, {3.7498189288274536`*^9, 3.7498189294192734`*^9}, 3.7498973530613976`*^9, 3.74990794306636*^9, { 3.749907974248556*^9, 3.7499079822011724`*^9}, {3.7499080396888638`*^9, 3.749908040072667*^9}, {3.7499081334333267`*^9, 3.7499081338317795`*^9}, { 3.749909495015021*^9, 3.7499094965043354`*^9}, {3.7499790464134765`*^9, 3.749979049477071*^9}, {3.749982833100074*^9, 3.7499828333393407`*^9}, { 3.7499828751635275`*^9, 3.749982879868786*^9}, 3.749983817705352*^9, { 3.7499853445026526`*^9, 3.749985345414797*^9}, {3.7535276297998667`*^9, 3.7535276388705273`*^9}, 3.7535280758774443`*^9, {3.7536038103183403`*^9, 3.753603814447405*^9}, {3.75368464914781*^9, 3.75368466935645*^9}, 3.753684965464896*^9, {3.7536850961678476`*^9, 3.753685101927447*^9}, { 3.7537929268396006`*^9, 3.753792926983173*^9}, 3.7537935415823994`*^9, 3.753793626520288*^9, {3.754222426068798*^9, 3.754222427797409*^9}, { 3.7542225122974477`*^9, 3.7542225190721054`*^9}, 3.7542234821334295`*^9, { 3.7542255403803596`*^9, 3.7542255466268435`*^9}, {3.7542259312335033`*^9, 3.7542259327773857`*^9}, {3.7577934878368726`*^9, 3.7577934920166397`*^9}, {3.7577936787705307`*^9, 3.757793681266836*^9}, { 3.7580471209008207`*^9, 3.7580471455866537`*^9}, {3.7580472225915036`*^9, 3.7580472337841463`*^9}, 3.7580472938608694`*^9, {3.7580488293881903`*^9, 3.758048831590423*^9}, {3.758049801709608*^9, 3.758049804510497*^9}, { 3.7580502839894543`*^9, 3.758050323803483*^9}, {3.7580505584922905`*^9, 3.758050564986992*^9}, 3.758050612688388*^9, {3.7580517971523905`*^9, 3.758051801548682*^9}, {3.7580543735606112`*^9, 3.7580543746083956`*^9}, { 3.7580544623927317`*^9, 3.7580544662327228`*^9}, {3.758054513989504*^9, 3.758054514686725*^9}, {3.7580547341641593`*^9, 3.758054736893756*^9}, { 3.760384813102412*^9, 3.7603848135920687`*^9}, {3.760384862184715*^9, 3.760384862731246*^9}, {3.7603849613793244`*^9, 3.7603849619169245`*^9}, { 3.760385130055154*^9, 3.7603851322632155`*^9}, {3.760385206899543*^9, 3.7603852099354386`*^9}, {3.760386234906005*^9, 3.760386235727845*^9}, { 3.760387959242777*^9, 3.7603879612264595`*^9}, {3.760391435731744*^9, 3.76039143738583*^9}, 3.7603925365342903`*^9, {3.76044974491711*^9, 3.7604497553959618`*^9}, {3.760453577749151*^9, 3.760453579292432*^9}, { 3.760453610164253*^9, 3.7604536483798857`*^9}, {3.760454098049994*^9, 3.760454099873564*^9}, {3.7604541892905407`*^9, 3.7604541919375772`*^9}, 3.760454888197476*^9, 3.7604551102930937`*^9, 3.7604556535399933`*^9, 3.760456041458219*^9, {3.7604561888087597`*^9, 3.760456204623962*^9}, { 3.7604715448736954`*^9, 3.760471546236084*^9}, {3.760472545421132*^9, 3.760472545977127*^9}, {3.760472646217716*^9, 3.7604726474628735`*^9}, 3.76047742397609*^9, {3.7604775336118665`*^9, 3.7604775343029785`*^9}, { 3.760477598374628*^9, 3.760477602381877*^9}, 3.764301641685611*^9, { 3.764474651420169*^9, 3.764474689839425*^9}, 3.7645936316193943`*^9, 3.768712840484685*^9, 3.7849125576087265`*^9, {3.7849138983590136`*^9, 3.7849139003828354`*^9}, {3.784915457395995*^9, 3.784915459039815*^9}, { 3.785042735967092*^9, 3.785042806648767*^9}, {3.785042897627165*^9, 3.7850428985693207`*^9}, {3.7850429289977093`*^9, 3.7850429885741568`*^9}, {3.7850435404583473`*^9, 3.785043557900482*^9}, { 3.78504363260196*^9, 3.7850436329845867`*^9}, {3.7850441983864813`*^9, 3.785044199560014*^9}, {3.7850443287058487`*^9, 3.785044331855242*^9}, { 3.7850446857740192`*^9, 3.78504468780606*^9}, {3.785044759262548*^9, 3.785044763066691*^9}, {3.785044889423337*^9, 3.7850448956588917`*^9}, { 3.785045058563389*^9, 3.7850450624133177`*^9}, {3.78504515547069*^9, 3.7850451619488163`*^9}, {3.785045911357325*^9, 3.7850459559291983`*^9}, { 3.7850460606052237`*^9, 3.785046066089663*^9}, {3.785053302535205*^9, 3.785053304856895*^9}, 3.785475568404909*^9, 3.785475813039476*^9, { 3.785476374351667*^9, 3.785476396007793*^9}, {3.785476503507984*^9, 3.785476507203307*^9}, {3.785476574692485*^9, 3.7854766107072487`*^9}, 3.7854767311878557`*^9, {3.7854857226075363`*^9, 3.785485754828389*^9}, { 3.785485895088513*^9, 3.785485922780839*^9}, 3.7854859647216177`*^9, { 3.785491333342083*^9, 3.785491336089031*^9}, 3.785566795165312*^9, { 3.7855671552938137`*^9, 3.785567158010968*^9}, 3.785567193663268*^9, { 3.7941145588733263`*^9, 3.794114570198476*^9}, {3.7941153689808035`*^9, 3.7941154082780557`*^9}, {3.79411643358989*^9, 3.7941164363362513`*^9}, { 3.7941191618188725`*^9, 3.7941191625539465`*^9}, {3.794120722426812*^9, 3.794120723196542*^9}, {3.7941213148543215`*^9, 3.7941213354951334`*^9}, { 3.7942179029468765`*^9, 3.7942179068911023`*^9}},ExpressionUUID->"cb7e7ff3-8324-4856-bdcf-\ 74272f9f57f1"] }, Closed]], Cell[CellGroupData[{ Cell["constant individual flowering phenologies", "Subsubsection", CellChangeTimes->{{3.7942179260021954`*^9, 3.7942179532657547`*^9}},ExpressionUUID->"a2041dae-5060-42d9-9169-\ 1efa83c3b2f4"], Cell[BoxData[{ RowBox[{ RowBox[{"flowerperplant", "=", RowBox[{"{", RowBox[{"20", ",", "40"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"individualphenology", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "0", ",", "0", ",", "0", ",", "0", ",", "1", ",", "1", ",", "1", ",", "2", ",", "2", ",", "3", ",", "3", ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "10"}], ",", RowBox[{"-", "9"}], ",", RowBox[{"-", "8"}], ",", RowBox[{"-", "7"}], ",", RowBox[{"-", "6"}], ",", RowBox[{"-", "5"}], ",", RowBox[{"-", "5"}], ",", RowBox[{"-", "4"}], ",", RowBox[{"-", "4"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "3"}], ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "2"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", RowBox[{"-", "1"}], ",", "0", ",", "0", ",", "0", ",", "0", ",", "1", ",", "1", ",", "1", ",", "2", ",", "2", ",", "2", ",", "3", ",", "3", ",", "3", ",", "4", ",", "4", ",", "5", ",", "5", ",", "6", ",", "7", ",", "8", ",", "9", ",", "10"}], "}"}]}], "}"}]}], ";"}]}], "Input", CellChangeTimes->{{3.6648715896219373`*^9, 3.6648716700009375`*^9}, { 3.664871712829937*^9, 3.6648717129899373`*^9}, {3.664871743115937*^9, 3.664871825510937*^9}, 3.664871883123937*^9, {3.6648719384019375`*^9, 3.664871958815937*^9}, {3.664871997517937*^9, 3.6648720308289375`*^9}, { 3.664872087112937*^9, 3.664872102999937*^9}, {3.664872169748937*^9, 3.664872173107937*^9}, {3.664876779839937*^9, 3.664876819946937*^9}, { 3.664877050237937*^9, 3.6648770993709373`*^9}, {3.664877180230937*^9, 3.664877182788937*^9}, {3.6648772927839375`*^9, 3.6648773082399373`*^9}, { 3.6648773733569374`*^9, 3.664877386074937*^9}, {3.664877461286937*^9, 3.6648774679899373`*^9}, {3.6648775039889374`*^9, 3.664877517091937*^9}, { 3.664877593678937*^9, 3.6648776040149374`*^9}, {3.664877650635937*^9, 3.664877651402937*^9}, {3.664877681498937*^9, 3.6648777015129375`*^9}, { 3.6648778508329372`*^9, 3.664877866591937*^9}, 3.6648779008619375`*^9, { 3.664877935819937*^9, 3.664877936171937*^9}, {3.664878006359937*^9, 3.6648780075269375`*^9}, {3.664878069523937*^9, 3.664878070451937*^9}, { 3.664878121376937*^9, 3.664878121839937*^9}, {3.6648781754379373`*^9, 3.664878179116937*^9}, {3.664878393537937*^9, 3.664878422975937*^9}, 3.6648787653719373`*^9, {3.6648788376869373`*^9, 3.664878840998937*^9}, { 3.6648790134379373`*^9, 3.6648790137579374`*^9}, {3.6648795830219374`*^9, 3.6648795868129373`*^9}, {3.664879630442937*^9, 3.664879641977937*^9}, { 3.6648796810629373`*^9, 3.664879788899937*^9}, 3.6648799688569374`*^9, { 3.664880010407937*^9, 3.664880016806937*^9}, {3.6648807270409374`*^9, 3.664880741629937*^9}, {3.664881075786937*^9, 3.664881076859937*^9}, { 3.6648812232039375`*^9, 3.6648812263379374`*^9}, 3.6648813756279373`*^9, { 3.664884048975937*^9, 3.664884050159937*^9}, {3.664884081678937*^9, 3.664884082286937*^9}, {3.664884573954937*^9, 3.6648845803689375`*^9}, { 3.664884829893937*^9, 3.664884830787937*^9}, {3.6648871699369373`*^9, 3.6648871834369373`*^9}, {3.6648882929899373`*^9, 3.664888294492937*^9}, { 3.6648883527139373`*^9, 3.664888385751937*^9}, {3.6648884938899374`*^9, 3.664888506001937*^9}, {3.664889366511937*^9, 3.664889369390937*^9}, 3.6648895378789372`*^9, {3.664889709435937*^9, 3.6648897443309374`*^9}, { 3.664890330617937*^9, 3.664890332392937*^9}, {3.665133978450777*^9, 3.665133993208403*^9}, {3.665315445635625*^9, 3.665315448786805*^9}, { 3.6653157354882035`*^9, 3.665315738992404*^9}, {3.665315780849798*^9, 3.6653157827659073`*^9}, {3.665323192747734*^9, 3.665323207519579*^9}, { 3.665323308633363*^9, 3.6653233281274776`*^9}, {3.665325291239561*^9, 3.665325291590561*^9}, {3.665325349299561*^9, 3.6653253703225613`*^9}, { 3.665325965792561*^9, 3.665325965984561*^9}, 3.6653268807645607`*^9, 3.665385144122561*^9, {3.665386399027561*^9, 3.665386403570561*^9}, 3.6653864412645607`*^9, 3.665399697755561*^9, {3.6654070097385607`*^9, 3.665407011577561*^9}, {3.665480946545561*^9, 3.665480950824561*^9}, { 3.665480992005561*^9, 3.6654810500985613`*^9}, {3.665481197402561*^9, 3.665481197562561*^9}, {3.66589680184194*^9, 3.66589685197474*^9}, { 3.66598509252314*^9, 3.66598512551194*^9}, {3.6659851667839403`*^9, 3.66598519412674*^9}, {3.6659879330325403`*^9, 3.6659879551135397`*^9}, { 3.6659879910503397`*^9, 3.6659879957167397`*^9}, 3.66598803512074*^9, 3.6659885764363403`*^9, 3.66598979376014*^9, {3.6659898251315403`*^9, 3.66598982564734*^9}, {3.66599001328454*^9, 3.6659900541851397`*^9}, { 3.6659901698253403`*^9, 3.66599017634814*^9}, {3.66599344464494*^9, 3.6659934480613403`*^9}, {3.66599665578874*^9, 3.6659966624197397`*^9}, { 3.66599879944554*^9, 3.66599882015574*^9}, {3.66606632431854*^9, 3.6660663402687397`*^9}, 3.6665859769861417`*^9, {3.666591046952142*^9, 3.6665910860861416`*^9}, {3.666593791212142*^9, 3.666593802267142*^9}, { 3.666596281278142*^9, 3.666596287165142*^9}, {3.6666033066371417`*^9, 3.6666033297551417`*^9}, 3.666603388919142*^9, 3.6666034661311417`*^9, { 3.666619050528936*^9, 3.666619084972136*^9}, 3.666619242280136*^9, { 3.66670178366774*^9, 3.66670182831234*^9}, {3.66670214680534*^9, 3.6667021477101398`*^9}, {3.6667022502497396`*^9, 3.66670225583554*^9}, 3.66670243707954*^9, {3.66670287930814*^9, 3.6667028813049397`*^9}, { 3.66670305280074*^9, 3.66670309847034*^9}, {3.666952950395542*^9, 3.6669529706505423`*^9}, {3.6669533102475424`*^9, 3.6669533108065424`*^9}, {3.6669546917205424`*^9, 3.6669546953675423`*^9}, {3.6669553620185423`*^9, 3.6669553630095425`*^9}, {3.667732642023328*^9, 3.667732645816128*^9}, 3.667732784491728*^9, {3.6677428965117283`*^9, 3.6677429076999283`*^9}, { 3.667743511150128*^9, 3.667743511713728*^9}, {3.6677438475595284`*^9, 3.667743850696128*^9}, {3.667743892061728*^9, 3.667743893075728*^9}, { 3.667743935582128*^9, 3.667743942452128*^9}, {3.667795676513328*^9, 3.6677956775117283`*^9}, {3.667915565177328*^9, 3.667915565972928*^9}, { 3.667917592883128*^9, 3.6679175934291277`*^9}, {3.668428988497557*^9, 3.668429012319557*^9}, 3.668429052045557*^9, {3.6684290876275573`*^9, 3.668429088731557*^9}, {3.6695349591475267`*^9, 3.6695349605715265`*^9}, { 3.6695349939305267`*^9, 3.6695350277675266`*^9}, 3.6695370781465263`*^9, { 3.6695510068715267`*^9, 3.669551007622526*^9}, {3.6695510515725265`*^9, 3.6695510539395266`*^9}, {3.6696146253805265`*^9, 3.6696146264035263`*^9}, {3.6696146645295267`*^9, 3.6696146709445267`*^9}, {3.6696150918815265`*^9, 3.6696150926645265`*^9}, {3.6696317963355265`*^9, 3.6696318295325265`*^9}, {3.6696321980715265`*^9, 3.6696321997035265`*^9}, {3.6696325801775265`*^9, 3.6696325895695267`*^9}, {3.6696356840645266`*^9, 3.669635693360526*^9}, { 3.6696365964285264`*^9, 3.669636604700526*^9}, {3.669638665846526*^9, 3.6696386738455267`*^9}, 3.6697102027505264`*^9, {3.6697163605425262`*^9, 3.6697163608625264`*^9}, {3.669716393516526*^9, 3.6697164109075265`*^9}, { 3.6697187035275264`*^9, 3.669718722582526*^9}, {3.6697205917085266`*^9, 3.6697206106995263`*^9}, {3.669720641306526*^9, 3.6697206543125267`*^9}, { 3.6697208326545267`*^9, 3.6697208423815265`*^9}, {3.6697214296125264`*^9, 3.6697214300285263`*^9}, {3.6697218029515266`*^9, 3.6697218595075264`*^9}, {3.6697219332635264`*^9, 3.669721936575526*^9}, { 3.6697221612985263`*^9, 3.6697221643385267`*^9}, {3.6697227056195264`*^9, 3.6697227059395266`*^9}, {3.6697227575525265`*^9, 3.6697227599685264`*^9}, {3.6697228277565265`*^9, 3.669722842747526*^9}, { 3.6697228748895264`*^9, 3.6697228796095266`*^9}, {3.6697229889475265`*^9, 3.6697229912835264`*^9}, 3.6697231936235266`*^9, {3.6697242665695267`*^9, 3.6697242822175264`*^9}, {3.669726195419526*^9, 3.6697262028115263`*^9}, { 3.670758937973533*^9, 3.6707589515143332`*^9}, {3.6707591860603333`*^9, 3.670759187214733*^9}, {3.670759971489133*^9, 3.6707599815979333`*^9}, { 3.6707600588491335`*^9, 3.670760059036333*^9}, 3.670760336685133*^9, 3.6709294809923334`*^9, 3.6709343832879333`*^9, 3.671023159987689*^9, { 3.671023458655772*^9, 3.6710234940287952`*^9}, {3.6710237339775195`*^9, 3.6710237353886003`*^9}, {3.6710237830743275`*^9, 3.6710238189583807`*^9}, {3.671024008366214*^9, 3.6710240172517223`*^9}, { 3.671074487083688*^9, 3.671074492799014*^9}, {3.67129598275673*^9, 3.671296027873009*^9}, {3.6712960778198977`*^9, 3.671296078209898*^9}, { 3.671517861531059*^9, 3.671517862981861*^9}, {3.671537982601802*^9, 3.6715379967822266`*^9}, {3.677406515777542*^9, 3.6774065438235426`*^9}, { 3.6774065944125423`*^9, 3.6774066379465427`*^9}, {3.6774084352685423`*^9, 3.6774084414115424`*^9}, {3.748594752877228*^9, 3.7485947532444296`*^9}, 3.7485948377421293`*^9, {3.7485949762067165`*^9, 3.748594979660951*^9}, { 3.748595515247923*^9, 3.7485955154549627`*^9}, {3.7485977298164864`*^9, 3.748597731832959*^9}, {3.748764806618795*^9, 3.7487648085854654`*^9}, { 3.748768709780711*^9, 3.748768775264629*^9}, 3.7487694957123847`*^9, { 3.748769918510087*^9, 3.7487699243808827`*^9}, {3.7487700513262625`*^9, 3.748770063675123*^9}, {3.748770263789324*^9, 3.748770268765568*^9}, 3.7487703793893294`*^9, 3.7489383006075697`*^9, {3.7489422722790775`*^9, 3.748942274358259*^9}, {3.7489423785660152`*^9, 3.7489424555413947`*^9}, { 3.748942586564638*^9, 3.7489425983077865`*^9}, {3.748942637157911*^9, 3.748942726581896*^9}, {3.748943987808711*^9, 3.748944039901924*^9}, { 3.7489441403180666`*^9, 3.7489441579034157`*^9}, {3.748946396750352*^9, 3.74894639687731*^9}, {3.749296582891738*^9, 3.749296583226678*^9}, { 3.7492989815772333`*^9, 3.7492989824884014`*^9}, {3.7492990688403177`*^9, 3.7492990699428988`*^9}, {3.749299511926371*^9, 3.749299614390433*^9}, { 3.7492996549332232`*^9, 3.7492996722927*^9}, {3.7493000297795115`*^9, 3.7493000312676973`*^9}, {3.7493002451889057`*^9, 3.7493002797019496`*^9}, {3.7493006428460264`*^9, 3.749300661942463*^9}, { 3.749361134988944*^9, 3.7493611363023367`*^9}, 3.749368230044001*^9, { 3.7493727543752885`*^9, 3.7493727633033657`*^9}, 3.7493752574054527`*^9, 3.749378058091799*^9, {3.7493800735679274`*^9, 3.749380075087517*^9}, 3.7493802875413017`*^9, {3.7493803564064264`*^9, 3.749380357046034*^9}, 3.749380431239832*^9, {3.749440871703183*^9, 3.7494408979896636`*^9}, { 3.7494414082745357`*^9, 3.7494414084356747`*^9}, 3.7494418131279073`*^9, { 3.7494419346169147`*^9, 3.749441935271237*^9}, {3.749442252294484*^9, 3.749442255110916*^9}, {3.7494675866325293`*^9, 3.7494675869674687`*^9}, 3.749467626934312*^9, {3.749468627860849*^9, 3.749468628180197*^9}, { 3.7494692252807727`*^9, 3.7494692271050615`*^9}, {3.749469346625128*^9, 3.749469347631899*^9}, {3.749547401271004*^9, 3.7495474053180346`*^9}, 3.74954781021434*^9, {3.749551077300151*^9, 3.7495510798869*^9}, 3.749791427385586*^9, 3.7497967387289343`*^9, {3.7498189288274536`*^9, 3.7498189294192734`*^9}, 3.7498973530613976`*^9, 3.74990794306636*^9, { 3.749907974248556*^9, 3.7499079822011724`*^9}, {3.7499080396888638`*^9, 3.749908040072667*^9}, {3.7499081334333267`*^9, 3.7499081338317795`*^9}, { 3.749909495015021*^9, 3.7499094965043354`*^9}, {3.7499790464134765`*^9, 3.749979049477071*^9}, {3.749982833100074*^9, 3.7499828333393407`*^9}, { 3.7499828751635275`*^9, 3.749982879868786*^9}, 3.749983817705352*^9, { 3.7499853445026526`*^9, 3.749985345414797*^9}, {3.7535276297998667`*^9, 3.7535276388705273`*^9}, 3.7535280758774443`*^9, {3.7536038103183403`*^9, 3.753603814447405*^9}, {3.75368464914781*^9, 3.75368466935645*^9}, 3.753684965464896*^9, {3.7536850961678476`*^9, 3.753685101927447*^9}, { 3.7537929268396006`*^9, 3.753792926983173*^9}, 3.7537935415823994`*^9, 3.753793626520288*^9, {3.754222426068798*^9, 3.754222427797409*^9}, { 3.7542225122974477`*^9, 3.7542225190721054`*^9}, 3.7542234821334295`*^9, { 3.7542255403803596`*^9, 3.7542255466268435`*^9}, {3.7542259312335033`*^9, 3.7542259327773857`*^9}, {3.7577934878368726`*^9, 3.7577934920166397`*^9}, {3.7577936787705307`*^9, 3.757793681266836*^9}, { 3.7580471209008207`*^9, 3.7580471455866537`*^9}, {3.7580472225915036`*^9, 3.7580472337841463`*^9}, 3.7580472938608694`*^9, {3.7580488293881903`*^9, 3.758048831590423*^9}, {3.758049801709608*^9, 3.758049804510497*^9}, { 3.7580502839894543`*^9, 3.758050323803483*^9}, {3.7580505584922905`*^9, 3.758050564986992*^9}, 3.758050612688388*^9, {3.7580517971523905`*^9, 3.758051801548682*^9}, {3.7580543735606112`*^9, 3.7580543746083956`*^9}, { 3.7580544623927317`*^9, 3.7580544662327228`*^9}, {3.758054513989504*^9, 3.758054514686725*^9}, {3.7580547341641593`*^9, 3.758054736893756*^9}, { 3.760384813102412*^9, 3.7603848135920687`*^9}, {3.760384862184715*^9, 3.760384862731246*^9}, {3.7603849613793244`*^9, 3.7603849619169245`*^9}, { 3.760385130055154*^9, 3.7603851322632155`*^9}, {3.760385206899543*^9, 3.7603852099354386`*^9}, {3.760386234906005*^9, 3.760386235727845*^9}, { 3.760387959242777*^9, 3.7603879612264595`*^9}, {3.760391435731744*^9, 3.76039143738583*^9}, 3.7603925365342903`*^9, {3.76044974491711*^9, 3.7604497553959618`*^9}, {3.760453577749151*^9, 3.760453579292432*^9}, { 3.760453610164253*^9, 3.7604536483798857`*^9}, {3.760454098049994*^9, 3.760454099873564*^9}, {3.7604541892905407`*^9, 3.7604541919375772`*^9}, 3.760454888197476*^9, 3.7604551102930937`*^9, 3.7604556535399933`*^9, 3.760456041458219*^9, {3.7604561888087597`*^9, 3.760456204623962*^9}, { 3.7604715448736954`*^9, 3.760471546236084*^9}, {3.760472545421132*^9, 3.760472545977127*^9}, {3.760472646217716*^9, 3.7604726474628735`*^9}, 3.76047742397609*^9, {3.7604775336118665`*^9, 3.7604775343029785`*^9}, { 3.760477598374628*^9, 3.760477602381877*^9}, 3.764301641685611*^9, { 3.764474651420169*^9, 3.764474689839425*^9}, 3.7645936316193943`*^9, 3.768712840484685*^9, 3.7849125576087265`*^9, {3.7849138983590136`*^9, 3.7849139003828354`*^9}, {3.784915457395995*^9, 3.784915459039815*^9}, { 3.785042735967092*^9, 3.785042806648767*^9}, {3.785042897627165*^9, 3.7850428985693207`*^9}, {3.7850429289977093`*^9, 3.7850429885741568`*^9}, {3.7850435404583473`*^9, 3.785043557900482*^9}, { 3.78504363260196*^9, 3.7850436329845867`*^9}, {3.7850441983864813`*^9, 3.785044199560014*^9}, {3.7850443287058487`*^9, 3.785044331855242*^9}, { 3.7850446857740192`*^9, 3.78504468780606*^9}, {3.785044759262548*^9, 3.785044763066691*^9}, {3.785044889423337*^9, 3.7850448956588917`*^9}, { 3.785045058563389*^9, 3.7850450624133177`*^9}, {3.78504515547069*^9, 3.7850451619488163`*^9}, {3.785045911357325*^9, 3.7850459559291983`*^9}, { 3.7850460606052237`*^9, 3.785046066089663*^9}, {3.785053302535205*^9, 3.785053304856895*^9}, 3.785475568404909*^9, 3.785475813039476*^9, { 3.785476374351667*^9, 3.785476396007793*^9}, {3.785476503507984*^9, 3.785476507203307*^9}, {3.785476574692485*^9, 3.7854766107072487`*^9}, 3.7854767311878557`*^9, {3.7854857226075363`*^9, 3.785485754828389*^9}, { 3.785485895088513*^9, 3.785485922780839*^9}, 3.7854859647216177`*^9, { 3.785491333342083*^9, 3.785491336089031*^9}, 3.785566795165312*^9, { 3.7855671552938137`*^9, 3.785567158010968*^9}, 3.785567193663268*^9, { 3.7941145588733263`*^9, 3.794114570198476*^9}, {3.7941153689808035`*^9, 3.7941154082780557`*^9}, {3.79411643358989*^9, 3.7941164363362513`*^9}, { 3.7941191618188725`*^9, 3.7941191625539465`*^9}, {3.794120722426812*^9, 3.794120723196542*^9}, {3.7941213148543215`*^9, 3.7941213354951334`*^9}, { 3.7942179029468765`*^9, 3.79421790492299*^9}},ExpressionUUID->"cb7e7ff3-8324-4856-bdcf-\ 74272f9f57f1"] }, Closed]], Cell[CellGroupData[{ Cell["parameters for environmental changes", "Subsubsection", CellChangeTimes->{{3.7942179260021954`*^9, 3.7942179344336777`*^9}, { 3.7942179774581385`*^9, 3.794217988969797*^9}},ExpressionUUID->"84e65d4e-9f5d-41f6-8e51-\ b93cf0ba2a0c"], Cell[BoxData[{ RowBox[{ RowBox[{"optimum", "=", "0"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"startfluctuation", "=", "0"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"selectionwidth", " ", "=", RowBox[{"{", RowBox[{ "400", ",", "50", ",", "20", ",", "100", ",", "1000", ",", "10000", ",", "100000", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"optimumchange", "=", RowBox[{"{", RowBox[{ "0.05", ",", "0.1", ",", "0.15", ",", "0.2", ",", "0.3", ",", "0.4", ",", "0.5"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"optimumfluct", "=", RowBox[{"{", RowBox[{"100", ",", "1", ",", "5", ",", "25", ",", "400", ",", "900"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"stabilizingfluctuations", "=", "0"}], ";"}]}], "Input", CellChangeTimes->{{3.6648715896219373`*^9, 3.6648716700009375`*^9}, { 3.664871712829937*^9, 3.6648717129899373`*^9}, {3.664871743115937*^9, 3.664871825510937*^9}, 3.664871883123937*^9, {3.6648719384019375`*^9, 3.664871958815937*^9}, {3.664871997517937*^9, 3.6648720308289375`*^9}, { 3.664872087112937*^9, 3.664872102999937*^9}, {3.664872169748937*^9, 3.664872173107937*^9}, {3.664876779839937*^9, 3.664876819946937*^9}, { 3.664877050237937*^9, 3.6648770993709373`*^9}, {3.664877180230937*^9, 3.664877182788937*^9}, {3.6648772927839375`*^9, 3.6648773082399373`*^9}, { 3.6648773733569374`*^9, 3.664877386074937*^9}, {3.664877461286937*^9, 3.6648774679899373`*^9}, {3.6648775039889374`*^9, 3.664877517091937*^9}, { 3.664877593678937*^9, 3.6648776040149374`*^9}, {3.664877650635937*^9, 3.664877651402937*^9}, {3.664877681498937*^9, 3.6648777015129375`*^9}, { 3.6648778508329372`*^9, 3.664877866591937*^9}, 3.6648779008619375`*^9, { 3.664877935819937*^9, 3.664877936171937*^9}, {3.664878006359937*^9, 3.6648780075269375`*^9}, {3.664878069523937*^9, 3.664878070451937*^9}, { 3.664878121376937*^9, 3.664878121839937*^9}, {3.6648781754379373`*^9, 3.664878179116937*^9}, {3.664878393537937*^9, 3.664878422975937*^9}, 3.6648787653719373`*^9, {3.6648788376869373`*^9, 3.664878840998937*^9}, { 3.6648790134379373`*^9, 3.6648790137579374`*^9}, {3.6648795830219374`*^9, 3.6648795868129373`*^9}, {3.664879630442937*^9, 3.664879641977937*^9}, { 3.6648796810629373`*^9, 3.664879788899937*^9}, 3.6648799688569374`*^9, { 3.664880010407937*^9, 3.664880016806937*^9}, {3.6648807270409374`*^9, 3.664880741629937*^9}, {3.664881075786937*^9, 3.664881076859937*^9}, { 3.6648812232039375`*^9, 3.6648812263379374`*^9}, 3.6648813756279373`*^9, { 3.664884048975937*^9, 3.664884050159937*^9}, {3.664884081678937*^9, 3.664884082286937*^9}, {3.664884573954937*^9, 3.6648845803689375`*^9}, { 3.664884829893937*^9, 3.664884830787937*^9}, {3.6648871699369373`*^9, 3.6648871834369373`*^9}, {3.6648882929899373`*^9, 3.664888294492937*^9}, { 3.6648883527139373`*^9, 3.664888385751937*^9}, {3.6648884938899374`*^9, 3.664888506001937*^9}, {3.664889366511937*^9, 3.664889369390937*^9}, 3.6648895378789372`*^9, {3.664889709435937*^9, 3.6648897443309374`*^9}, { 3.664890330617937*^9, 3.664890332392937*^9}, {3.665133978450777*^9, 3.665133993208403*^9}, {3.665315445635625*^9, 3.665315448786805*^9}, { 3.6653157354882035`*^9, 3.665315738992404*^9}, {3.665315780849798*^9, 3.6653157827659073`*^9}, {3.665323192747734*^9, 3.665323207519579*^9}, { 3.665323308633363*^9, 3.6653233281274776`*^9}, {3.665325291239561*^9, 3.665325291590561*^9}, {3.665325349299561*^9, 3.6653253703225613`*^9}, { 3.665325965792561*^9, 3.665325965984561*^9}, 3.6653268807645607`*^9, 3.665385144122561*^9, {3.665386399027561*^9, 3.665386403570561*^9}, 3.6653864412645607`*^9, 3.665399697755561*^9, {3.6654070097385607`*^9, 3.665407011577561*^9}, {3.665480946545561*^9, 3.665480950824561*^9}, { 3.665480992005561*^9, 3.6654810500985613`*^9}, {3.665481197402561*^9, 3.665481197562561*^9}, {3.66589680184194*^9, 3.66589685197474*^9}, { 3.66598509252314*^9, 3.66598512551194*^9}, {3.6659851667839403`*^9, 3.66598519412674*^9}, {3.6659879330325403`*^9, 3.6659879551135397`*^9}, { 3.6659879910503397`*^9, 3.6659879957167397`*^9}, 3.66598803512074*^9, 3.6659885764363403`*^9, 3.66598979376014*^9, {3.6659898251315403`*^9, 3.66598982564734*^9}, {3.66599001328454*^9, 3.6659900541851397`*^9}, { 3.6659901698253403`*^9, 3.66599017634814*^9}, {3.66599344464494*^9, 3.6659934480613403`*^9}, {3.66599665578874*^9, 3.6659966624197397`*^9}, { 3.66599879944554*^9, 3.66599882015574*^9}, {3.66606632431854*^9, 3.6660663402687397`*^9}, 3.6665859769861417`*^9, {3.666591046952142*^9, 3.6665910860861416`*^9}, {3.666593791212142*^9, 3.666593802267142*^9}, { 3.666596281278142*^9, 3.666596287165142*^9}, {3.6666033066371417`*^9, 3.6666033297551417`*^9}, 3.666603388919142*^9, 3.6666034661311417`*^9, { 3.666619050528936*^9, 3.666619084972136*^9}, 3.666619242280136*^9, { 3.66670178366774*^9, 3.66670182831234*^9}, {3.66670214680534*^9, 3.6667021477101398`*^9}, {3.6667022502497396`*^9, 3.66670225583554*^9}, 3.66670243707954*^9, {3.66670287930814*^9, 3.6667028813049397`*^9}, { 3.66670305280074*^9, 3.66670309847034*^9}, {3.666952950395542*^9, 3.6669529706505423`*^9}, {3.6669533102475424`*^9, 3.6669533108065424`*^9}, {3.6669546917205424`*^9, 3.6669546953675423`*^9}, {3.6669553620185423`*^9, 3.6669553630095425`*^9}, {3.667732642023328*^9, 3.667732645816128*^9}, 3.667732784491728*^9, {3.6677428965117283`*^9, 3.6677429076999283`*^9}, { 3.667743511150128*^9, 3.667743511713728*^9}, {3.6677438475595284`*^9, 3.667743850696128*^9}, {3.667743892061728*^9, 3.667743893075728*^9}, { 3.667743935582128*^9, 3.667743942452128*^9}, {3.667795676513328*^9, 3.6677956775117283`*^9}, {3.667915565177328*^9, 3.667915565972928*^9}, { 3.667917592883128*^9, 3.6679175934291277`*^9}, {3.668428988497557*^9, 3.668429012319557*^9}, 3.668429052045557*^9, {3.6684290876275573`*^9, 3.668429088731557*^9}, {3.6695349591475267`*^9, 3.6695349605715265`*^9}, { 3.6695349939305267`*^9, 3.6695350277675266`*^9}, 3.6695370781465263`*^9, { 3.6695510068715267`*^9, 3.669551007622526*^9}, {3.6695510515725265`*^9, 3.6695510539395266`*^9}, {3.6696146253805265`*^9, 3.6696146264035263`*^9}, {3.6696146645295267`*^9, 3.6696146709445267`*^9}, {3.6696150918815265`*^9, 3.6696150926645265`*^9}, {3.6696317963355265`*^9, 3.6696318295325265`*^9}, {3.6696321980715265`*^9, 3.6696321997035265`*^9}, {3.6696325801775265`*^9, 3.6696325895695267`*^9}, {3.6696356840645266`*^9, 3.669635693360526*^9}, { 3.6696365964285264`*^9, 3.669636604700526*^9}, {3.669638665846526*^9, 3.6696386738455267`*^9}, 3.6697102027505264`*^9, {3.6697163605425262`*^9, 3.6697163608625264`*^9}, {3.669716393516526*^9, 3.6697164109075265`*^9}, { 3.6697187035275264`*^9, 3.669718722582526*^9}, {3.6697205917085266`*^9, 3.6697206106995263`*^9}, {3.669720641306526*^9, 3.6697206543125267`*^9}, { 3.6697208326545267`*^9, 3.6697208423815265`*^9}, {3.6697214296125264`*^9, 3.6697214300285263`*^9}, {3.6697218029515266`*^9, 3.6697218595075264`*^9}, {3.6697219332635264`*^9, 3.669721936575526*^9}, { 3.6697221612985263`*^9, 3.6697221643385267`*^9}, {3.6697227056195264`*^9, 3.6697227059395266`*^9}, {3.6697227575525265`*^9, 3.6697227599685264`*^9}, {3.6697228277565265`*^9, 3.669722842747526*^9}, { 3.6697228748895264`*^9, 3.6697228796095266`*^9}, {3.6697229889475265`*^9, 3.6697229912835264`*^9}, 3.6697231936235266`*^9, {3.6697242665695267`*^9, 3.6697242822175264`*^9}, {3.669726195419526*^9, 3.6697262028115263`*^9}, { 3.670758937973533*^9, 3.6707589515143332`*^9}, {3.6707591860603333`*^9, 3.670759187214733*^9}, {3.670759971489133*^9, 3.6707599815979333`*^9}, { 3.6707600588491335`*^9, 3.670760059036333*^9}, 3.670760336685133*^9, 3.6709294809923334`*^9, 3.6709343832879333`*^9, 3.671023159987689*^9, { 3.671023458655772*^9, 3.6710234940287952`*^9}, {3.6710237339775195`*^9, 3.6710237353886003`*^9}, {3.6710237830743275`*^9, 3.6710238189583807`*^9}, {3.671024008366214*^9, 3.6710240172517223`*^9}, { 3.671074487083688*^9, 3.671074492799014*^9}, {3.67129598275673*^9, 3.671296027873009*^9}, {3.6712960778198977`*^9, 3.671296078209898*^9}, { 3.671517861531059*^9, 3.671517862981861*^9}, {3.671537982601802*^9, 3.6715379967822266`*^9}, {3.677406515777542*^9, 3.6774065438235426`*^9}, { 3.6774065944125423`*^9, 3.6774066379465427`*^9}, {3.6774084352685423`*^9, 3.6774084414115424`*^9}, {3.748594752877228*^9, 3.7485947532444296`*^9}, 3.7485948377421293`*^9, {3.7485949762067165`*^9, 3.748594979660951*^9}, { 3.748595515247923*^9, 3.7485955154549627`*^9}, {3.7485977298164864`*^9, 3.748597731832959*^9}, {3.748764806618795*^9, 3.7487648085854654`*^9}, { 3.748768709780711*^9, 3.748768775264629*^9}, 3.7487694957123847`*^9, { 3.748769918510087*^9, 3.7487699243808827`*^9}, {3.7487700513262625`*^9, 3.748770063675123*^9}, {3.748770263789324*^9, 3.748770268765568*^9}, 3.7487703793893294`*^9, 3.7489383006075697`*^9, {3.7489422722790775`*^9, 3.748942274358259*^9}, {3.7489423785660152`*^9, 3.7489424555413947`*^9}, { 3.748942586564638*^9, 3.7489425983077865`*^9}, {3.748942637157911*^9, 3.748942726581896*^9}, {3.748943987808711*^9, 3.748944039901924*^9}, { 3.7489441403180666`*^9, 3.7489441579034157`*^9}, {3.748946396750352*^9, 3.74894639687731*^9}, {3.749296582891738*^9, 3.749296583226678*^9}, { 3.7492989815772333`*^9, 3.7492989824884014`*^9}, {3.7492990688403177`*^9, 3.7492990699428988`*^9}, {3.749299511926371*^9, 3.749299614390433*^9}, { 3.7492996549332232`*^9, 3.7492996722927*^9}, {3.7493000297795115`*^9, 3.7493000312676973`*^9}, {3.7493002451889057`*^9, 3.7493002797019496`*^9}, {3.7493006428460264`*^9, 3.749300661942463*^9}, { 3.749361134988944*^9, 3.7493611363023367`*^9}, 3.749368230044001*^9, { 3.7493727543752885`*^9, 3.7493727633033657`*^9}, 3.7493752574054527`*^9, 3.749378058091799*^9, {3.7493800735679274`*^9, 3.749380075087517*^9}, 3.7493802875413017`*^9, {3.7493803564064264`*^9, 3.749380357046034*^9}, 3.749380431239832*^9, {3.749440871703183*^9, 3.7494408979896636`*^9}, { 3.7494414082745357`*^9, 3.7494414084356747`*^9}, 3.7494418131279073`*^9, { 3.7494419346169147`*^9, 3.749441935271237*^9}, {3.749442252294484*^9, 3.749442255110916*^9}, {3.7494675866325293`*^9, 3.7494675869674687`*^9}, 3.749467626934312*^9, {3.749468627860849*^9, 3.749468628180197*^9}, { 3.7494692252807727`*^9, 3.7494692271050615`*^9}, {3.749469346625128*^9, 3.749469347631899*^9}, {3.749547401271004*^9, 3.7495474053180346`*^9}, 3.74954781021434*^9, {3.749551077300151*^9, 3.7495510798869*^9}, 3.749791427385586*^9, 3.7497967387289343`*^9, {3.7498189288274536`*^9, 3.7498189294192734`*^9}, 3.7498973530613976`*^9, 3.74990794306636*^9, { 3.749907974248556*^9, 3.7499079822011724`*^9}, {3.7499080396888638`*^9, 3.749908040072667*^9}, {3.7499081334333267`*^9, 3.7499081338317795`*^9}, { 3.749909495015021*^9, 3.7499094965043354`*^9}, {3.7499790464134765`*^9, 3.749979049477071*^9}, {3.749982833100074*^9, 3.7499828333393407`*^9}, { 3.7499828751635275`*^9, 3.749982879868786*^9}, 3.749983817705352*^9, { 3.7499853445026526`*^9, 3.749985345414797*^9}, {3.7535276297998667`*^9, 3.7535276388705273`*^9}, 3.7535280758774443`*^9, {3.7536038103183403`*^9, 3.753603814447405*^9}, {3.75368464914781*^9, 3.75368466935645*^9}, 3.753684965464896*^9, {3.7536850961678476`*^9, 3.753685101927447*^9}, { 3.7537929268396006`*^9, 3.753792926983173*^9}, 3.7537935415823994`*^9, 3.753793626520288*^9, {3.754222426068798*^9, 3.754222427797409*^9}, { 3.7542225122974477`*^9, 3.7542225190721054`*^9}, 3.7542234821334295`*^9, { 3.7542255403803596`*^9, 3.7542255466268435`*^9}, {3.7542259312335033`*^9, 3.7542259327773857`*^9}, {3.7577934878368726`*^9, 3.7577934920166397`*^9}, {3.7577936787705307`*^9, 3.757793681266836*^9}, { 3.7580471209008207`*^9, 3.7580471455866537`*^9}, {3.7580472225915036`*^9, 3.7580472337841463`*^9}, 3.7580472938608694`*^9, {3.7580488293881903`*^9, 3.758048831590423*^9}, {3.758049801709608*^9, 3.758049804510497*^9}, { 3.7580502839894543`*^9, 3.758050323803483*^9}, {3.7580505584922905`*^9, 3.758050564986992*^9}, 3.758050612688388*^9, {3.7580517971523905`*^9, 3.758051801548682*^9}, {3.7580543735606112`*^9, 3.7580543746083956`*^9}, { 3.7580544623927317`*^9, 3.7580544662327228`*^9}, {3.758054513989504*^9, 3.758054514686725*^9}, {3.7580547341641593`*^9, 3.758054736893756*^9}, { 3.760384813102412*^9, 3.7603848135920687`*^9}, {3.760384862184715*^9, 3.760384862731246*^9}, {3.7603849613793244`*^9, 3.7603849619169245`*^9}, { 3.760385130055154*^9, 3.7603851322632155`*^9}, {3.760385206899543*^9, 3.7603852099354386`*^9}, {3.760386234906005*^9, 3.760386235727845*^9}, { 3.760387959242777*^9, 3.7603879612264595`*^9}, {3.760391435731744*^9, 3.76039143738583*^9}, 3.7603925365342903`*^9, {3.76044974491711*^9, 3.7604497553959618`*^9}, {3.760453577749151*^9, 3.760453579292432*^9}, { 3.760453610164253*^9, 3.7604536483798857`*^9}, {3.760454098049994*^9, 3.760454099873564*^9}, {3.7604541892905407`*^9, 3.7604541919375772`*^9}, 3.760454888197476*^9, 3.7604551102930937`*^9, 3.7604556535399933`*^9, 3.760456041458219*^9, {3.7604561888087597`*^9, 3.760456204623962*^9}, { 3.7604715448736954`*^9, 3.760471546236084*^9}, {3.760472545421132*^9, 3.760472545977127*^9}, {3.760472646217716*^9, 3.7604726474628735`*^9}, 3.76047742397609*^9, {3.7604775336118665`*^9, 3.7604775343029785`*^9}, { 3.760477598374628*^9, 3.760477602381877*^9}, 3.764301641685611*^9, { 3.764474651420169*^9, 3.764474689839425*^9}, 3.7645936316193943`*^9, 3.768712840484685*^9, 3.7849125576087265`*^9, {3.7849138983590136`*^9, 3.7849139003828354`*^9}, {3.784915457395995*^9, 3.784915459039815*^9}, { 3.785042735967092*^9, 3.785042806648767*^9}, {3.785042897627165*^9, 3.7850428985693207`*^9}, {3.7850429289977093`*^9, 3.7850429885741568`*^9}, {3.7850435404583473`*^9, 3.785043557900482*^9}, { 3.78504363260196*^9, 3.7850436329845867`*^9}, {3.7850441983864813`*^9, 3.785044199560014*^9}, {3.7850443287058487`*^9, 3.785044331855242*^9}, { 3.7850446857740192`*^9, 3.78504468780606*^9}, {3.785044759262548*^9, 3.785044763066691*^9}, {3.785044889423337*^9, 3.7850448956588917`*^9}, { 3.785045058563389*^9, 3.7850450624133177`*^9}, {3.78504515547069*^9, 3.7850451619488163`*^9}, {3.785045911357325*^9, 3.7850459559291983`*^9}, { 3.7850460606052237`*^9, 3.785046066089663*^9}, {3.785053302535205*^9, 3.785053304856895*^9}, 3.785475568404909*^9, 3.785475813039476*^9, { 3.785476374351667*^9, 3.785476396007793*^9}, {3.785476503507984*^9, 3.785476507203307*^9}, {3.785476574692485*^9, 3.7854766107072487`*^9}, 3.7854767311878557`*^9, {3.7854857226075363`*^9, 3.785485754828389*^9}, { 3.785485895088513*^9, 3.785485922780839*^9}, 3.7854859647216177`*^9, { 3.785491333342083*^9, 3.785491336089031*^9}, 3.785566795165312*^9, { 3.7855671552938137`*^9, 3.785567158010968*^9}, 3.785567193663268*^9, { 3.7941145588733263`*^9, 3.794114570198476*^9}, {3.7941153689808035`*^9, 3.7941154082780557`*^9}, {3.79411643358989*^9, 3.7941164363362513`*^9}, { 3.7941191618188725`*^9, 3.7941191625539465`*^9}, {3.794120722426812*^9, 3.794120723196542*^9}, {3.7941213148543215`*^9, 3.7941213354951334`*^9}, 3.7942179029468765`*^9},ExpressionUUID->"cb7e7ff3-8324-4856-bdcf-\ 74272f9f57f1"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Parameters to be chosen for each case", FontColor->GrayLevel[0]]], "Subsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.6651338492463503`*^9, 3.665133857139964*^9}, {3.749205761446435*^9, 3.749205764084938*^9}, 3.7942167544281855`*^9, {3.794216860322242*^9, 3.794216926761042*^9}},ExpressionUUID->"9e7a2df9-58c0-48c3-8756-\ fa1a3035c945"], Cell[CellGroupData[{ Cell["Parameters for the reference case", "Subsubsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.665133967452758*^9, 3.6651339701359625`*^9}, {3.665134023660657*^9, 3.6651340330684733`*^9}, {3.6667025246225395`*^9, 3.66670252620014*^9}, { 3.6696084345805264`*^9, 3.6696084396845264`*^9}, {3.669722174801526*^9, 3.6697221755215263`*^9}, {3.6697230768615265`*^9, 3.6697230782855263`*^9}, {3.671538352119651*^9, 3.671538389247716*^9}, { 3.748942741906986*^9, 3.748942743246744*^9}, {3.7850431047129593`*^9, 3.7850431298636637`*^9}, 3.785043474054625*^9, {3.785049949653283*^9, 3.7850499577176123`*^9}, {3.7855669988419743`*^9, 3.7855670025861397`*^9}, {3.794123906519885*^9, 3.794123912594012*^9}, { 3.7942166324992113`*^9, 3.794216632756226*^9}},ExpressionUUID->"4a970245-cf05-44b8-aa03-\ 77a3012a24f8"], Cell[BoxData[{ RowBox[{ RowBox[{"robustness", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"refcases", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"reproductionref", "=", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"locinumber", "=", RowBox[{"locinb", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"mutationalparameters", "=", RowBox[{ "mutationmodel", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"flowerproduction", "=", RowBox[{ "flowerperplant", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"individualschedule", "=", RowBox[{ "individualphenology", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"choosecases", "=", RowBox[{"Range", "[", "5", "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.78504704814501*^9, 3.785047056607325*^9}, { 3.785047100320633*^9, 3.785047151409987*^9}, {3.785047512546039*^9, 3.7850475571859417`*^9}, {3.785049883489129*^9, 3.785049905011891*^9}, 3.785050066148785*^9, {3.785567197901252*^9, 3.785567198094214*^9}},ExpressionUUID->"dd0f4677-952e-417d-b09a-\ 65b797963410"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Parameters for robustness to the strength of assortative mating \ \>", "Subsubsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.665133967452758*^9, 3.6651339701359625`*^9}, {3.665134023660657*^9, 3.6651340330684733`*^9}, {3.6667025246225395`*^9, 3.66670252620014*^9}, { 3.6696084345805264`*^9, 3.6696084396845264`*^9}, {3.669722174801526*^9, 3.6697221755215263`*^9}, {3.6697230768615265`*^9, 3.6697230782855263`*^9}, {3.671538352119651*^9, 3.671538389247716*^9}, { 3.748942741906986*^9, 3.748942743246744*^9}, {3.7850431047129593`*^9, 3.7850431298636637`*^9}, 3.785043474054625*^9, {3.785049949653283*^9, 3.7850499577176123`*^9}, {3.785500930305005*^9, 3.785500936032588*^9}, { 3.785567009018305*^9, 3.785567013385899*^9}, {3.794117202751504*^9, 3.7941172078149023`*^9}, {3.794117625502664*^9, 3.7941176567201986`*^9}, 3.7941239039400434`*^9, {3.794216628677993*^9, 3.794216628947008*^9}},ExpressionUUID->"038c0681-ad9f-4f4f-8f73-\ 5e4d328fd456"], Cell[BoxData[{ RowBox[{ RowBox[{"robustness", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"refcases", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"reproductionref", "=", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"locinumber", "=", RowBox[{"locinb", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"mutationalparameters", "=", RowBox[{ "mutationmodel", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"flowerproduction", "=", RowBox[{ "flowerperplant", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ";", RowBox[{"individualschedule", "=", RowBox[{ "individualphenology", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"choosecases", "=", RowBox[{"Range", "[", "5", "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.78504704814501*^9, 3.785047056607325*^9}, { 3.785047100320633*^9, 3.785047151409987*^9}, {3.785047512546039*^9, 3.7850475571859417`*^9}, {3.785049883489129*^9, 3.785049905011891*^9}, 3.785050066148785*^9, {3.785492803352664*^9, 3.785492808775753*^9}, { 3.785492901784524*^9, 3.785492916392014*^9}, {3.785567062525728*^9, 3.785567103674604*^9}, 3.815197442788885*^9},ExpressionUUID->"c182571e-717e-4c28-a1ec-\ 09bc6d91478d"] }, Closed]], Cell[CellGroupData[{ Cell["Parameters for robustness to the number of loci ", "Subsubsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.665133967452758*^9, 3.6651339701359625`*^9}, {3.665134023660657*^9, 3.6651340330684733`*^9}, {3.6667025246225395`*^9, 3.66670252620014*^9}, { 3.6696084345805264`*^9, 3.6696084396845264`*^9}, {3.669722174801526*^9, 3.6697221755215263`*^9}, {3.6697230768615265`*^9, 3.6697230782855263`*^9}, {3.671538352119651*^9, 3.671538389247716*^9}, { 3.748942741906986*^9, 3.748942743246744*^9}, {3.7850431047129593`*^9, 3.7850431298636637`*^9}, 3.785043474054625*^9, {3.785049949653283*^9, 3.7850499577176123`*^9}, {3.785500930305005*^9, 3.785500936032588*^9}, { 3.785567009018305*^9, 3.785567013385899*^9}, {3.7941171822083473`*^9, 3.7941172136873302`*^9}, 3.7941176310063605`*^9, {3.794117664269121*^9, 3.7941176735042477`*^9}, {3.794216635307372*^9, 3.794216635715395*^9}},ExpressionUUID->"038c0681-ad9f-4f4f-8f73-\ 5e4d328fd456"], Cell[BoxData[{ RowBox[{ RowBox[{"robustness", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"refcases", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"reproductionref", "=", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"locinumber", "=", RowBox[{"locinb", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ";", RowBox[{"mutationalparameters", "=", RowBox[{ "mutationmodel", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"flowerproduction", "=", RowBox[{ "flowerperplant", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"individualschedule", "=", RowBox[{ "individualphenology", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"choosecases", "=", RowBox[{"Range", "[", "5", "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.78504704814501*^9, 3.785047056607325*^9}, { 3.785047100320633*^9, 3.785047151409987*^9}, {3.785047512546039*^9, 3.7850475571859417`*^9}, {3.785049883489129*^9, 3.785049905011891*^9}, 3.785050066148785*^9, {3.785492803352664*^9, 3.785492808775753*^9}, { 3.785492901784524*^9, 3.785492916392014*^9}, {3.785567062525728*^9, 3.785567103674604*^9}, {3.7941172176390123`*^9, 3.794117237093232*^9}, 3.815197453346633*^9},ExpressionUUID->"c182571e-717e-4c28-a1ec-\ 09bc6d91478d"] }, Closed]], Cell[CellGroupData[{ Cell["Parameters for robustness to the intensity of selection", \ "Subsubsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.665133967452758*^9, 3.6651339701359625`*^9}, {3.665134023660657*^9, 3.6651340330684733`*^9}, {3.6667025246225395`*^9, 3.66670252620014*^9}, { 3.6696084345805264`*^9, 3.6696084396845264`*^9}, {3.669722174801526*^9, 3.6697221755215263`*^9}, {3.6697230768615265`*^9, 3.6697230782855263`*^9}, {3.671538352119651*^9, 3.671538389247716*^9}, { 3.748942741906986*^9, 3.748942743246744*^9}, {3.7850431047129593`*^9, 3.7850431298636637`*^9}, 3.785043474054625*^9, {3.785049949653283*^9, 3.7850499577176123`*^9}, {3.785500930305005*^9, 3.785500936032588*^9}, { 3.785567009018305*^9, 3.785567013385899*^9}, {3.7941171822083473`*^9, 3.7941172136873302`*^9}, {3.794117669550171*^9, 3.7941176885761623`*^9}, { 3.794216638723567*^9, 3.79421664593898*^9}},ExpressionUUID->"038c0681-ad9f-4f4f-8f73-\ 5e4d328fd456"], Cell[BoxData[{ RowBox[{ RowBox[{"robustness", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"refcases", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"reproductionref", "=", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"locinumber", "=", RowBox[{"locinb", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"mutationalparameters", "=", RowBox[{ "mutationmodel", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"flowerproduction", "=", RowBox[{ "flowerperplant", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"individualschedule", "=", RowBox[{ "individualphenology", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"choosecases", "=", RowBox[{"Range", "[", "5", "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.78504704814501*^9, 3.785047056607325*^9}, { 3.785047100320633*^9, 3.785047151409987*^9}, {3.785047512546039*^9, 3.7850475571859417`*^9}, {3.785049883489129*^9, 3.785049905011891*^9}, 3.785050066148785*^9, {3.785492803352664*^9, 3.785492808775753*^9}, { 3.785492901784524*^9, 3.785492916392014*^9}, {3.785567062525728*^9, 3.785567103674604*^9}, {3.7941172176390123`*^9, 3.794117237093232*^9}, { 3.794117692030158*^9, 3.7941177025961514`*^9}, 3.815197470217492*^9},ExpressionUUID->"c182571e-717e-4c28-a1ec-\ 09bc6d91478d"] }, Closed]], Cell[CellGroupData[{ Cell["Parameters for robustness to the mutational process", "Subsubsection", CellChangeTimes->{{3.665133673821042*^9, 3.6651337760032215`*^9}, { 3.665133967452758*^9, 3.6651339701359625`*^9}, {3.665134023660657*^9, 3.6651340330684733`*^9}, {3.6667025246225395`*^9, 3.66670252620014*^9}, { 3.6696084345805264`*^9, 3.6696084396845264`*^9}, {3.669722174801526*^9, 3.6697221755215263`*^9}, {3.6697230768615265`*^9, 3.6697230782855263`*^9}, {3.671538352119651*^9, 3.671538389247716*^9}, { 3.748942741906986*^9, 3.748942743246744*^9}, {3.7850431047129593`*^9, 3.7850431298636637`*^9}, 3.785043474054625*^9, {3.785049949653283*^9, 3.7850499577176123`*^9}, {3.785500930305005*^9, 3.785500936032588*^9}, { 3.785567009018305*^9, 3.785567013385899*^9}, {3.7941171822083473`*^9, 3.7941172136873302`*^9}, {3.794117669550171*^9, 3.7941176885761623`*^9}, { 3.794117729212926*^9, 3.794117733175383*^9}, {3.7942166491071615`*^9, 3.794216649419179*^9}},ExpressionUUID->"038c0681-ad9f-4f4f-8f73-\ 5e4d328fd456"], Cell[BoxData[{ RowBox[{ RowBox[{"robustness", "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"refcases", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"reproductionref", "=", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"locinumber", "=", RowBox[{"locinb", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ";", RowBox[{"mutationalparameters", "=", RowBox[{ "mutationmodel", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ";", RowBox[{"flowerproduction", "=", RowBox[{ "flowerperplant", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";", RowBox[{"individualschedule", "=", RowBox[{ "individualphenology", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"choosecases", "=", RowBox[{"Range", "[", "5", "]"}]}], ";"}]}], "Input", CellChangeTimes->{{3.78504704814501*^9, 3.785047056607325*^9}, { 3.785047100320633*^9, 3.785047151409987*^9}, {3.785047512546039*^9, 3.7850475571859417`*^9}, {3.785049883489129*^9, 3.785049905011891*^9}, 3.785050066148785*^9, {3.785492803352664*^9, 3.785492808775753*^9}, { 3.785492901784524*^9, 3.785492916392014*^9}, {3.785567062525728*^9, 3.785567103674604*^9}, {3.7941172176390123`*^9, 3.794117237093232*^9}, { 3.794117692030158*^9, 3.7941177025961514`*^9}, {3.794117736230553*^9, 3.7941177424268417`*^9}, 3.815197480926823*^9},ExpressionUUID->"c182571e-717e-4c28-a1ec-\ 09bc6d91478d"] }, Closed]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Run simulations", Background->None]], "Section", CellChangeTimes->{{3.665134097998788*^9, 3.6651341014931936`*^9}, { 3.665325653970561*^9, 3.6653256608495607`*^9}, {3.665325937537561*^9, 3.6653259396175613`*^9}, {3.665481086818561*^9, 3.6654811121905613`*^9}, { 3.665481193577561*^9, 3.665481193978561*^9}, {3.6665859040461416`*^9, 3.666585906109142*^9}, {3.6665910416241417`*^9, 3.6665910417681417`*^9}, { 3.6666033433221416`*^9, 3.666603346410142*^9}, {3.667743851632128*^9, 3.667743852271728*^9}, {3.669606600990526*^9, 3.669606608141526*^9}, { 3.6697221724015265`*^9, 3.6697221731535263`*^9}, {3.6697230748305264`*^9, 3.6697230841575265`*^9}, {3.6707589666307335`*^9, 3.6707589672703333`*^9}, {3.670758999312733*^9, 3.670758999546733*^9}, 3.670759171536733*^9, {3.6707599610527334`*^9, 3.670759977760333*^9}, { 3.670760055385933*^9, 3.670760056384333*^9}, 3.6709295282759333`*^9, 3.6709296452915335`*^9, {3.6710232837077656`*^9, 3.671023315110562*^9}, { 3.6710280409527717`*^9, 3.671028042918375*^9}, {3.6710744544218197`*^9, 3.6710744580930295`*^9}, {3.671295951946676*^9, 3.6712959586234875`*^9}, { 3.7492941302332478`*^9, 3.749294131365312*^9}, {3.7492994954552345`*^9, 3.7492994982795615`*^9}, {3.7493001087227335`*^9, 3.7493001101952953`*^9}, {3.749300236466891*^9, 3.7493002395080233`*^9}, { 3.7493006069823446`*^9, 3.7493006171077332`*^9}, {3.7494687690912056`*^9, 3.749468798451666*^9}, {3.7494689408016453`*^9, 3.7494689474889207`*^9}, { 3.753786664320077*^9, 3.753786676209991*^9}, {3.7542226190275326`*^9, 3.7542226505305405`*^9}, {3.754223347832672*^9, 3.7542233752850156`*^9}, { 3.754223448976694*^9, 3.7542234511471405`*^9}, {3.75804699006446*^9, 3.758047010766096*^9}, {3.758047241604327*^9, 3.7580472418611727`*^9}, { 3.758054532353079*^9, 3.7580545330493946`*^9}, {3.7601087408995423`*^9, 3.760108752376873*^9}, {3.7601485134186335`*^9, 3.7601485166902437`*^9}, { 3.7601485573080144`*^9, 3.760148583518982*^9}, {3.7601486598578506`*^9, 3.7601486605151024`*^9}, {3.7601974744378853`*^9, 3.760197476569803*^9}, { 3.760391738798439*^9, 3.7603917427001963`*^9}, {3.76045605100177*^9, 3.760456068337573*^9}, {3.760471437006361*^9, 3.760471471750039*^9}, { 3.760481801153389*^9, 3.7604818024605746`*^9}, 3.760481839467579*^9, { 3.7604818704769955`*^9, 3.76048187149382*^9}, 3.7604819101545353`*^9, { 3.7604819409567423`*^9, 3.760481941224*^9}, {3.7604819737822995`*^9, 3.760481974006692*^9}, {3.7644746191757326`*^9, 3.76447461965545*^9}, { 3.7644749823422523`*^9, 3.7644749825516925`*^9}, 3.764477040877225*^9, { 3.78505003959067*^9, 3.785050042133733*^9}, {3.7942164867978773`*^9, 3.794216508820137*^9}},ExpressionUUID->"0d40be68-f6ab-405d-b932-\ b1d086c64fa9"], Cell[BoxData[ RowBox[{"(*", RowBox[{ RowBox[{ "Makes", " ", "a", " ", "number", " ", "of", " ", "checks", " ", "on", " ", "the", " ", "parameter", " ", "values", " ", "and", " ", "scenario", " ", "run", " ", "before", " ", "starting", " ", "the", " ", "simulations"}], ",", " ", RowBox[{ "loops", " ", "on", " ", "the", " ", "scenarios", " ", "tested", " ", "for", " ", "both", " ", "mating", " ", "patterns"}], ",", " ", RowBox[{ "saves", " ", "files", " ", "desribing", " ", "the", " ", "scenarios", " ", "run"}]}], "*)"}]], "Input", CellChangeTimes->{{3.819604465563341*^9, 3.819604542832761*^9}, { 3.8196045931216373`*^9, 3.8196046079844875`*^9}},ExpressionUUID->"eef73e5b-f59f-463f-97dc-\ 0b649d4b81ee"], Cell[BoxData[ RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"k", "=", "1"}], ",", RowBox[{"k", "\[LessEqual]", RowBox[{ RowBox[{"Dimensions", "[", "choosecases", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ",", RowBox[{"k", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"case", "=", RowBox[{"refcases", "\[LeftDoubleBracket]", RowBox[{ "choosecases", "\[LeftDoubleBracket]", "k", "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "==", "\"\\""}], ",", RowBox[{"nbgenerations", "=", RowBox[{ "stop", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}]}], ",", RowBox[{"nbgenerations", "=", RowBox[{ "stop", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "==", "\"\\""}], ",", RowBox[{"selectionvalues", "=", RowBox[{"{", RowBox[{"selectionwidth", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"Dimensions", "[", "selectionwidth", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "}"}]}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}]}], ",", RowBox[{"selectionvalues", "=", RowBox[{"{", RowBox[{ "selectionwidth", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "}"}]}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}]}], ",", RowBox[{"selectionvalues", "=", RowBox[{"selectionwidth", "\[LeftDoubleBracket]", RowBox[{"1", ";;", RowBox[{ RowBox[{ RowBox[{"Dimensions", "[", "selectionwidth", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "-", "1"}]}], "\[RightDoubleBracket]"}]}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}], "||", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "&&", RowBox[{"robustness", "\[Equal]", "\"\\""}]}]}], ",", RowBox[{"selectionvalues", "=", RowBox[{"{", RowBox[{ "selectionwidth", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "}"}]}], ",", RowBox[{"selectionvalues", "=", RowBox[{"{", RowBox[{ "selectionwidth", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "}"}]}]}], "]"}]}], "]"}]}], "]"}]}], "]"}], ";", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], "||", RowBox[{"case", "==", "\"\\""}]}], ",", RowBox[{"optimumspeed", "=", "optimumchange"}], ",", RowBox[{"optimumspeed", "=", RowBox[{"{", "0", "}"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], ",", RowBox[{"optimumvar", "=", "optimumfluct"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "==", "\"\\""}], ",", RowBox[{"optimumvar", "=", RowBox[{"{", RowBox[{ "optimumfluct", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], "}"}]}], ",", RowBox[{"optimumvar", "=", RowBox[{"{", "0", "}"}]}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", " ", RowBox[{ RowBox[{ RowBox[{"case", "==", "\"\\""}], "||", RowBox[{"case", "==", "\"\\""}]}], ",", RowBox[{"makenext", "=", "makeonegenerationnofluctuation"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"case", "==", "\"\\""}], "||", RowBox[{"case", "\[Equal]", "\"\\""}]}], ",", RowBox[{"makenext", "=", "makeonegenerationoptimumfluct"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "==", "\"\\""}], ",", RowBox[{"makenext", "=", "makeonegenerationdirectional"}], ",", RowBox[{ "Print", "[", "\"\\"", "]"}]}], "]"}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"mating", "=", "1"}], ",", RowBox[{"mating", "\[LessEqual]", RowBox[{ RowBox[{"Dimensions", "[", "reproductionref", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ",", RowBox[{"mating", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"reproduction", "=", RowBox[{ "reproductionref", "\[LeftDoubleBracket]", "mating", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"case", "==", "\"\\""}], "&&", RowBox[{"reproduction", "==", "\"\\""}]}], ",", RowBox[{"flowerselectionfunction", "=", "flowerrandomneutral"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"case", "==", "\"\\""}], "&&", RowBox[{ "reproduction", " ", "==", " ", "\"\\""}]}], ",", RowBox[{ "flowerselectionfunction", "=", "flowerassortativeneutral"}], ",", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"case", "!=", "\"\\""}], "&&", RowBox[{"reproduction", " ", "==", " ", "\"\\""}]}], ",", RowBox[{ "flowerselectionfunction", "=", "flowerrandomselection"}], ",", " ", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"case", "!=", "\"\\""}], "&&", RowBox[{ "reproduction", " ", "==", " ", "\"\\""}]}], ",", RowBox[{ "flowerselectionfunction", "=", "flowerassortativeselection"}], ",", RowBox[{ "flowerselectionfunction", "=", "flowerrandomfemaleselection"}]}], "]"}]}], "]"}]}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"omega", "=", "1"}], ",", RowBox[{"omega", "\[LessEqual]", RowBox[{ RowBox[{"Dimensions", "[", "selectionvalues", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ",", RowBox[{"omega", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"selectionintensity", "=", RowBox[{ "selectionvalues", "\[LeftDoubleBracket]", "omega", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"speed", "=", "1"}], ",", RowBox[{"speed", "\[LessEqual]", RowBox[{ RowBox[{"Dimensions", "[", "optimumspeed", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ",", RowBox[{"speed", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"optimummove", "=", RowBox[{ "optimumspeed", "\[LeftDoubleBracket]", "speed", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"sigma", "=", "1"}], ",", RowBox[{"sigma", "\[LessEqual]", RowBox[{ RowBox[{"Dimensions", "[", "optimumvar", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], ",", RowBox[{"sigma", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"optimumfluctuation", "=", RowBox[{ "optimumvar", "\[LeftDoubleBracket]", "sigma", "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"filenamesave", "=", RowBox[{ RowBox[{"StringTake", "[", RowBox[{"robustness", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"case", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"reproduction", ",", "1"}], "]"}], "<>", "\"\<_L\>\"", "<>", RowBox[{"ToString", "[", "locinumber", "]"}], "<>", "\"\<_width_\>\"", "<>", RowBox[{"ToString", "[", " ", "selectionintensity", "]"}], "<>", "\"\<_move_\>\"", "<>", RowBox[{"ToString", "[", "optimummove", "]"}], "<>", "\"\<_fluct_\>\"", "<>", RowBox[{"ToString", "[", "optimumfluctuation", "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"SetDirectory", "[", "\"\\"", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"CreateDirectory", "[", "filenamesave", "]"}], ";", "\[IndentingNewLine]", RowBox[{"SetDirectory", "[", "filenamesave", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Print", "[", "filenamesave", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"simulation", "=", "1"}], ",", RowBox[{"simulation", "\[LessEqual]", "nbsimulations"}], ",", " ", RowBox[{"simulation", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Print", "[", RowBox[{"ToString", "[", "simulation", "]"}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"extensionsave", "=", RowBox[{"filenamesave", "<>", "\"\<_S_\>\"", "<>", RowBox[{"ToString", "[", "simulation", "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"PutAppend", "[", RowBox[{ RowBox[{"{", RowBox[{ "case", ",", "reproduction", ",", "nbgenerations", ",", "popsize", ",", "locinumber", ",", "mutationalparameters", ",", "environmentalparameters", ",", "initialgenicvariance", ",", "flowerproduction", ",", "individualschedule", ",", RowBox[{"{", RowBox[{ "optimum", ",", "selectionintensity", ",", "optimummove", ",", "optimumfluctuation", ",", "stabilizingfluctuations"}], "}"}]}], "}"}], ",", RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "==", "\"\\""}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"alleles", "=", RowBox[{"individualsgametes", "[", RowBox[{ "initialgenicvariance", ",", "locinumber", ",", "popsize"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"genotypes", "=", RowBox[{"makeoffsprings", "[", RowBox[{ RowBox[{ "alleles", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{ "alleles", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], ",", "locinumber"}], "]"}]}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{"case", "\[Equal]", "\"\\""}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"SetDirectory", "[", RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"robustness", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"\"\\"", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"reproduction", ",", "1"}], "]"}], "<>", "\"\<_L\>\"", "<>", RowBox[{"ToString", "[", "locinumber", "]"}], "<>", "\"\<_width_\>\"", "<>", RowBox[{"ToString", "[", " ", "\"\\"", "]"}], "<>", "\"\<_move_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}], "<>", "\"\<_fluct_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"genotypes", "=", RowBox[{ RowBox[{"ReadList", "[", RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"robustness", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"\"\\"", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"reproduction", ",", "1"}], "]"}], "<>", "\"\<_L\>\"", "<>", RowBox[{"ToString", "[", "locinumber", "]"}], "<>", "\"\<_width_\>\"", "<>", RowBox[{"ToString", "[", " ", "\"\\"", "]"}], "<>", "\"\<_move_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}], "<>", "\"\<_fluct_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}], "<>", "\"\<_S_\>\"", "<>", RowBox[{"ToString", "[", "simulation", "]"}], "<>", "\"\<.txt\>\""}], "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"SetDirectory", "[", RowBox[{"SetDirectory", "[", RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"robustness", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"\"\\"", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"reproduction", ",", "1"}], "]"}], "<>", "\"\<_L\>\"", "<>", RowBox[{"ToString", "[", "locinumber", "]"}], "<>", "\"\<_width_\>\"", "<>", RowBox[{"ToString", "[", " ", "selectionintensity", "]"}], "<>", "\"\<_move_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}], "<>", "\"\<_fluct_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}]}], "]"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"genotypes", "=", RowBox[{ RowBox[{"ReadList", "[", RowBox[{"\"\\"", "<>", RowBox[{"StringTake", "[", RowBox[{"robustness", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"\"\\"", ",", "1"}], "]"}], "<>", "\"\<_\>\"", "<>", RowBox[{"StringTake", "[", RowBox[{"reproduction", ",", "1"}], "]"}], "<>", "\"\<_L\>\"", "<>", RowBox[{"ToString", "[", "locinumber", "]"}], "<>", "\"\<_width_\>\"", "<>", RowBox[{"ToString", "[", " ", "selectionintensity", "]"}], "<>", "\"\<_move_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}], "<>", "\"\<_fluct_\>\"", "<>", RowBox[{"ToString", "[", "\"\<0\>\"", "]"}], "<>", "\"\<_S_\>\"", "<>", RowBox[{"ToString", "[", "simulation", "]"}], "<>", "\"\<.txt\>\""}], "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}]}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ "SetDirectory", "[", "\"\\"", "]"}], ";", "\[IndentingNewLine]", RowBox[{"SetDirectory", "[", "filenamesave", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "make", " ", "phenotypes", " ", "for", " ", "the", " ", "first", " ", "generation", " ", "using", " ", "genoypes"}], "*)"}], "\[IndentingNewLine]", RowBox[{"effectsofenvironment", "=", RowBox[{"RandomReal", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{ "environmentalparameters", "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}], ",", RowBox[{"Sqrt", "[", RowBox[{ "environmentalparameters", "\[LeftDoubleBracket]", "2", "\[RightDoubleBracket]"}], "]"}]}], "]"}], ",", RowBox[{ RowBox[{"Dimensions", "[", "genotypes", "]"}], "\[LeftDoubleBracket]", "1", "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"popflowers", "=", RowBox[{"buildconstantphenology", "[", RowBox[{ RowBox[{ RowBox[{"Total", "[", RowBox[{"Transpose", "[", "genotypes", "]"}], "]"}], "+", "effectsofenvironment"}], ",", "individualschedule", ",", "flowerproduction"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "not", " ", "used", " ", "to", " ", "build", " ", "this", " ", "generation", " ", "but", " ", "necessary", " ", "for", " ", "starting", " ", "NestList", " ", "function"}], "*)"}], "\[IndentingNewLine]", RowBox[{"chosenflowers", "=", RowBox[{"{", RowBox[{ RowBox[{"Partition", "[", RowBox[{ RowBox[{"Riffle", "[", RowBox[{ RowBox[{"ConstantArray", "[", RowBox[{"1", ",", "popsize"}], "]"}], ",", RowBox[{"Range", "[", "popsize", "]"}]}], "]"}], ",", "2"}], "]"}], ",", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Riffle", "[", RowBox[{ RowBox[{"ConstantArray", "[", RowBox[{"1", ",", "popsize"}], "]"}], ",", RowBox[{"Range", "[", "popsize", "]"}]}], "]"}], ",", "2"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"optimumparam", "=", RowBox[{"{", RowBox[{"optimum", ",", "selectionintensity"}], "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"counter", "=", "1"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"All", " ", "other", " ", "generations"}], "*)"}], "\[IndentingNewLine]", RowBox[{"results", "=", RowBox[{"NestList", "[", RowBox[{ RowBox[{ RowBox[{"makenext", "[", RowBox[{ "#", ",", "environmentalparameters", ",", "mutationalparameters", ",", "individualschedule", ",", "flowerproduction", ",", "popsize", ",", "optimummove", ",", "optimumfluctuation", ",", "stabilizingfluctuations"}], "]"}], "&"}], ",", RowBox[{"{", RowBox[{ "genotypes", ",", "effectsofenvironment", ",", "popflowers", ",", "chosenflowers", ",", "optimumparam"}], "}"}], ",", RowBox[{"nbgenerations", "-", "1"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"currentgenotypes", "=", RowBox[{"results", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"currentenvironmentaleffects", "=", RowBox[{"results", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"popflowers", "=", " ", RowBox[{"results", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "3"}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"previousselectedflowers", " ", "=", " ", RowBox[{"results", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "4"}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", RowBox[{"currentoptimumparameters", " ", "=", " ", RowBox[{"results", "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "5"}], "\[RightDoubleBracket]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"PutAppend", "[", RowBox[{"currentoptimumparameters", ",", RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"statsforpop", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "nbgenerations", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"momentsforpop", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "nbgenerations", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"lag", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "nbgenerations", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"fitnessforpop", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "nbgenerations", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"phenotypicorrelation", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "nbgenerations", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"selfing", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "}"}], ",", RowBox[{"{", "nbgenerations", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"case", "==", "\"\\""}], ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Outputs", " ", "first", " ", "generation"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"g", "=", "1"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "statsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popstats", "[", RowBox[{ RowBox[{ "currentgenotypes", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"flowerproduction", "/", "2"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "momentsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popmoments", "[", RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "]"}]}], ";", RowBox[{ RowBox[{ "lag", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{ RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "-", RowBox[{"statsforpop", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}]}], "//", "N"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Outputs", " ", "all", " ", "other", " ", "generations"}], "*)"}], "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"g", "=", "2"}], ",", RowBox[{"g", "\[LessEqual]", RowBox[{"nbgenerations", "-", "1"}]}], ",", RowBox[{"g", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ "statsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popstats", "[", RowBox[{ RowBox[{ "currentgenotypes", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"flowerproduction", "/", "2"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "momentsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popmoments", "[", RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "]"}]}], ";", RowBox[{ RowBox[{ "lag", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{ RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "-", RowBox[{"statsforpop", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}]}], "//", "N"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}], "*", RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], "==", "0"}], ",", " ", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{"{", "}"}]}], ",", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{"Correlation", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}], "//", "N"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"selfing", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], " ", "=", RowBox[{ RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}]}], ",", "0"}], "]"}], "/", "popsize"}], "//", "N"}]}]}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"g", "=", "nbgenerations"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}], "*", RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], "==", "0"}], ",", " ", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{"{", "}"}]}], ",", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{"Correlation", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}], "//", "N"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"selfing", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], " ", "=", RowBox[{ RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}]}], ",", "0"}], "]"}], "/", "popsize"}], "//", "N"}]}], ";"}], "\[IndentingNewLine]", ",", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Outputs", " ", "first", " ", "generation"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"g", "=", "1"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "statsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popstats", "[", RowBox[{ RowBox[{ "currentgenotypes", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"flowerproduction", "/", "2"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "momentsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popmoments", "[", RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "]"}]}], ";", RowBox[{ RowBox[{ "lag", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{ RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "-", RowBox[{"statsforpop", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}]}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{"individualflowerfitness", "=", RowBox[{ RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{ RowBox[{"(", RowBox[{"#", "-", RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}]}], ")"}], "^", "2"}]}], "/", "2"}], "/", RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}]}], "]"}], "&"}], ",", RowBox[{ RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "fitnessforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", StyleBox[ RowBox[{"{", RowBox[{ RowBox[{"Mean", "[", RowBox[{"Flatten", "[", "individualflowerfitness", "]"}], "]"}], ",", RowBox[{"Variance", "[", RowBox[{"Flatten", "[", "individualflowerfitness", "]"}], "]"}]}], "}"}], FontColor->GrayLevel[0]]}], StyleBox[";", FontColor->GrayLevel[0]], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "Outputs", " ", "all", " ", "other", " ", "generations"}], "*)"}], "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"g", "=", "2"}], ",", RowBox[{"g", "\[LessEqual]", RowBox[{"nbgenerations", "-", "1"}]}], ",", RowBox[{"g", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ "statsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popstats", "[", RowBox[{ RowBox[{ "currentgenotypes", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"flowerproduction", "/", "2"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "momentsforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{"popmoments", "[", RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "]"}]}], ";", RowBox[{ RowBox[{ "lag", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{ RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "-", RowBox[{"statsforpop", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}]}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{"individualflowerfitness", "=", RowBox[{ RowBox[{"Map", "[", RowBox[{ RowBox[{ RowBox[{"Exp", "[", RowBox[{ RowBox[{ RowBox[{"-", RowBox[{ RowBox[{"(", RowBox[{"#", "-", RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}]}], ")"}], "^", "2"}]}], "/", "2"}], "/", RowBox[{ "currentoptimumparameters", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}]}], "]"}], "&"}], ",", RowBox[{ RowBox[{"popflowers", "\[LeftDoubleBracket]", RowBox[{"g", "+", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", RowBox[{"1", ";;"}], ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}], "//", "N"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{ "fitnessforpop", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "=", StyleBox[ RowBox[{"{", RowBox[{ RowBox[{"Mean", "[", RowBox[{"Flatten", "[", "individualflowerfitness", "]"}], "]"}], ",", RowBox[{"Variance", "[", RowBox[{"Flatten", "[", "individualflowerfitness", "]"}], "]"}]}], "}"}], FontColor->GrayLevel[0]]}], StyleBox[";", FontColor->GrayLevel[0]], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}], "*", RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], "==", "0"}], ",", " ", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{"{", "}"}]}], ",", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{"Correlation", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}], "//", "N"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"selfing", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], " ", "=", RowBox[{ RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}]}], ",", "0"}], "]"}], "/", "popsize"}], "//", "N"}]}]}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"g", "=", "nbgenerations"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}], "*", RowBox[{"StandardDeviation", "[", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], "]"}]}], "==", "0"}], ",", " ", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{"{", "}"}]}], ",", RowBox[{ RowBox[{"phenotypicorrelation", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], "=", RowBox[{ RowBox[{"Correlation", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}], ",", RowBox[{ RowBox[{ RowBox[{ "popflowers", "\[LeftDoubleBracket]", "g", "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "\[RightDoubleBracket]"}], "\[LeftDoubleBracket]", RowBox[{ RowBox[{"1", ";;"}], ",", "1", ",", "1"}], "\[RightDoubleBracket]"}]}], "]"}], "//", "N"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"selfing", "\[LeftDoubleBracket]", RowBox[{"g", "-", "1"}], "\[RightDoubleBracket]"}], " ", "=", RowBox[{ RowBox[{ RowBox[{"Count", "[", RowBox[{ RowBox[{ RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "1", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}], "-", RowBox[{"previousselectedflowers", "\[LeftDoubleBracket]", RowBox[{"g", ",", "2", ",", RowBox[{"1", ";;"}], ",", "2"}], "\[RightDoubleBracket]"}]}], ",", "0"}], "]"}], "/", "popsize"}], "//", "N"}]}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"PutAppend", "[", RowBox[{"statsforpop", ",", RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"PutAppend", "[", RowBox[{"momentsforpop", ",", RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{ StyleBox["PutAppend", FontColor->GrayLevel[0]], StyleBox["[", FontColor->GrayLevel[0]], RowBox[{"lag", StyleBox[",", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}], FontColor->GrayLevel[0]]}], StyleBox["]", FontColor->GrayLevel[0]]}], StyleBox[";", FontColor->GrayLevel[0]], StyleBox["\[IndentingNewLine]", FontColor->GrayLevel[0]], RowBox[{ StyleBox["PutAppend", FontColor->GrayLevel[0]], StyleBox["[", FontColor->GrayLevel[0]], RowBox[{"selfing", StyleBox[",", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}], FontColor->GrayLevel[0]]}], StyleBox["]", FontColor->GrayLevel[0]]}], StyleBox[";", FontColor->GrayLevel[0]], "\[IndentingNewLine]", RowBox[{ StyleBox["PutAppend", FontColor->GrayLevel[0]], StyleBox["[", FontColor->GrayLevel[0]], RowBox[{"fitnessforpop", StyleBox[",", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}], FontColor->GrayLevel[0]]}], StyleBox["]", FontColor->GrayLevel[0]]}], StyleBox[";", FontColor->GrayLevel[0]], "\[IndentingNewLine]", StyleBox[ RowBox[{"PutAppend", "[", RowBox[{"phenotypicorrelation", ",", RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "extensionsave", "]"}], "<>", "\"\<.txt\>\""}]}], "]"}], FontColor->GrayLevel[0]], StyleBox[";", FontColor->GrayLevel[0]], "\[IndentingNewLine]", StyleBox["\[IndentingNewLine]", FontColor->GrayLevel[0]], RowBox[{"PutAppend", "[", RowBox[{ RowBox[{ "currentgenotypes", "\[LeftDoubleBracket]", "nbgenerations", "\[RightDoubleBracket]"}], ",", RowBox[{"\"\\"", StyleBox["<>", FontColor->GrayLevel[0]], StyleBox[ RowBox[{"ToString", "[", "extensionsave", "]"}], FontColor->GrayLevel[0]], StyleBox["<>", FontColor->GrayLevel[0]], StyleBox["\"\<.txt\>\"", FontColor->GrayLevel[0]]}]}], StyleBox["]", FontColor->GrayLevel[0]]}], StyleBox[";", FontColor->GrayLevel[0]]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"end", " ", "of", " ", "simulations"}], "*)"}], "]"}], ";"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "end", " ", "of", " ", "random", " ", "fluctuations", " ", "on", " ", "optimum"}], "*)"}], "]"}], ";"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "end", " ", "of", " ", "optimum", " ", "change", " ", "per", " ", "generation"}], "*)"}], "]"}], ";"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ "end", " ", "of", " ", "intensity", " ", "of", " ", "stabilizing", " ", "selection"}], "*)"}], "]"}], ";"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"end", " ", "of", " ", "mating"}], "*)"}], "]"}], ";"}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"end", " ", "of", " ", "case"}], "*)"}], "]"}], ";"}]], "Input", CellChangeTimes->{{3.78505006844269*^9, 3.785050187417406*^9}, { 3.785050243369995*^9, 3.785050284500738*^9}, {3.785050407877986*^9, 3.785050556274613*^9}, 3.785050619670001*^9, {3.78505065355521*^9, 3.7850509982470703`*^9}, {3.7850510490270977`*^9, 3.785051066852529*^9}, { 3.7850513210294*^9, 3.785051332939172*^9}, {3.785051372256113*^9, 3.7850513910259247`*^9}, {3.785051438135379*^9, 3.785051462303336*^9}, { 3.7850514985016413`*^9, 3.785051501103489*^9}, {3.785051552183639*^9, 3.7850516004898167`*^9}, {3.7850516518228483`*^9, 3.785051921583997*^9}, { 3.785051960162767*^9, 3.785051987452547*^9}, {3.785052027420306*^9, 3.7850521988132153`*^9}, 3.785052232382551*^9, {3.785052272207171*^9, 3.785052375917692*^9}, {3.785052465583243*^9, 3.7850526061220083`*^9}, { 3.785052658430011*^9, 3.7850527492142763`*^9}, {3.7850528000656*^9, 3.785052905203062*^9}, {3.785052939105851*^9, 3.785052960195217*^9}, { 3.785053010193815*^9, 3.785053069146873*^9}, {3.785053138698483*^9, 3.785053141164761*^9}, {3.78505317193193*^9, 3.7850532226093283`*^9}, { 3.7850532606386642`*^9, 3.785053290797817*^9}, 3.7850533426879663`*^9, 3.785475851175268*^9, {3.785476138674568*^9, 3.785476236949841*^9}, { 3.785476477995088*^9, 3.78547649396812*^9}, {3.785476527526112*^9, 3.785476543174436*^9}, {3.785476624108231*^9, 3.78547663527731*^9}, 3.785476724272574*^9, {3.785476769410214*^9, 3.785476789069296*^9}, 3.785476835825333*^9, {3.7854769208667583`*^9, 3.7854769281412973`*^9}, { 3.785476970015463*^9, 3.785476987839518*^9}, 3.785477068191427*^9, { 3.7854825268268948`*^9, 3.785482549523233*^9}, {3.785483521653577*^9, 3.785483533957988*^9}, {3.785483571955804*^9, 3.785483633349081*^9}, 3.78548366699829*^9, {3.7854837386304092`*^9, 3.78548376595816*^9}, { 3.7854838809192667`*^9, 3.7854839733818493`*^9}, {3.785484015828122*^9, 3.785484018647298*^9}, {3.785484290298698*^9, 3.785484362899824*^9}, { 3.785484400071473*^9, 3.785484460842819*^9}, {3.785484496171503*^9, 3.7854845181193647`*^9}, {3.785484557733041*^9, 3.785484571555475*^9}, { 3.785484819099235*^9, 3.785484828353785*^9}, {3.785484865756359*^9, 3.7854849017825003`*^9}, {3.785484957061389*^9, 3.7854849596069403`*^9}, { 3.785485320504662*^9, 3.785485394241766*^9}, {3.78548545651119*^9, 3.785485490831746*^9}, {3.785491359016272*^9, 3.785491359419815*^9}, { 3.7854913950149813`*^9, 3.785491397582115*^9}, {3.785491473648283*^9, 3.785491473821034*^9}, {3.785492016286706*^9, 3.78549201892381*^9}, { 3.7854926130694313`*^9, 3.785492649398617*^9}, {3.785492688814611*^9, 3.785492696957974*^9}, {3.78549294353942*^9, 3.7854929595719023`*^9}, { 3.7855664458900414`*^9, 3.7855665477315474`*^9}, {3.785567115155032*^9, 3.785567136228421*^9}, {3.7941143870885143`*^9, 3.794114414844554*^9}, { 3.7941146042330847`*^9, 3.7941146607474847`*^9}, {3.7941147783933573`*^9, 3.7941147814144363`*^9}, 3.794116328115239*^9, {3.794116773511911*^9, 3.794116776384737*^9}, {3.794118333152481*^9, 3.7941183397510953`*^9}, 3.79411923015942*^9, {3.7941194200970063`*^9, 3.794119432530059*^9}, { 3.7941212151929626`*^9, 3.794121243852753*^9}, {3.8192880526859093`*^9, 3.8192880841308517`*^9}, {3.819604584089121*^9, 3.819604584182126*^9}, 3.8196046294547157`*^9},ExpressionUUID->"7bb9a4c9-3d31-467e-9045-\ fd8d2a1301e5"] }, Closed]] }, WindowSize->{1920, 976}, WindowMargins->{{-9, Automatic}, {Automatic, -9}}, PrivateNotebookOptions->{"VersionedStylesheet"->{"Default.nb"[8.] -> False}}, Magnification:>1.3 Inherited, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (July 28, 2016)", StyleDefinitions->Notebook[{ Cell[ StyleData[ StyleDefinitions -> FrontEnd`FileName[{"Report"}, "StandardReport.nb", CharacterEncoding -> "UTF-8"]]], Cell[ StyleData["Subsection"], FontFamily -> "Source Sans Pro", FontSize -> 20, FontWeight -> "Plain", FontSlant -> "Plain", FontVariations -> {"StrikeThrough" -> False, "Underline" -> False}, FontColor -> RGBColor[0., 0., 0.]], Cell[ StyleData["Subsection"]], Cell[ StyleData["Subsubsection"], FontColor -> GrayLevel[0]], Cell[ StyleData["Section"], FontColor -> GrayLevel[0]], Cell[ StyleData[All]]}, Visible -> False, FrontEndVersion -> "11.0 for Microsoft Windows (64-bit) (July 28, 2016)", StyleDefinitions -> "PrivateStylesheetFormatting.nb"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1510, 35, 227, 4, 93, "Section"], Cell[CellGroupData[{ Cell[1762, 43, 536, 8, 43, "Subsection"], Cell[2301, 53, 6060, 125, 277, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8398, 183, 496, 7, 42, "Subsection"], Cell[8897, 192, 5566, 119, 252, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14500, 316, 635, 9, 42, "Subsection"], Cell[15138, 327, 3242, 71, 277, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[18417, 403, 467, 7, 42, "Subsection"], Cell[18887, 412, 3670, 73, 352, "Input"], Cell[CellGroupData[{ Cell[22582, 489, 336, 5, 44, "Subsubsection"], Cell[22921, 496, 6302, 119, 252, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[29260, 620, 393, 6, 44, "Subsubsection"], Cell[29656, 628, 7038, 159, 452, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[36731, 792, 336, 5, 44, "Subsubsection"], Cell[37070, 799, 1125, 28, 177, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[38232, 832, 392, 6, 44, "Subsubsection"], Cell[38627, 840, 4602, 113, 402, "Input"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[43278, 959, 346, 5, 42, "Subsection"], Cell[CellGroupData[{ Cell[43649, 968, 186, 3, 44, "Subsubsection"], Cell[43838, 973, 3775, 77, 152, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[47650, 1055, 217, 4, 43, "Subsubsection"], Cell[47870, 1061, 4565, 93, 352, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[52472, 1159, 166, 3, 43, "Subsubsection"], Cell[52641, 1164, 5819, 128, 370, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[58497, 1297, 161, 3, 43, "Subsubsection"], Cell[58661, 1302, 7650, 162, 502, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[66348, 1469, 192, 3, 43, "Subsubsection"], Cell[66543, 1474, 3441, 66, 127, "Input"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[70033, 1546, 542, 8, 43, "Subsection"], Cell[70578, 1556, 6599, 136, 552, "Input"], Cell[CellGroupData[{ Cell[77202, 1696, 332, 7, 44, "Subsubsection"], Cell[77537, 1705, 7805, 145, 502, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[85379, 1855, 374, 7, 43, "Subsubsection"], Cell[85756, 1864, 4854, 105, 502, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[90647, 1974, 370, 7, 43, "Subsubsection"], Cell[91020, 1983, 5623, 119, 527, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[96680, 2107, 368, 7, 43, "Subsubsection"], Cell[97051, 2116, 6284, 132, 502, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[103384, 2254, 412, 6, 42, "Subsection"], Cell[CellGroupData[{ Cell[103821, 2264, 207, 3, 44, "Subsubsection"], Cell[104031, 2269, 15309, 319, 802, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[119377, 2593, 328, 7, 43, "Subsubsection"], Cell[119708, 2602, 4602, 107, 402, "Input"] }, Closed]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[124371, 2716, 2799, 38, 93, "Section"], Cell[CellGroupData[{ Cell[127195, 2758, 401, 6, 43, "Subsection"], Cell[CellGroupData[{ Cell[127621, 2768, 191, 3, 44, "Subsubsection"], Cell[127815, 2773, 15599, 220, 102, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[143451, 2998, 248, 4, 43, "Subsubsection"], Cell[143702, 3004, 15600, 227, 127, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[159339, 3236, 196, 3, 43, "Subsubsection"], Cell[159538, 3241, 16471, 247, 102, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[176046, 3493, 242, 4, 43, "Subsubsection"], Cell[176291, 3499, 15747, 227, 177, "Input"] }, Closed]] }, Open ]], Cell[CellGroupData[{ Cell[192087, 3732, 406, 6, 43, "Subsection"], Cell[CellGroupData[{ Cell[192518, 3742, 874, 13, 44, "Subsubsection"], Cell[193395, 3757, 1548, 40, 152, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[194980, 3802, 1031, 16, 43, "Subsubsection"], Cell[196014, 3820, 1676, 42, 152, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[197727, 3867, 1009, 14, 43, "Subsubsection"], Cell[198739, 3883, 1719, 42, 152, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[200495, 3930, 993, 15, 43, "Subsubsection"], Cell[201491, 3947, 1763, 42, 152, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[203291, 3994, 1036, 14, 43, "Subsubsection"], Cell[204330, 4010, 1813, 43, 152, "Input"] }, Closed]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[206204, 4060, 2830, 39, 93, "Section"], Cell[209037, 4101, 762, 17, 77, "Input"], Cell[209802, 4120, 71923, 1421, 4477, "Input"] }, Closed]] } ] *) (* NotebookSignature FwTanyAumjGAFAKmoMfNhdPn *)