-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource-landscape interaction #56
Comments
Hi Brad,
Good idea, I would find it really useful! The carrying capacity can be a confusing notion sometimes, and less straightforward a measure as a yield or a consumption rate. Do manager usually use it?
Moreover, it would avoid setting a fixed value for the carrying capacity, which is likely to vary over time and with changes in the environment.
Cheers,
Adrian
…________________________________
From: Brad Duthie <[email protected]>
Sent: 06 January 2020 13:21
To: ConFooBio/gmse <[email protected]>
Cc: Adrian Bach <[email protected]>; Mention <[email protected]>
Subject: [ConFooBio/gmse] Resource-landscape interaction (#56)
At the moment, GMSE only allows for a fixed carrying capacity that is not tied to resource consumption on landscape cells. Now GMSE is being used for projects with @AdrianBach<https://github.com/AdrianBach> @jejoenje<https://github.com/jejoenje> @nbunne<https://github.com/nbunne> and Lovisa, with a major element of these models being resources (e.g., geese) feeding on the landscape. Hence, I am tempted to code a link between resource consumption and resource mortality. In other words, geese could survive as long as they consumed sufficient landscape yield in a time step, else they would die. This would lead to a natural carrying capacity (which could still be adjusted by adjusting the required amount consumed to ensure survival), and would tie population dynamics with resource availability more naturally.
I think that the reason I hesitated to do this in the first place was to allow for some flexibility much later on down the line, creating multiple resource types and having those types interact on the same data frame. I would like to get there eventually, but making use of the landscape properties to have resource dynamics dependent upon consumption might be good in the mean time. It would also potentially make strategies such as kill_crops potentially relevant.
What do you all think? If I were to add a new option allowing resource survival (or reproduction) to depend on landscape consumption, would you be likely to use it, or is this unnecessary for the models that you are working on?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#56?email_source=notifications&email_token=AKMP6UXYH7YPILQKKXT2LUTQ4MV6TA5CNFSM4KDEIVK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IEHCRMQ>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AKMP6UVWAQUTD6L4FUD2XD3Q4MV6TANCNFSM4KDEIVKQ>.
[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "#56?email_source=notifications\u0026email_token=AKMP6UXYH7YPILQKKXT2LUTQ4MV6TA5CNFSM4KDEIVK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IEHCRMQ", "url": "#56?email_source=notifications\u0026email_token=AKMP6UXYH7YPILQKKXT2LUTQ4MV6TA5CNFSM4KDEIVK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IEHCRMQ", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]
________________________________
The University achieved an overall 5 stars in the QS World University Rankings 2018
The University of Stirling is a charity registered in Scotland, number SC 011159.
|
Agreed I think this would be a great additional feature and a natural next step!
|
Many thanks @AdrianBach and @jejoenje -- this helps a lot! I agree that having population dynamics (and therefore carrying capacity) more mechanistically affected by yield would be more straightforward. Regarding your points @jejeonje:
There is a complicating factor in the coding since I wrote a separate function res_landscape_interaction that affects the values on landscapes -- this comes after everything else in the time step at the moment (movement, birth death), and the order of operations might be something to think about. I'm slightly nervous about this line. I don't like the hard coded values, and it looks like it's multiplying by offspring number instead of death rate -- then again, the variables |
That sounds all really good. |
…address Issues #53 #59 and #56 and incorporate code from @AdrianBach into the master branch. I will also atempt a major new feature allowing landscape consumption to affect demographics, with conversations from @jejoenje @nbunne and others. Other updates are welcome -- just make a new branch that can be merged later.
… now be limited by the extent to which they feed on the landscape. I still need to implement the changes to birthrate that come with feeding, but death looks accurate. A really well-written vignette and documentation is needed to show how all of this works; I think one that just goes over all different methods of population regulation is in order
…ist; new code now also effectively resolves Issue #56 -- tests confirm that resource-landscape interactions are working as intended
With commit 6d1e5e6ca41bc6bb45c62cb174f34480c3c5add1, I believe that I now have resolved Issue #56 and created a version of GMSE that now allows resource death and reproduction to be tied to resource consumption on the landscape. Initial testing shows that this works in both There is still considerable stochasticity introduced in terms of whether or not a resource will survive or reproduce. First, each resource can potentially feed more than once by using the new Hence, in the end, there is a lot of uncertainty surrounding whether an individual resource will have enough to survive and reproduce in a time step. But the probabilistic idea of @jejoenje could also be imposed with a function of some sort that would link consumption to a probability of death (will need to think of the best way to actually do this in the code though). Testing shows that resource increases to a carrying capacity imposed by the constraints of the landscape, with a lot more stochasticity than occurs just by settting a value for global
I set the
Just to clarify, each landscape cell still puts out a value of 1. The argument Setting The new version is GMSE v0.5.0.0 with @AdrianBach now included in the list of contributors. The The last thing that I think I want to do before merging with master, updating the website, and sending to CRAN, is to make a new default landscape. It would be good to make each landscape into more farm-like blocks rather than the narrow stripes that exist now. I don't have a good algorithm for doing this for an arbitrary number of stakeholders (i.e., for N stakeholders, separate an X by Y landscape into roughly equal blocks of sizes ca (X*Y / N)). If anyone wants to have a go at this and create a function that does it, please let me know! Else I'll try to get around to it before early next month where the plan is to send to CRAN. If anyone has time (@nbunne @jejoenje @AdrianBach), feel free to download from the
It should be up now. |
This sounds fantastic @bradduthie! I much look forward to playing with this. Indeed, I'm currently working on a set of simulations varying user/manager budgets as well as land distribution among users, as discussed, so it would be fairly straightforward for me to replicate the exact scenarios I'm running but with the new consmuption parameters. Just to check if I understand the new logic correctly - in the new set up, resource movement is still random, correct? So resource agents simply move in a random fashion until Finally, re. your point about a new default landscape (i.e. "non-striped"). I have a potential way of doing this, although it would somewhat rely on an external package. I'll see if I can set some examples up to demonstrate what I'm thinking. |
Actually thinking about it - the "easy" procedure for more "natural" landscape distribution among stakeholders I was thinking of, is essentially a tesselation as produced by I've actually been going around in circles about this problem - I don't think it's as trivial a question as I first thought. So we want to subdivide a square in as-close-to-equal parts, but have the subdivisions contiguous, correct? |
Awesome @jejoenje -- yeah, resource movement has not changed. To keep everything backwards compatible, the So, essentially, resource move first without feeding. Then they move in the same fashion in random orders I agree on what we want for the landscape, ideally -- though I don't know if rectangular is necessarily as important as contiguous and less long and narrow (for lack of better terminology). For four farmers, I actually think the current default is fine, but aesthetically, when there are a huge number of farmers, it just starts to look a bit weird and unrealistic. If you have any ideas, go for it! Though I really want to try to avoid having dependencies in GMSE (aside from the shiny packages needed for the GUI) -- maybe just a similar algorithm to one used in NLMR to produce an alternative to the stripes? The polygons in the example link look really cool actually. And I don't think a bit of variation is necessarily bad in terms of farm size, at least for a non-default option, though it's probably worth thinking about a bit more (obviously it would be cool to be able to set arbitrary variation in farm size with block shapes, but this is probably unrealistic for arbitrary stakeholder numbers). |
Fingers crossed that the new R 4.0.0 doesn't result in any painful challenges to GMSE. I'll download and run all checks in the new R before submitting to CRAN (might need to be early to mid May). |
woo R 4.0! I hadn't spotted that yet... |
One problem I'm now seeing here in the genetic algorithm is that users perceive their actions' of castration and feeding as being directly tied to |
I must admit, I haven't actually used the feeding or castration options myself at all yet, so I hadn't actually realised that this would be an issue. Good spot...
This would then only apply IF
This sounds fine to me, I can't say I have much of a better idea...
Not quite sure if I follow this... so they would always feed to the maximum? |
@bradduthie Just as an update, I now have the development version installed in a separate R installation and my simulation scenarios seem to be running, both as they were and with the new parameter values set, too. |
Sort of -- it would apply especially when |
I'm now thinking that maybe the best solution is to do the above, but release the current version tagged on the master branch (but not to CRAN). This assumes that everything looks good to you @jejoenje and that both of us can run our code with no apparent issues. That can be version 0.5.0.0, with the changes from @AdrianBach, Lovisa's crane model, and the landscape consumption included. A new version 0.6.0.0 could then include:
I feel like I'm forgetting something, but does this sound good? Anyone want to give an R function for number 1 a go? I can do numbers 2 and 3. All in all, these changes would technically make existing models run a bit differently, but almost certainly not in a way that would affect anyone's results. The version 0.6.0.0 would then require testing of course, but that could be the version sent to CRAN rather than what we have so far. |
@bradduthie Sounds good re. releasing 0.5 on As for (1) above I'm looking into this, but I'm finding it much less straightforward to do this than I expected. As discussed all existing tesselation algorithm implementations are inside external packages, and we want to avoid dependencies. I've not found a straightforward R or C implementation of something that we could "bake" into GMSE, and it may be overkill anyway. I'll keep at it, but if this is not needed for a 0.5 release on |
Sounds good on the simulations @jejoenje -- I'll wait until things look good on your end too. Re-running the vignettes should also help confirm that everything is working correctly (I also wrote a testthat test that loops Yeah, no hurry on a solution for v0.6.0.0 to CRAN. I'm glad I'm not the only one that finds this a bit more challenging than it seems on the surface. One thought I had was to apply solutions used to create voting districts that prevent gerrymandering. I actually just found a video from CGP Grey that very nicely describes something called the Shortest-Splitline Algorithm. Just by replacing 'people' with 'cells', I think this might get us what we want. |
@bradduthie I've now finished several sets of simulations, varying user and manager budgets and landownership, both using GMSE 0.4.0.13 and the dev version 0.5.0.0. |
Many thanks for this @jejoenje -- it's reassuring that everything seems to behave in the same way across versions. I don't think I have a handle yet on how to use the new parameter values most effectively (i.e., what we should consider 'high' versus 'low' values). Eventually we might want to build in things like time lags. Okay, I'll merge this with the master branch soon and add a tag so that GMSE v0.5.0.0 is a milestone version that we can use, even though it will (I hope) be quickly superseded by v0.6.0.x with the added features that we have been discussing here. This next version will represent a break from complete backwards compatibility (though will, for nearly all intents and purposes, still give the same results given the same parameter values). |
GMSE v0.5.0.0 now up on GitHub. It just occurred to me that the last thing that should be done is to update the |
As long as we're changing things, I think that v0.6.0.0 might be a good time to re-evaluate how the users perceive scaring actions. Currently, they assume that scaring a resource will remove it from their land, and that scaring therefore has the same effect as culling. But this seems unrealistic for a farmer who owns half the landscape. I think it's reasonable to assume that people don't have access to the age, consumption, or reproductive output of a goose, e.g., but a farmer is going to know how much land they own. I think that the perceived benefit of scaring should probably be scaled to this; that is, to the probability that a scared resource lands back on an owned cell. So, for example, a farmer that owns 25 per cent of the land might only perceive the benefit of scaring to be 1 * (1 - 0.25). This can be implemented fairly easily because there are currently unused columns in the agent array, meaning that I don't need to go through the hassle of changing the array's size. It's also elegant in that if Adjustments to the perceived effects can be made by altering the fitness function, which I think could use a re-think anyway (killing should probably also include effects of castration, which have previously been separated from the user's perspective). |
Okay, I think I've figured out a cool recursive way to do the shortest-splitline algorithm and break the landscape up into neat boxes fairly quickly. I'll give it a shot the next time I sit down to code. |
At the moment, GMSE only allows for a fixed carrying capacity that is not tied to resource consumption on landscape cells. Now GMSE is being used for projects with @AdrianBach @jejoenje @nbunne and Lovisa, with a major element of these models being resources (e.g., geese) feeding on the landscape. Hence, I am tempted to code a link between resource consumption and resource mortality. In other words, geese could survive as long as they consumed sufficient landscape yield in a time step, else they would die. This would lead to a natural carrying capacity (which could still be adjusted by adjusting the required amount consumed to ensure survival), and would tie population dynamics with resource availability more naturally.
I think that the reason I hesitated to do this in the first place was to allow for some flexibility much later on down the line, creating multiple resource types and having those types interact on the same data frame. I would like to get there eventually, but making use of the landscape properties to have resource dynamics dependent upon consumption might be good in the mean time. It would also potentially make strategies such as
kill_crops
potentially relevant.What do you all think? If I were to add a new option allowing resource survival (or reproduction) to depend on landscape consumption, would you be likely to use it, or is this unnecessary for the models that you are working on?
The text was updated successfully, but these errors were encountered: