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

Weighting support via yaml configuration #1841

Merged
merged 202 commits into from May 1, 2020
Merged

Weighting support via yaml configuration #1841

merged 202 commits into from May 1, 2020

Conversation

karussell
Copy link
Member

@karussell karussell commented Dec 30, 2019

fixes #1776
fixes #223

Note

Disclaimer: custom profiles were an alpha feature in version 1.0 and 2.0.

You can try this feature in the linked small tutorial. Please note that the format changed in version 3.0 - see here for the pull request and the blog post with examples which is always updated.

Usage

First you need to define a custom profile:

profiles:
  - name: car
    vehicle: car
    weighting: custom

Then you can use this profile in a custom request. You query a json towards the new endpoint /route-custom. In the following section we use yaml to allow comments (you can convert it with this node js tool or this online tool):

# query parameters:
points: [[10.373926, 52.042989], [10.384043, 52.042289]]
details: [road_class, street_name]

# pick the previously defined custom profile
profile: car

# The formula is defined in CustomWeighting, where the speed_factor can be used to decrease speed.
# The minimum value is 0 and the maximum is 1. If two conditions are satisfied the values are
# multiplied e.g. if road_class==motorway and road_environment==tunnel, then the resulting speed is
# average_speed*0.85*0.9.
speed_factor:
  road_environment:
    tunnel: 0.85
  # trucks should be a bit slower on certain road classes compared to the 'base' car
  # a more compact JSON-way to list the properties, fully YAML-compatible:
  road_class: { motorway: 0.85, primary: 0.9 }

# You can lower the average speed for certain conditions via this max_speed entry. The speed_factor is applied before
# this operation. See the following example that sets the maximum speed to 95km/h for motorways.
max_speed:
  road_class:
    motorway: 95
    residential: 30
  road_environment:
    bridge: 85

# Trucks are slower so limit all speed to this value. In km/h
# If none of the conditions in the map above apply use the fallback, if specified:
max_speed_fallback: 100

# This term changes the influence of the distance. I.e. longer roads get a higher cost.
# The distance_influence is independent of the edge properties and does not influence the ETA. The default is 70 (seconds/1km).
# Let's assume a route that takes 1000sec and is 10km long, then a value of 30 means that I would like to drive maximum 11km
# to reduce the travel time to 970sec or 12km to reduce it to 940sec.
distance_influence: 90

# Now we want to set a preference without changing the taken time. The default priority is 1 and does not change something.
# Higher than 1 is not possible directly, only via the catch-all key "*", see road_class where motorways are preferred. Lower than 1 will avoid it.
# If two conditions are met the values will be multiplied. The minimum value is 0 (block access) the maximum value is 100.
priority:
  road_class:
    motorway: 1.0
    residential: 0.4
    "*": 0.9
    # and if you do not want that tracks go over tracks just exclude them via
    # track: 0
  # let's assume we transport gas: so NEVER go on restricted roads with hazmat==no
  hazmat: { no: 0 }
  # avoid destination-only roads
  road_access: { destination: 0.1 }
  # avoid turns if possible and links are one simple indication for that
  road_class_link:
    true: 0.5
  # avoid toll roads
  toll: { no: 1, "*": 0.5 }
  # avoid a certain area
  area_custom1: 0.5
  max_weight: { "<4.5": 0 }
  max_height: { "<3.8": 0 }
  max_width: { "<2.5": 0 }

areas:
  custom1:
    type: "Feature"
    geometry: { type: "Polygon", coordinates: [[[13.722, 51.053], [13.722, 51.055], [13.731, 51.055], [13.731, 51.053], [13.722, 51.053]]] }

Or a cargo bike:

profile: bike

# let's assume cargo bikes are e-bikes and we should lower speed to prefer shorter and not faster routes automatically
max_speed:
  road_class:
    primary: 28

# if no other condition matches
max_speed_fallback: 25

priority:
  # exclude steps
  road_class:
    steps: 0
  surface:
    sand: 0.5
  # prefer better tracks
  track_type: { other: 1.0, grade1: 1.0, "*": 0.9 }
  # prefer official bike routes
  bike_network: { other: 0.5 }
  # avoid all situations where we have to get off the bike
  get_off_bike:
    "true": 0.5
  max_height:
    "<2.3": 0
  max_width:
    "<1.2": 0

