mountaindust / Planktos

ABM framework for dispersal modeling
https://planktos.readthedocs.io
GNU General Public License v3.0
5 stars 3 forks source link

swarm dataframe #24

Closed mountaindust closed 4 years ago

mountaindust commented 5 years ago

A swarm is essentially a container for many agents of the same type (for speed purposes), but in this function it is rather rudimentary and not well suited for handling arbitrary agent states, properties, etc. - a vary desirable thing to have in such a container. An elegant solution would be to add a Pandas dataframe property, in which the dataframe holds all attributes of each agent (columns are attributes, rows are agents). A list then holds each dataframe in the time history, much as pos_history does now, with the current-time dataframe updated in place. This would also present a natural solution to #23. Then one can easily look at the dataframe associated with a given time point to quickly see the state of every agent in an organized manner.

mountaindust commented 5 years ago

To save space and reduce complexity, there should also be a dictionary to hold attributes shared by all agents within a swarm, rather than storing N copies of redundant data in a dataframe.

mountaindust commented 4 years ago

This is currently being handled on the dataframe branch

mountaindust commented 4 years ago

Next steps probably need to look like this:

mountaindust commented 4 years ago

Even better:

mountaindust commented 4 years ago

This is done on the dataframe branch and is passing tests, but need to make sure examples work.

Also need to add a new test to make sure the individual variation case works.