You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to implement a hard route constraint that depends on the route cost and duration, however the route duration is always returned as null. The route costs return is OK.
jsprit version 1.7.3
var stateManager = new StateManager(problem);
HardRouteConstraint customConstraint = insertionContext -> {
var route = insertionContext.getRoute();
var routeDuration = stateManager.getRouteState(route, InternalStates.DURATION, Double.class);
var routeCosts = stateManager.getRouteState(route, InternalStates.COSTS, Double.class);
...
}
var constraintManager = new ConstraintManager(problem, stateManager);
constraintManager.addConstraint(customConstraint);
The text was updated successfully, but these errors were encountered:
@briandilley It works, but the states are accessible only in constraints.
I need to access a few states for the best solution found. I can use the SolutionAnalyser to get built-in states but there's no way I can add my custom StateUpdaters to the analyzer. The only way I've found is just copy-pate the analyser code, add my updaters to its statesManager.
Is there a better way of doing it ?
Hi,
Trying to implement a hard route constraint that depends on the route cost and duration, however the route duration is always returned as null. The route costs return is OK.
jsprit version 1.7.3
The text was updated successfully, but these errors were encountered: