Hello guys,
I’ve been trying to create a new custom profile for big trucks, but when I activate the profile and put the graphhopper to run, I got the following error log.
java.lang.IllegalArgumentException: Could not create weighting for profile: 'big_truck'.
Profile: name=big_truck|turn_costs={null}|weighting=custom|hints={custom_model_files=[big_truck.json], custom_model=distanceInfluence=null|headingPenalty=null|speedStatements=[{"if": "max_height < 4.5", "multiply_by": 0.5}, {"if": "max_weight < 40", "multiply_by": 0.5}, {"else": "null", "multiply_by": 1.0}]|priorityStatements=[{"if": "road_class == MOTORWAY", "multiply_by": 1.5}, {"if": "road_class == TRUNK", "multiply_by": 1.3}, {"if": "road_class == PRIMARY", "multiply_by": 1.2}, {"if": "max_width < 3 || max_height < 4", "multiply_by": 0.01}, {"if": "max_weight < 18", "multiply_by": 0.01}, {"else": "null", "multiply_by": 1.0}]|areas=[]}
Error: Cannot compile expression: The first block needs to contain a single unconditional 'if' statement (or end with an 'else').
Here’s my big_truck.json custom model:
{
"priority": [
{
"if": "road_class == MOTORWAY",
"multiply_by": "1.5"
},
{
"if": "road_class == TRUNK",
"multiply_by": "1.3"
},
{
"if": "road_class == PRIMARY",
"multiply_by": "1.2"
},
{
"if": "max_width < 3 || max_height < 4",
"multiply_by": "0.01"
},
{
"if": "max_weight < 18",
"multiply_by": "0.01"
},
{
"else": "",
"multiply_by": "1.0"
}
],
"speed": [
{
"if": "max_height < 4.5",
"multiply_by": "0.5"
},
{
"if": "max_weight < 40",
"multiply_by": "0.5"
},
{
"else": "",
"multiply_by": "1.0"
}
]
}
any ideia about whats been happening?