Now the interesting part is that you can try this out in the demo UI and when you are happy you can use the exact same content to create a file (e.g. truck.yml) and use it for the LM or CH preparation to make the query much faster, like so:

profiles:
 - name: truck
   vehicle: car
   weighting: custom
   custom_model_file: path/to/truck.yml
 - name: cargo_bike
   vehicle: bike
   weighting: custom
   custom_model_file: path/to/cargo_bike.yml

To query such a prepared custom profile you specify e.g. profile=truck. If you want to customize your request further you use A* or LM and the /route-custom endpoint. If no further customization is required or you want to use a CH-prepared custom profile you use the /route endpoint.

When you try this out in the UI you currently have to include custom weighting and potentially disabling turn cost: http://localhost:8989/maps/?point=51.060063%2C13.714714&point=51.064378%2C13.756599&weighting=custom&turn_costs=false

  • basic changes of the Weighting already work
  • examples and description is available in truck.yml, RouteResourceTest and CustomWeightingRouteResourceTest. Other examples could be: wheelchair (base:foot), electric_bike, cargo_bike (base:electric_bike -> which is not a FlagEncoder!), electric_car (base:car), bike that prefers official bike routes much more, fire_truck (base:truck), scooter (speed limited car?)
  • query via json or yaml
  • no need for a jackson dependency in core
  • implement DelayFlexConfig see below
  • for now remove delay as there are similar problems like for elevation (needs to be splitted for virtual edges) otherwise it sums up if there are several query points on a single edge.
  • -d for curl does not work for yaml as it strips line breaks. Instead use --data-binary
  • make FlexModelWeighting possible for CH and LM preparation too, without introducing a jackson dependency to core (due to Android)
  • priority is implemented wrong => it should be priority=1/factor
  • support for weight, height, width limitations
  • more "FlexModelWeighting" features like shown here should follow in separate PRs
  • merge FlexResource into RouteResource but only support it for POST
  • simple UI support like here
  • throw illegal arg exception if we use max_height but this is not supported from the storage.
  • documentation in config-example.yml and docs/ maybe
  • rename weight -> max_vehicle_weight etc
  • Yaml is much more standard & "better", but even our simplistic gscript implementation had a much better error reporting. Maybe also allow ScriptedWeighting via some interfaces and bring it other languages. For now yaml is ok. Later we might add a ScriptedWeighting.
  • if speed value is too slow => rounding to zero => is blocking desired? should not happen as we do not store the weight again into an EncodedValue
  • different/separate formula for calcWeight vs. calcTime? probably not now
  • add difference of average_speed handling (first wins) vs. speed_factor handling (all multiplied) to docs
  • throw error if value in average_speed is higher than max_speed
  • add custom request to Measurement
  • extend from AbstractWeighting
  • A very significant route change and query speed difference between normal "car" requests and a custom weighting with base: car is the default of distance_factor being 1 instead of 0. I.e. a normal car request takes 1100ms and the same as custom request with just "base: car" takes only 350ms. For now changed this default to 0.07 (copied from ShortFastestWeighting)
  • replace average_speed with a "max speed" variable or even remove it completely? The average_speed is not that useful. The speed value could be from traffic sources and we would completely overwrite it by a rather simple condition like road_class==motorway. Also it should be probably more a max_average_speed (instead of max speed)
  • before merging we need Improve edge filtering for LocationIndex #729
  • CustomerWeighting should always increase weight (normalize priority and factor)
  • CustomWeighting does not work with LM (not in Measurement and not in RouteResource)
  • See issue Select CH profiles by name ? #1708. Instead of base should we always pick the vehicle from the request? (this won't work for CH.) -> Do not use vehicle as it will collide with GHRequest.vehicle.
  • avoid nesting the model in the request because using the profile in a request or a request for a profile is ugly and only possible via editing. But then a separate endpoint is required?
  • throw exception if vehicle and weighting is specified in URL but does not match -> not needed if good documentation
  • introduce distance_factor map
  • web UI: keep flex config between requests (update: this only happens when setting weighting=flex as url parameter)
  • "sum" of terms instead of "multiplication" would make more sense, but then "preferring" a certain attribute is no longer as easy and often a requirement if we want to keep the yaml expressions simple (i.e. no complex boolean algebra)
  • check again about A* correctness (min weight -> priority and speed range)
  • is distance_factor map really necessary or too complicated too understand the nuances to "inverse priority"? -> for now remove it
  • allow boolean encoded values too like road_class_link or get_off_bike. Would be great to use this for "avoiding".
  • support block_area in the CustomModel
  • simple turn cost support for query -> already works via root-level fields populated GHRequest.hints (e.g. disabling works via edge_based: false)
  • switch to snake case is a bit ugly as current config.ymls stop working
  • Avoid error: "You can try disabling LM by setting lm.disable=true"
  • try using country enum
  • remove snake case as it is already in PR no need to explicitely list the snake case methods #1918
  • for fun try "avoid left turns" via per-request geometry evaluation 38b62f0
  • remove newly introduced name parameter from AbstractWeighting
  • change formula to either (const_distance_term + 1/v/prio)*d (no multiplication of prio with const_distance_term) or (const_distance_term + k/v + sum(some_map))*d (instead of priority multiplication use summation)
  • replace mixins with SNAKE-enabled jackson parser
  • if a CustomModel abc is known to GraphHopper and then there is a CustomRequest with profile=abc but a few parameters have changed, then it should be possible to merge them. Maybe in CustomWeighting.prepareRequest?
  • is it ugly that we do profile=custommodel against /route but if it is a CustomRequest it is against /route-custom. Especially if it is a CustomRequest with profile=custommodel (see point above) it gets strange.
  • turn cost support for CH/LM preparation -> should be already done via profiles
  • CustomModel.merge should multiply (or pick maximum) to keep LM-correctness
  • solve Select CH profiles by name ? #1708
  • change endpoint to /route-custom
  • add JSON support for file import and remove yaml endpoint
  • formula change Change custom weighting formula #2021
  • merge different ranges of DecimalEncodedValue
  • update docs
  • revert FlagEncoder changes

Later:

  • solve Move access flag checks into Weighting #1835
  • CustomRequest for Isochrone & SPT endpoint (POST request)
  • preliminary & simple tests show at least 20% slower CH preparation even for a very simple FlexModel. -> minor improvements to 10% - but for the simple case only! Can we somehow cache calls to edge.get(roadClass) so that at least if only road_class is used for the different FlexConfigs it does not get slower?
  • Cache EncodedValues in a later issue
  • try to get car turn restrictions working for a bike model (car.turn_cost)
  • web UI: show more useful error messages?
  • allow DoubleEncodedValue as value on the "right side" e.g. to directly use an EncodedValue as speed_factor. This is a bit complicated as we do not know the maximum value and cannot ensure correctness for LM.
  • allow != and &&
  • later allow a special shorter notation ala
    speed_factor: { road_class: { motorway||trunk: 1.1 }} instead of
    speed_factor: { road_class: { motorway: 1.1, trunk: 1.1 }}?
  • elevation. Let us assume we store the up and down elevation in EncodedValues then this is more involved for a QueryGraph as we need to split this for virtual edges like it is currently done also for the distance. Keep in mind that there are different use cases for elevation: one for weight-only (electric car) and one where weight and time is changed (bike that avoid hills). Also do delay (time offset) later as same problems like for elevation Introduce edge-length dependent EncodedValues #1898
  • avoid changing a country
  • turn cost support in Weighting class (see Remove TurnWeighting #1820) and also for importFlexModels
  • ScriptedWeighting

@karussell karussell added this to the 1.0 milestone Dec 30, 2019
# Conflicts:
#	web-api/src/main/java/com/graphhopper/jackson/GraphHopperModule.java
@karussell
Copy link
Member Author

karussell commented May 1, 2020

I found a really nice use case with the more generic >number schema we introduced recently. We cannot only apply this to max_weight or other vehicle properties but e.g. also to car.average_speed, and this can be used to avoid slower speed areas like city (ok, just an ugly workaround for maybe some future property like is_in_city) but it can also be used to avoid bike routes on roads with high (car) speed which was currently only possible within the FlagEncoder.

@karussell karussell merged commit 8123f83 into master May 1, 2020
@karussell karussell deleted the issue_1776 branch May 1, 2020 19:20
karussell added a commit that referenced this pull request Sep 28, 2021
)

