Skip to content
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

enh/115-efficient-arena-map #115

Open
jharwell opened this issue Jan 5, 2021 · 0 comments
Open

enh/115-efficient-arena-map #115

jharwell opened this issue Jan 5, 2021 · 0 comments

Comments

@jharwell
Copy link
Owner

jharwell commented Jan 5, 2021

For VERY large arena maps (e.g., 2,000 x 2,000), COSM can request over 48GB of
memory just for the array of cells forming the base of the arena map. Depending
on configuration, most of the arena can be empty (does not contain a block,
cache, nest, etc., on very many cells). So, this is inefficient, and can limit
the size of the swarms that I can use.

A better approach would be to switch to a different underlying data structure,
such as a std::map/std::unordered_map, which I could use to create "sparse"
arrays indexed by an rmath::vector2z object, which will be more computationally
efficient.

This will require some additional checking logic when dropping/picking up a
block, dropping in a cache, etc., because the cells will need to be created if
they don't exist. I don't know if they should be destroyed when they don't get
used for N timesteps--maybe ?

@jharwell jharwell changed the title enh/112-efficient-arena-map enh/115-efficient-arena-map Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant