I search some use custom profile example in github ,but i can’t run the application.
Graphhopper version is 7.0.
Here is my code:
customModel = new CustomModel();
customModel.setDistanceInfluence(90d);
customModel.addToPriority(If("road_class == MOTORWAY", MULTIPLY, "0.1"));
GraphHopper hopper = new GraphHopper();
hopper.setOSMFile(dataFile.getAbsolutePath());
hopper.setGraphHopperLocation(parentPath + File.separator + cacheName + File.separator);
// see docs/core/profiles.md to learn more about profiles
Profile profile = new CustomProfile("car_custom").setCustomModel(customModel).setVehicle("car").setWeighting("custom");
hopper.setProfiles(profile);
hopper.getLMPreparationHandler().setLMProfiles(new LMProfile("car_custom"));
// now this can take minutes if it imports or a few seconds for loading of course this is dependent on the area you import
hopper.importOrLoad();
ERROR
java.lang.NoSuchFieldError: typeParameters
at com.graphhopper.routing.weighting.custom.CustomModelParser.injectStatements(CustomModelParser.java:435)
at com.graphhopper.routing.weighting.custom.CustomModelParser.access$100(CustomModelParser.java:41)
at com.graphhopper.routing.weighting.custom.CustomModelParser$2.copyMethodDeclarator(CustomModelParser.java:418)
at org.codehaus.janino.util.DeepCopier.copyPackageMemberClassDeclaration(DeepCopier.java:593)
at org.codehaus.janino.util.DeepCopier$3.visitPackageMemberClassDeclaration(DeepCopier.java:207)
at org.codehaus.janino.util.DeepCopier$3.visitPackageMemberClassDeclaration(DeepCopier.java:202)
type or paste code here