* Use new profile parameter to select routing profile (#1934)

* ignore skadi elevation to avoid downloading 7MB file #1929

* trying to upgrade to dropwizard 2.x (#1998)

* Edge-based shortest-path trees (Algorithm only)

* Remove test output

* Change routing time log to use ms instead of micros

* Remove remaining usages of DropwizardAppRule

* Random cleanups taken from #1841

* Add CarFlagEncoder.setSpeedTwoDirections, remove propertiesString constructor for encoders

* Add test about url parameters for POST requests

* IsochroneResource can do turn restrictions #1978

* SPTResource can do turn restrictions #1978

* Fixup

* GHPointConverterProvider handles null values correctly

* NotNull annotation instead of throwing

* Same with another parameter

* Default error messages are fine, just serialize them properly

* Moare declarative validation

* Use special Param types to avoid 404 when number not parseable

* Enum for response type

* Use dw20 facility for custom request parameter type

* Same for pt

* Default not-null-check

* Default handling of Instant parameters

* Less code

* Move GHJerseyViolationExceptionMapper to bundle

* SPTResource: Annotate with error return type

* We now get a correct 400 error for missing points

* We now get a correct 400 error for bad points

* Use pluginManagement for maven compiler&test plugins, use java 8 in parent

* no need for these plugins in parent, because it has no code
* client-hc, tools and core still using Java 7

* Increase memory limit for tests for now

* Only print seeds when tests fail

* decrease test memory to 110m as it should be sufficient, #2003

* Remove gpx for post #2006

* Remove documentation for GPX #2006

* Move gpx test from GraphHopperWebIT to RouteResourceTest (#2000)

* Throw (client-side) error if gpx export is used with POST

* test client-hc routing without internet requirement (#2003)

* test client-hc routing without internet requirement

* improved alternative route example

* parametrized test

* use setProfile

* Use @EnumSource

Co-authored-by: easbar <easbar.mail@posteo.net>

* remove RecalculationHook

* Upgrade tools to Java and some cleanup + new measurement.name in Measurement

* Add missing measurement.names

* Add flag to reactivate transfer between stops connected to same OSM node.

* Apply same checks for both GET&POST /route, clean up GHRequest#heading stuff (#2010)

* timeout should propagate to OkHttp (#2014)

* test if timeout propagates to OkHttp

* remove maxUnzippedLength

* make test a bit shorter via ValueSource

* Failing test for traversal nodes over z-limit

* Don't traverse nodes over z-limit

* Add weight_limit (#2011)

* ..but without weight_limit_offset

* Don't rebuild pt-locationindex every time

* Remove meaning of turn cost provider name, close #1999

* Increase shortcut version because properties file changed

* Move parseList helper method to Helper

* Unparsable enum indeed gives 400 and not 404

* Put 'took' in pt response

* remove legacy turn_costs for isochrone too (#2018)

* remove legacy turn_costs for isochrone too

* add test case that was red and is now green

* isochrone: adapt limit to consumed nodes. visited nodes can be multiple times more

* add a test for landmark area-splitting, fixes #2020

* import cleanup from previous commit

* Prune by max street time

* Profile duration as parameter

* Profile duration is optional

* Use transportation mode for getOffBike (#2022)

* Add instructions to fix error in intellij

* Extract createRouteCallBack in main-template.js, as in #1841

* Remove change graph docs

* Weighting support via yaml configuration (#1841)

* initial version with a basic Weighting support via yaml configuration

* implement DelayFlexConfig

* use flex model for CH preparation - yeah. Now questions like #1708 arise

* reverse priority is logical

* add more tests regarding common use cases like max_height and avoid tunnel

* avoid special case of config after graphhopper.init

* merge FlexResource into RouteResource

* avoid additional test classes

* add minor java docs

* minor fixes

* added initial UI

* replace min with max priority for proper A* heuristic. Range check also for delay

* throw exception if encoded values like max_height does not exists

* added todo to PR

* improve warning

* avoid calling edge.getDistance in weight twice -> we need this for all edge.get(encVal) methods somehow

* Remove unused import

* Add EnumToValue#toString

* rename FlexModelWeighting to CustomWeighting etc to avoid confusion with 'flex mode'

* minor doc in config-example.yml

* ensure that we currently just ignore URL parameters for POST /route requests

* better description and examples

* remove DelayCustomConfig for now as virtual edges would artifically duplicate it

* reduce default max prio should increase speed; introduce max speed and max priority check

* properly pick max priority

* set default distance_factor to same like in ShortFastestWeighting instead of 1

* remove delay from CustomWeighting description

* change naming custom_models -> custom_profiles #493

* fix tests

* for now reduce time for routingLM8_custom

* replaced the often not well working average_speed with max_speed map and max_speed_fallback

* fix refactoring

* normalize priority and speed_factor so it always can be used for LM even if 'prefer' i.e. bigger than 1

* apply max_speed after speed_factor; change order and document this in javadocs and example yml

* finally made custom models working with LM, also in Measurement

* move custom again to separate /custom endpoint; also move 'model' to root level in request

* introduce speed_factor map

* make distance_factor map similar to the other factor maps (i.e. a higher value means prefer this edge)

* add missing distance factor in weight formula

* sum instead product for distance_term

* remove distance term for now (can be added later)

* fix flex UI to new /custom endpoint and level up the model

* config-example.yml: usage of camel case is required due to 8b329df#diff-3b9d114d751c40bc3a90a7625a2bedb7

* enable usage of BooleanEncodedValue

* implement avoid area

* avoid using block_area property for /custom endpoint

* avoid subclassing and reusing CustomWeighting stuff

* demo: load yml from URL

* refactoring

* avoid global snake case due to config.yml backward compatibility

* avoid problem due to recently more strict LM fallback and use our test to catch this

* normalizing the speed_factor makes no sense. Just use 1 as maximum.

* AbstractFlagEncoder: removed newly introduced but unnecessary name parameter

* fix typo

* merged master

* changed formula and make distance_constant_term independent of priority

* rename distance_term_constant to shorter distance_influence

* change unit of distance_influence to sec/km

* removed 'name' parameter from AbstractWeighting; introduced GHRequest.get/setProfile

* merged master

* move CustomModel into ProfileConfig and auto-create profiles per CustomModel file

* CustomModel is tightly coupled to ProfileConfig but should not be part of it as we can imagine multiple different profile configs, CustomWeighting.prepareRequest makes more sense now; renamed 'base' to 'profile' as it should match a previously configured profile (LM or not)

* make GeoToValue more efficient; introduces quite a bit complexity

* fix test

* clean up, move TODO NOWs to later

* renamed ConfigMapEntry to EdgeToValueEntry

* do kind of autocompletion and more documentation

* help with root entries too

* make custom model usage more explicit (force profile creation) and limit profile names to ones with weighting=custom

* make things even more clear and introduce CustomProfileConfig to remove CustomModel.profile and make other handling easier; introduce customModel.merge

* fixed Measurement

* test fix

* fix Measurement

* minor comment change

* merged master

* no need for CustomProfileConfig.customModel instead store in hints

* minor test fixes

* fix measurement

* add preparation for truck and do timing for custom profile separate

* introduce custom light to better compare speed and preparation time to car+fastest

* minor fix

* make 'pure' custommodel with car faster

* add CH profile for custom weighting

* try to make CustomWeighting identical to FastestWeighting

* make CustomModel.merge compatible or throw illegalarg

* revert change in FastestWeighting

* fix hints usage

* Try to make curl error visible

* fix bug: decouple queryCustomModel from merge too

* Try to print error response *and* fail the build

* fix again: fastest weighting has no default distance influence

* measurement: allow multiple CH profile preps

* no need to change ProfileResolver anymore

* truck profile should use distance influence as we have now car fastest for comparison

* fixed something that we cannot really test as parsing the config is replaced with Java objects in our tests already

* fixed config-example.yml, related to #1987

* increase Xmx a bit due to DW 2.0.x seems to need 10MB more

* Replace DropwizardAppRule

* Fix import

* Minor clean up

* revert changes in ProfileResolver

* Minor

* Improve (hopefully) javadocs of EdgeToValueEntry

* Remove EncodedValueFactory#findValues

* Remove ugly ClassCastException catching

* Minor rename

* Remove gpx stuff from custom route endpoint

* better exception if boolean is not specified correctly

* Fix misleading javadocs, minor readability fix

* no negative values will happen, makes it easier to understand intend

* hide CustomWeighting-specific helper methods

* Setup measurements for custom profiles

* Measurement failed, add debug output and try again

* Fix benchmark

* Update/extend profiles.md

* Some more profiles.md

* Fix typo

* Continue with profiles.md

* More profiles.md: areas also for speed and allowed value ranges for speed&prio

* Fix typo

* Fix explanation of distance_influence in the presence of priorities

* Fix measurement name

* Lets see how slow slow routing is

* Rename Speed/PriorityCustomConfig to Speed/PriorityCalculator

* Enforce custom_model_file=empty for empty custom model

* Use AREA_PREFIX constant instead of key() function

* add getAllShared to lookup

* minor: avoid public constant. not sure if required

* throw exception for geo and boolean too if too big speed

* Keep slow routing, but for custom only use LM8 node-based

* a bit dirty fix regarding CustomModel usage via Java API

* Fix benchmark.sh

* Move max_weight into priority and more refactorings (#2015)

* initial range

* refactoring; implement catch-all key * instead of prefer factor bigger than 1

* fix test case

* include changes from review

* no need to consider boolean keys

* Update CustomWeighting java docs (even though it does not yet match the code)

* Minor

* Another fix for benchmark.sh...

* Fix model for measurement for new syntax

* ... and another fix

* ... and another fix 2

* benchmark: include dijkstra on big map

* Add a few tests for priority/speed calculator

* Update profiles.md

* Some more cleanup, docs and testing

* Remove todo

* removed yaml endpoint and renamed to /route-custom

* accept JSON as custom profile on server side

* Fix some of the remaining todos

* Minor cleanup

* merge 'comparison keys' properly; added tests and docs for this

* Remove more todos

* Try removing local distance variable, is it slower?

* minor Xmx increase

* Minor fix in docs

* Remove server side custom model inheritance from docs

* revert changes in FlagEncoder constructor

* add nice use case as test; add missing IntToValueEntry; remove further todos

* Trry storying distance in local variable is it faster?

* Re-enable all measurements, disable custom/astar measurements for now

* Add link to profiles.md

Co-authored-by: easbar <easbar.mail@posteo.net>

* ui: update jquery version

* upgrade osmosis-osm-binary, fixes #2019

* Point to docs in error messages regarding profile

* Use profiles in web UI / graphhopper maps (#2023)

Co-authored-by: Peter <graphhopper@gmx.de>

* Remove geocoding IT

* Rename: CHProfile -> CHConfig

* Rename: ProfileConfig -> Profile

* Rename: CHProfileConfig -> CHProfile

* Rename: LMProfile -> LMConfig

* Rename: LMProfileConfig -> LMProfile

* Minor adjustment in comment

* moved package from core/src/test/java/com/graphhopper/routing/profiles to ev #2016

* Update routing.md

* Rename: GraphModification -> QueryOverlay

* Remove AbstractRoutingTemplate#weighting field

* Rename: QueryGraph#lookup -> QueryGraph#create

* Rename: PrepareContractionHierarchies#getCHProfile -> getCHConfig

* Some minor cleanups in GraphHopper&RoutingTemplates

* Street-time parameter is Duration

* Rename: PathWrapper -> ResponsePath, fix #1147

* Fix typo

* Add compile error

* Fix compile error

* better estimate factor to store landmark weights more precise (#2027)

* no static factor for large areas to store landmark weights more precise

* further improve quality of max weight determination (increased prepare.lm.time should be acceptable)

* minor fix

* half number of landmarks from 6 to 3 in estimateMaxWeight to reduce prepare.lm.time by 10%

* minor test fix

* minor fix

* check profile if used for LM or CH preparation (#2026)

* check profile if used for LM or CH preparation

* cleanup

* first things after review

* include custom model in tests and use linkedhashmap for pmap to ensure same version

* minor javadocs fix

* ensure toString is not only used for debugging

* make it similar for Profile and CustomModel

* Update isochrone docs

* Update low level docs

* Update low-level-api.md, fix #2032

* Minor fix of comment in ch algo

* moved SPTEntry and ShortcutUnpacker to com.graphhopper.routing(.ch), #2016

* Add measurement info for subnetwork removal time

* Fix min one way network size parameter in benchmarks

* Use hppc.BitSet instead of java.util.BitSet for TarjanSCC as clearing bits is much faster, speeds up subnetwork removal.

* link to custom profiles

* Clean up TarjanSCC single node component handling (#2035)

* fix android build

* Enable surefire&failsafe plugins in parent poms

* apparently *IT.java tests were not even running before, probably since 0702206

* compared to the surefire plugin (which binds itself to the test phase) the failsafe plugin has to be added to the plugins section

* Rename: GraphHopperIT -> GraphHopperTest, RoutingAlgorithmWithOSMIT -> RoutingAlgorithmWithOSMTest

* android: we need to configure profiles

* workaround to force building JS until #1700 is fixed

* Update error message when u-turn costs are used with profile not supporting turn costs, fix #2040

* Revert took output to milliseconds

* Remove bogus constructor

* Add documentation about enabling turn costs via Java API, fix #2033

* Remove min_one_way_network parameter, clean up subnetwork removal (#2042)

* Improve logging during subnetwork removal and clean up PrepareRoutingSubnetworks
* Replace edge filter parameters with access encoded values only
* Remove second (BFS) subnetwork removal pass, finding strongly connected components once is enough
* Remove no longer needed min_one_way_network parameter

* Initialize ProfileResolver more lazily

* Remove isNodeRemoved check from Tarjan algo

* This is not needed because Tarjan is/should never (be) used on a graph with removed nodes

* Remove duplicate logs

* Replace Tarjan algorithm with slightly improved version

* no object allocation (TarjanState and EdgeExplorer) during search anymore
* use BitSet to represent single-node components (but this time correctly)
* keep versions with implicit and explicit recursion
* add some more tests

* Add edge-based version of Tarjan's SCC algorithm

* Revert "Add edge-based version of Tarjan's SCC algorithm" (tests are failing)

This reverts commit 3d3816a

* Revert "Replace Tarjan algorithm with slightly improved version" (tests are failing)

This reverts commit bf577d4

* graphhopper.sh: minor fix

* include npm as part of the maven cycle (#2041)

* include npm as part of the maven cycle but only for a specific mavenprofile

* adapt docs

* try destination of main.js in target/

* uh, adapt old config.yml - add a notice in changelog :)

* Replace Tarjan algorithm with slightly improved version

* no object allocation (TarjanState and EdgeExplorer) during search anymore
* use BitSet to represent single-node components (but this time correctly)
* keep algorithm in two versions with implicit and explicit recursion
* add some more tests

* Add edge-based version of Tarjan's SCC algorithm

(cherry picked from commit 3d3816a)

* Fix edge-keys for edge-based Tarjan

* Enforce allowWrites for GTFS files #2036:

- Load GTFS feeds DBs as readOnly if they already exists. A runtime exception will be thrown if the mapping in transit_schedule DB is not reflected in the folder.
- Validate write access (ensureWriteAccess()) before creating GTFS DBs.

* Use edge-based subnetwork removal if turn costs are enabled (#2044)

Co-authored-by: Andi <easbar.mail@posteo.net>
Co-authored-by: Peter <graphhopper@gmx.de>
Co-authored-by: Michael Zilske <michael.zilske@tu-berlin.de>
Co-authored-by: Mathieu St-Pierre <mathieu.st-pierre@curbside.com>
Co-authored-by: Robin <boldtrn@users.noreply.github.com>
Co-authored-by: gchevalier <gchevalier@expedia.com>
Co-authored-by: Oleksii Kirizii <oleksii@bikemap.net>
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.

Introduce configurable Weighting / CustomWeighting Truck profile
4 participants