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

Data structure for scene representation #45

Open
MaximeBouton opened this issue Nov 5, 2019 · 0 comments
Open

Data structure for scene representation #45

MaximeBouton opened this issue Nov 5, 2019 · 0 comments

Comments

@MaximeBouton
Copy link
Member

MaximeBouton commented Nov 5, 2019

What is the real benefit of using EntityFrame to represent a scene?
It seems like the only benefit is pre-allocation.

Alternative data structures:

  • Vector: would still allow pre-allocation, very simple to work with, retrieving a vehicle by its id would not be as straightforward (although it can be done with a one liner findfirst(x ->x.id == egoid, scene), but not very efficient)
  • Dict (or OrderedDict), mapping id to Entity, would be trivial to retrieve vehicles by their id, not as straightforward to pre-allocate.

Why would we change?

  • Using data structure from the standard library is easier to understand.
  • Potentially allows to use any AbstractArray type

My personal opinion is that using AbstractArray as a default is the easiest solution.

Ideally we want the flexibility to use either representation. Dictionary optimizes for accessing vehicle by id, one might want more complex data structures to e.g. find neighbors easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant