static ImmutableList<Double> decomposedCost(GlobalStateObject state, ImmutableList<ImmutableList<Parcel>> schedule, ObjectiveFunction objFunc) { final ImmutableList.Builder<Double> builder = ImmutableList.builder(); for (int i = 0; i < schedule.size(); i++) { builder.add(objFunc.computeCost(Solvers.computeStats( state.withSingleVehicle(i), ImmutableList.of(schedule.get(i))))); } return builder.build(); }
@Override public double computeCost(GlobalStateObject context, int routeIndex, ImmutableList<Parcel> newRoute) { return objectiveFunction.computeCost(Solvers.computeStats( context.withSingleVehicle(routeIndex), ImmutableList.of(newRoute))); } }
final GlobalStateObject state = solverHandle.get().convert( SolveArgs.create().noCurrentRoutes().useParcels(parcels)); final double baseline = objectiveFunction.computeCost(Solvers.computeStats( state, ImmutableList.of(currentRoute))); final double newCost = objectiveFunction.computeCost(Solvers.computeStats( state, ImmutableList.of(ImmutableList.copyOf(newRoute))));
final double newCost = objectiveFunction.computeCost( Solvers.computeStats(state, schedule));
static double decomposedCost(GlobalStateObject gso, ImmutableList<ImmutableList<Parcel>> routes, ObjectiveFunction objFunc) { double sum = 0d; for (int i = 0; i < gso.getVehicles().size(); i++) { sum += objFunc.computeCost(Solvers.computeStats(gso.withSingleVehicle(i), ImmutableList.of(routes.get(i)))); } return sum; }
final double baseline = objectiveFunction.computeCost(stats); double lowestCost = baseline; @Nullable newRoute.addAll(currentRoute); newRoute.removeAll(Collections.singleton(sp)); final double cost = objectiveFunction.computeCost( Solvers.computeStats(state, ImmutableList.of(ImmutableList.copyOf(newRoute))));
final double absCost = objFunc.computeCost(Solvers .computeStats(state.withSingleVehicle(i), ImmutableList.of(r)));
.fixRoutes() .useParcels(parcels)); final double baseline = objectiveFunction.computeCost( Solvers.computeStats(state, ImmutableList.of(currentRoute)));
final double cost = builder.getObjectiveFunction().computeCost(stats)
final double cost = objFunc.computeCost(stats); final double cost0 = objFunc.computeCost(Solvers.computeStats( state.withSingleVehicle(0), ImmutableList.of(routes.get(0)))); final double cost1 = objFunc.computeCost(Solvers.computeStats( state.withSingleVehicle(1), ImmutableList.of(routes.get(1))));