rinde.sim.pdptw.central.arrays.SingleVehicleArraysSolver Maven / Gradle / Ivy
package rinde.sim.pdptw.central.arrays;
import javax.annotation.Nullable;
/**
* Interface for solvers for the single vehicle pickup-and-delivery problem with
* time windows (SPDPTW). This interface uses int
arrays for
* specification of the inputs and outputs.
*
* Note that usage of this interface is not recommended. The
* {@link rinde.sim.pdptw.central.Solver} interface provides exactly the same
* functionality but in a type safe manner.
* @author Rinde van Lon
*/
public interface SingleVehicleArraysSolver {
/**
* Gives a solution for the single vehicle PDPTW as specified by the
* parameters. The returned solution does not necessarily need to be optimal
* but it needs to be feasible. The {@link ArraysSolverValidator} can check
* whether a {@link SingleVehicleArraysSolver} produces a valid solution and
* it can check whether the parameters for the
* {@link SingleVehicleArraysSolver} are valid.
*
* All times are in units relative to the current time (0). All constraints
* are soft, i.e. lateness at service locations and at depot are allowed. The
* start location has index 0, the end location (depot) has index n-1.
*
* @param travelTime n x n
distance matrix expressed in time:
* travelTime[i][j]
specifies travelTime from location
* i
to location j
.
* @param releaseDates specifies the left side of the time window for every
* location (hard constraint, earlier is not allowed).
* @param dueDates specifies the right side of the time window for every
* location (soft constraint, lateness is allowed).
* @param servicePairs n x 2
matrix of service location pairs,
* servicePairs[i][0]
and
* servicePairs[i][1]
specify the pickup and delivery
* location respectively. Each location may occur at maximum once in
* the matrix (either as an pickup or as a delivery).
* @param serviceTimes specifies the service time for all locations (both
* pickups and deliveries).
* @param currentSolution If defined it contains the current route of the
* vehicle. This can be used as a starting point for a new solution.
* If any new parcels have become known since this current solution
* was computed these parcels will not be part of the
* solutions. This means that these solutions may not be feasible
* solutions and thus require adaptation.
* @return The solution object which indicates a (usually the best found)
* solution for the single vehicle PDPTW.
*/
SolutionObject solve(int[][] travelTime, int[] releaseDates, int[] dueDates,
int[][] servicePairs, int[] serviceTimes,
@Nullable SolutionObject currentSolution);
}