Custom models - There is no-longer the option to set vehicle, how is this now handled?
v7.0 new CustomProfile("paxster").setCustomModel(new CustomModel(getPaxsterModel())).setVehicle("foot")
v9.0 new Profile("paxster").setCustomModel(new CustomModel(getPaxsterModel()))
(no setVehicle)
Where getPaxsterModel is
private static CustomModel getPaxsterModel(){
CustomModel model = new CustomModel();
model.addToPriority(If("road_class == CONSTRUCTION", MULTIPLY, "1.0"));
return model;
}
Using the following I’ve attempted to change to using custom models via the suggested .json profiles, but end up getting stuck (as I have in the past) with setting up the config.yml.
CustomModel model = new CustomModel();
model.setDistanceInfluence(10.0);
model.addToSpeed(If("true", LIMIT, "car_average_speed"));
new Profile("paxster").setCustomModel(new CustomModel(getPaxsterModel()))
.setEncodedValuesString("foot|block_private=false,car|block_private=false|turn_costs=true")
.setEncodedValuesString("road_access, road_class, car_average_speed");
Now with; model.addToPriority(If("road_class == CONSTRUCTION", MULTIPLY, "1.0"));
Error
File ‘priority entry’, Line 3, Column 29: “CONSTRUCTION” is neither a method, a field, nor a member class of “com.graphhopper.routing.ev.RoadClass”