diff --git a/Source/helper-functions.nls b/Source/helper-functions.nls index b13d7c5..17544ca 100644 --- a/Source/helper-functions.nls +++ b/Source/helper-functions.nls @@ -115,4 +115,9 @@ to individual-caract let travel-distance distance old-spot set profit (profit + beekeep-utility ([flower-type] of one-of spots-here) amount-of-hives travel-distance ) set total-travel-distance (total-travel-distance + travel-distance ) +end + + +to come-back + move-to old-spot end \ No newline at end of file diff --git a/Source/main.nlogo b/Source/main.nlogo index 51f49c0..e3707e5 100644 --- a/Source/main.nlogo +++ b/Source/main.nlogo @@ -12,6 +12,10 @@ globals [ lend-uncertainty averageProfit sumOfallBeekeepersProfit + max-profit + min-profit + max-distance + min-distance ] @@ -50,19 +54,50 @@ to go [ if strategy = "with-collective-strategy" [ let s with-collective-strategy if any? spots with [ s = self ] [ set old-spot min-one-of spots [distance myself] move-to with-collective-strategy evaluation-procedure ] ] - if strategy = "with-blind-strategy" [ set old-spot min-one-of spots [distance myself] move-to with-blind-strategy evaluation-procedure ] ] - - go-pollinate + if strategy = "with-blind-strategy" [ + set old-spot min-one-of spots [distance myself] + move-to with-blind-strategy + ;let present-beekeepers other beekeepers + if any? other beekeepers-here[ + come-back + ] + evaluation-procedure + ] + ] + + ; collect honey and make money ; tick! tick set yearly-ticks ticks mod 365 - if yearly-ticks = 0 [ - setup-seasons-uncertainty - eleminate-and-germinate - setup-wild-bees ] + if yearly-ticks = 0 [ + setup-seasons-uncertainty + setup-new-season + evaluate-best-worst + setup-beekeepers-new-season + ] +end +to evaluate-best-worst + + + ask beekeepers [ + + if profit > max-profit [set max-profit profit] + if profit < min-profit [set min-profit profit] + if total-travel-distance > max-distance[set max-distance total-travel-distance] + if total-travel-distance < min-distance [set min-distance total-travel-distance] + + ] + +end + +to setup-beekeepers-new-season + ask beekeepers [ + set profit 0 + set total-travel-distance 0 + ] end @#$#@#$#@ @@ -382,6 +417,28 @@ per-county-init 1 -1000 +MONITOR +969 +576 +1044 +621 +Max Profit +max-profit +17 +1 +11 + +MONITOR +969 +625 +1041 +670 +Min Profit +min-profit +17 +1 +11 + @#$#@#$#@ ## WHAT IS IT? @@ -725,7 +782,7 @@ Polygon -7500403 true true 270 75 225 30 30 225 75 270 Polygon -7500403 true true 30 75 75 30 270 225 225 270 @#$#@#$#@ -NetLogo 5.0.4 +NetLogo 5.0.3 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ diff --git a/Source/vmodel.nls b/Source/vmodel.nls index 89dffee..37c93ea 100644 --- a/Source/vmodel.nls +++ b/Source/vmodel.nls @@ -65,4 +65,6 @@ end to setup-new-season set sumOfallBeekeepersProfit 0 set averageProfit 0 + set max-profit 0 + set min-profit 0 end