VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(vrp,"input/algorithmConfig.xml");
vraBuilder.addDefaultCostCalculators();
vraBuilder.addCoreConstraints();
StateManager stateManager = new StateManager(vrp);
StateId keyPicked = stateManager.createStateId("key-picked");
StateId keyUsed = stateManager.createStateId("key-used");
StateId keyDelivered = stateManager.createStateId("key-delivered");
stateManager.addStateUpdater(new KeyStatusUpdater(stateManager,keyPicked,keyUsed,keyDelivered));
ConstraintManager constraintManager = new ConstraintManager(vrp,stateManager);
constraintManager.addConstraint(new GetUseAndDeliverKeySimpleHardActivityConstraint(stateManager,keyPicked,keyUsed,keyDelivered), ConstraintManager.Priority.CRITICAL);
constraintManager.addConstraint(new GetUseAndDeliverHardRouteContraint(stateManager,keyPicked,keyUsed,keyDelivered));