Skip to content

removed AbstractFlagEncoder.speedDefault and flagsDefault() - #2202

Merged
karussell merged 6 commits into
masterfrom
ev_default
Dec 9, 2020
Merged

karussell merged 6 commits into
masterfrom
ev_default

Conversation

@karussell

@karussell karussell commented Dec 6, 2020 •

Copy link
Copy Markdown
Member

It took a bit time, but finally I got rid of this method :) (usage was approx 2000 times). This will likely make it easier to move average_speed and access parsing into a separate TagParser.

My best friend was regex replace functionality of IntelliJ ala:

graph.edge\((\d+)..(\d+)..(\d+), (or variations with (\d+.\d+) or (\w+))
GHUtility.setProperties(graph.edge($1,$2).setDistance($3),encoder,60,true,

The new mechanism is a bit clumsy, but if you think about this then it is really necessary to initialize the edge with a specific speed (and vehicle). And in production we do not use this method, only for tests.

TODO: replace more single method calls of GHUtility with the new GHUtility.setProperties(List<EdgeIteratorState>)?

@karussell karussell added this to the 3.0 milestone Dec 6, 2020
@karussell

karussell commented Dec 8, 2020 •

Copy link
Copy Markdown
Member Author

@easbar I have also committed the changes with formatting like you suggested. Is this in a shape where I can merge this or should we e.g. remove the addition of the new set methods? If we keep them I'll add a few tests at least :)

@easbar easbar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and I would keep the setter methods.

@karussell

Copy link
Copy Markdown
Member Author

Ok, replaced a few places so that set(enc, fwd, bwd) is used in tests too.

btw: I like the cleanup here :) 84f673a#diff-9fa225a474dad457f320fc9e51c0337f69b560f7c9b676387e8d2155d8ef1d21

@karussell
karussell merged commit bbb15df into master Dec 9, 2020
@karussell
karussell deleted the ev_default branch December 9, 2020 12:21
@karussell karussell mentioned this pull request Dec 9, 2020
easbar added a commit that referenced this pull request Dec 14, 2020
…2212)

The migration rule is: `randomSpeedEnc=null` -> `speed=60` (for car) and `randomSpeedEnc!=null` -> `speed=null`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants