Skip to content

Refactor AcceptWay further into a dynamic structure #47

Closed

Description

@NopMap

Refactor AcceptWay to use a dynamic List of Encoders instead of a hardcoded set. This would allow for easily adding new evaluation sets for trucks, horses, mtb etc. (up to 4 because of the flag limitation)

Also seperate the logic whether a way is allowed from the property handling to speed up the first parsing run in the 2pass reader.

Activity

  1. karussell commented on May 24, 2013

    @karussell
    Member

    Every encoder requires some storage (at the moment this is always 8 bits per encoder, but configurable). And the flag is an integer which limits the active encoders in one graph to only 4. One could extend that to more (e.g. via two flag integers) but I'm not sure if that would be useful. I would rather concentrate on less vehicles with more correct routes. (I mean having lots of well configured encoders of which only 4 can be active)

  2. NopMap commented on May 24, 2013

    @NopMap
    ContributorAuthor

    Agreed, 4 are enough.. What I mean is to have lets say 6 well-encapsulated encoders, 4 of which can be active at a time. But select them with some register() method and iterate over a list of encoders instead of hardcoded if( car) if (bike ) etc.

    Should be fairly simple. In the encoders, only the shift-value must be assigned dynamically when registering so they will use the right bits and are compatible with any other encoder.

  3. karussell commented on May 24, 2013

    @karussell
    Member

    I agree, but we should test if a loop over not soo many entries has the same speed. But I bet the JIT will unroll the loop and make it fast ..

  4. added a commit that references this issue on Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions