private static VehicleRoutingAlgorithm buildAlgorithmFromScratch(VehicleRoutingProblem vrp) {
/*
* manages route and activity states.
*/
StateManager stateManager = new StateManager(vrp);
/*
* tells stateManager to update load states
*/
stateManager.updateLoadStates();
/*
* tells stateManager to update time-window states
*/
stateManager.updateTimeWindowStates();
/*
* stateManager.addStateUpdater(updater);
* lets you register your own stateUpdater
*/
/*
* updates variable costs once a vehicleRoute has changed (by removing or adding a customer)
*/
stateManager.addStateUpdater(new UpdateVariableCosts(vrp.getActivityCosts(), vrp.getTransportCosts(), stateManager));
/*
* constructs a constraintManager that manages the various hardConstraints (and soon also softConstraints)
*/
ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);