BasisResearch / collab-creatures

Analyzing animal collaboration with Bayesian and causal inference.
4 stars 1 forks source link

Incorporate com simulations into main package, prep communicators notebooks code chunks #16

Closed rfl-urbaniak closed 9 months ago

rfl-urbaniak commented 9 months ago

minor revisions to ft code, as required by the prep of the notebooks.

rfl-urbaniak commented 9 months ago

The 150 frames dataset is now in place.

emackev commented 9 months ago

I'll test the notebooks now, then plan to merge it in.

One remaining issue is that there are currently 3 copies of the foraging_toolkit folder (in collab, mx_refactors, and random_hungry_followers). I'm assuming the collab one is current, and that mx_refactored and random_hungry_followers will disappear (the relevant code will go into collab). I'll post a separate issue about this.

rfl-urbaniak commented 9 months ago

Yes, Collab is the current one, the rest will disappear. MX refactored should already have been deleted in this PR. No need to set separate issue, I delete as I incorporate.

emackev commented 9 months ago

In communicators_simulations.ipynb, the setup is a little confusing. Specifically, the cell starting "# custom list of locations for simulation setup 2"

Should this should be included in the cell "# Simulation setup 2 for the impact of communication"?

Also, it might be clearer to make a switch with cases (setup 1 and setup 2, with a little more explanation)

emackev commented 9 months ago

In communicators_inference, this comment (from me to myself) should be deleted, bc I already figured out that bug:

TODO!! @ELM double check what's up with rewards not disappearing immediately, is this intended?

@rfl-urbaniak , should I just make this change and push?

emackev commented 9 months ago

ft.animate_birds, it'd be nice to have the legend show what the different traces are

rfl-urbaniak commented 9 months ago

No, it's a new comment from me to you. Check an animation based on setup 1 to see for yourself.

emackev commented 9 months ago

No, it's a new comment from me to you. Check an animation based on setup 1 to see for yourself.

Ahhh -- the previous issue was that the rewards never disappeared.

The current behavior is as intended. Each food item has a certain size, bigger than what a bird can eat in one timestep. So it shouldn't disappear immediately.

However, there's a deeper issue here, which is that the way the "calories" are defined in the code is very confusing and opens up potential bugs.

The relevant line for determining how quickly food depletes when an agent eats it is line 34 of collab/communicators/simulation.py: self.calories_acquired_per_unit_time = 5 # TO DO: make this a property of the agent, putting it here for now

This is quite hidden, and also misleading -- it appears like it could be set separately for each agent, but currently it can't. See how "delta_food_cal" is defined in the same simulation.py. I'll make an issue about this.

emackev commented 9 months ago

Yes, Collab is the current one, the rest will disappear. MX refactored should already have been deleted in this PR. No need to set separate issue, I delete as I incorporate.

Gotcha. You can resolve the issue when it's all done. I see that mx_refactored is removed in this PR -- it remains on my computer when I pull, likely due to other branches, but not on git.