@Override public void run() { LOGGER.trace( "calling RealtimeSolver.receiveSnapshot(..) sim time: {}", state.getTime()); solver.receiveSnapshot(state); } });
/** * Constructs a new {@link GlobalStateObject} using the routes specified. * @param routes The routes to use, this will replace any existing routes in * the vehicles. Exactly one route must be specified for each * vehicle. * @return A newly constructed {@link GlobalStateObject} that only differs * from the current object in the vehicles' routes. */ public GlobalStateObject withRoutes( ImmutableList<ImmutableList<Parcel>> routes) { checkArgument(routes.size() == getVehicles().size()); final ImmutableList.Builder<VehicleStateObject> b = ImmutableList.builder(); for (int i = 0; i < getVehicles().size(); i++) { b.add(getVehicles().get(i).withRoute(routes.get(i))); } return create(getAvailableParcels(), b.build(), getTime(), getTimeUnit(), getSpeedUnit(), getDistUnit(), getRoadModelSnapshot()); }
/** * Constructs a new {@link GlobalStateObject} with only the selected vehicle. * The current instance remains unchanged. * @param index The index of the vehicle to select. * @return A new object containing only the selected vehicle, all other values * are copied from this instance. */ public GlobalStateObject withSingleVehicle(int index) { checkArgument(index >= 0 && index < getVehicles().size(), "Invalid vehicle index (%s) must be >= 0 and < %s.", index, getVehicles().size()); return create(getAvailableParcels(), ImmutableList.of(getVehicles().get(index)), getTime(), getTimeUnit(), getSpeedUnit(), getDistUnit(), getRoadModelSnapshot()); }
final long simulationTime = stats.maxTime - state.getTime();
&& state.getTime() - auct.getLastUnsuccessTime() <= reauctionCooldownPeriod) { LOGGER.trace("Not reauctioning, was unsuccessful too recently"); baseline - lowestCost); final DoubleBid initialBid = DoubleBid.create(state.getTime(), decorator, toSwap, bidValue); auct.auctionParcel(decorator, state.getTime(), initialBid, new Listener() { @Override
checkArgument(state.getDistUnit().equals(DISTANCE_UNIT)); final PDPSolution problem = new PDPSolution(state.getTime());
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof GlobalStateObject) { GlobalStateObject that = (GlobalStateObject) o; return (this.availableParcels.equals(that.getAvailableParcels())) && (this.vehicles.equals(that.getVehicles())) && (this.time == that.getTime()) && (this.timeUnit.equals(that.getTimeUnit())) && (this.speedUnit.equals(that.getSpeedUnit())) && (this.distUnit.equals(that.getDistUnit())) && (this.roadModelSnapshot.equals(that.getRoadModelSnapshot())); } return false; }
final SolutionObject sol = sols[j]; final long[] arraysArrivalTimes = incrArr(sol.arrivalTimes, solverInput.getTime()); final long[] arrivalTimes = Longs.toArray(stats.arrivalTimes.get(j)); assertArrayEquals(arraysArrivalTimes, arrivalTimes);
state.getAvailableParcels(), vehicleList.build(), state.getTime(), state.getTimeUnit(), state.getSpeedUnit(),
index2parcelBuilder.put(deliveryIndex, pio); final int[] tw = convertTW(p.getPickupTimeWindow(), state.getTime(), timeConverter); releaseDates[index] = tw[0]; final int[] tw = convertTW(p.getDeliveryTimeWindow(), state.getTime(), timeConverter); releaseDates[index] = tw[0]; state.getTime(), timeConverter);
final ImmutableList.Builder<Long> truckArrivalTimesBuilder = ImmutableList.builder(); truckArrivalTimesBuilder.add(state.getTime()); long time = state.getTime(); Point vehicleLocation = vso.getLocation(); final Measure<Double, Velocity> maxSpeed = stats.arrivalTimesBuilder.add(truckArrivalTimesBuilder.build()); if (time > state.getTime()) {