-
Notifications
You must be signed in to change notification settings - Fork 917
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
Extend Wolf Sheep example to include PropertyLayer #2564
base: main
Are you sure you want to change the base?
Conversation
Performance benchmarks:
|
Thanks for your PR! I just merged #2503, which also modified this example. You rebase your branch and resolve any conflicts? If you need any help with that let me know! |
120456a
to
ae0223b
Compare
Yes I already did rebase and resolved the conflict. |
Performance benchmarks:
|
Thanks! like the idea of barriers / cliffs, it's widely discussed at the moment:
I don't think the model dynamics will be nice if animals just walk like they currently do and suddenly die because a cell is marked as a cliff. Either, I would like the cliff to be inaccessible, so they don't even consider moving there, and choose another cells. This of course can mean they walk into a dead end (surrounded by cliffs), don't have any movement options anymore, and thus get eaten. |
Would you like me to implement that in this PR? It's actually the initial idea that came to my mind, but decided to make it 'stepping into a cliff = dies'. Also there might be a case where an animal (wolf or sheep) is randomly generated in the middle of 4 neighboring cliff (hence not being able to move at all forever). Or, if you have another idea (that might be completely different to this cliff cell idea) to demonstrate |
Yes
Was also thinking about this. Ideally cliffs are not generated fully random, but I'm not sure on a simple and elegant solution yet. |
I already updated the PR with this, please let me know what you think. But I changed the name cliff -> wall, since I think it fits better. I have a question about your PR. In this code, we exit But in that case. the energy still gets decremented here -- even when the sheep doesn't move at all. Returning early in My question: Is it a bug, or is it an intended behavior? |
Okay, maybe take a step back here, before you invest too much in the current approach. Because:
So, we have to take a step back, and determine your goal:
The approach we often take when things
The first 4 can best happen in a Discussion. If you have those first 4 very clearly defined, 5 becomes often trivial (or at least straightforward). |
Yes, I think my goal is this.
This is a good idea, should I try this?
Should I create a discussion about the "soil fertility" idea there? Thank you for your feedback |
Having a separate discussion on soil fertility sounds like a good idea. However, with sugarscape, we already have a simple property layer example. So, at a minimum, this example should add value and be different from what is show cased there. |
Yes, let's do this.
It could demonstrate how two PropertyLayers interact: The soil layer is static (stays the same during the run), and the grass layers is updated based on the soil layer. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
038a9be
to
fb1f272
Compare
This pull request is in response to @tpike3 's reply on Matrix discussion: https://matrix.to/#/!CAAdpmuJhdNJkxurrp:matrix.org/$sSOIip3pT1L5C6wrpzhvoM64Y4wYcpSsUHZSZXKwfFE?via=matrix.org&via=gitter.im
At the time this PR is created (Dec 22) the changes are still not that well tested. I would like to hear what you think first about my idea to extend this Wolf Sheep example, before testing it more and possibly adding more changes to it.
My idea of extending the Wolf Sheep is pretty simple: use
PropertyLayer
to store information which cells that are cliff cells. If an animal (wolf or sheep) steps into a cliff cell, then the animal dies. The coordinate in thePropertyLayer
is settrue
if the cell is a cliff,false
if it is not.Please let me know what you think :) Thank you in advance.