mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
remove deprecated code for next development iteration, i.e. release
1.3.0
This commit is contained in:
parent
3afae5de91
commit
3771c8494d
56 changed files with 173 additions and 1602 deletions
|
|
@ -20,7 +20,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
|
||||
import jsprit.core.algorithm.SearchStrategy.DiscoveredSolution;
|
||||
import jsprit.core.algorithm.acceptor.SolutionAcceptor;
|
||||
import jsprit.core.algorithm.listener.AlgorithmEndsListener;
|
||||
import jsprit.core.algorithm.listener.AlgorithmStartsListener;
|
||||
import jsprit.core.algorithm.listener.IterationEndsListener;
|
||||
|
|
@ -29,7 +28,6 @@ import jsprit.core.algorithm.listener.SearchStrategyListener;
|
|||
import jsprit.core.algorithm.listener.SearchStrategyModuleListener;
|
||||
import jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListener;
|
||||
import jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListeners;
|
||||
import jsprit.core.algorithm.termination.IterationWithoutImprovementTermination;
|
||||
import jsprit.core.algorithm.termination.PrematureAlgorithmTermination;
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.solution.VehicleRoutingProblemSolution;
|
||||
|
|
@ -121,20 +119,10 @@ public class VehicleRoutingAlgorithm {
|
|||
}
|
||||
|
||||
/**
|
||||
* Sets premature break.
|
||||
*
|
||||
* <p>This breaks the algorithm prematurely after the assigned number of iterations without improvement (see input parameter).
|
||||
* Improvement is what {@link SolutionAcceptor} understands about improvement. Or to put it in other words, the algo breaks prematurely after
|
||||
* the assigned number of iterations without solution-acceptance.
|
||||
*
|
||||
* @deprecated use setPrematureAlgorithmTermination(new IterationWithoutImprovementTermination(int nuIterationsWithoutImprovement));
|
||||
* @param nuIterationsWithoutImprovement
|
||||
* Sets premature termination.
|
||||
*
|
||||
* @param prematureAlgorithmTermination
|
||||
*/
|
||||
@Deprecated
|
||||
public void setPrematureBreak(int nuIterationsWithoutImprovement){
|
||||
prematureAlgorithmTermination = new IterationWithoutImprovementTermination(nuIterationsWithoutImprovement);
|
||||
}
|
||||
|
||||
public void setPrematureAlgorithmTermination(PrematureAlgorithmTermination prematureAlgorithmTermination){
|
||||
this.prematureAlgorithmTermination = prematureAlgorithmTermination;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ public class AlgorithmConfigXmlReader {
|
|||
/**
|
||||
* @param schemaValidation the schemaValidation to set
|
||||
*/
|
||||
public void setSchemaValidation(boolean schemaValidation) {
|
||||
public AlgorithmConfigXmlReader setSchemaValidation(boolean schemaValidation) {
|
||||
this.schemaValidation = schemaValidation;
|
||||
return this;
|
||||
}
|
||||
|
||||
public AlgorithmConfigXmlReader(AlgorithmConfig algorithmConfig){
|
||||
|
|
|
|||
|
|
@ -397,11 +397,6 @@ public class VehicleRoutingAlgorithms {
|
|||
return createAlgo(vrp,algorithmConfig.getXMLConfiguration(),0, null);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public static VehicleRoutingAlgorithm readAndCreateAlgorithm(final VehicleRoutingProblem vrp, final XMLConfiguration config){
|
||||
return createAlgo(vrp,config,0, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Read and creates a {@link VehicleRoutingAlgorithm} from an url.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ import jsprit.core.problem.solution.route.activity.ReverseActivityVisitor;
|
|||
import jsprit.core.problem.solution.route.activity.TourActivity;
|
||||
import jsprit.core.problem.solution.route.state.RouteAndActivityStateGetter;
|
||||
import jsprit.core.problem.solution.route.state.StateFactory;
|
||||
import jsprit.core.problem.solution.route.state.StateFactory.State;
|
||||
import jsprit.core.problem.solution.route.state.StateFactory.StateId;
|
||||
|
||||
/**
|
||||
|
|
@ -114,17 +113,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
|
||||
private boolean updateTWs = false;
|
||||
|
||||
/**
|
||||
* @deprecated use <code>StateManager(VehicleRoutingTransportCosts tpcosts)</code> instead.
|
||||
* @param vrp
|
||||
*/
|
||||
@Deprecated
|
||||
public StateManager(VehicleRoutingProblem vrp) {
|
||||
super();
|
||||
this.routingCosts = vrp.getTransportCosts();
|
||||
addDefaultStates();
|
||||
}
|
||||
|
||||
private void addDefaultStates() {
|
||||
defaultActivityStates_.put(StateFactory.LOAD, Capacity.Builder.newInstance().build());
|
||||
defaultActivityStates_.put(StateFactory.COSTS, 0.);
|
||||
|
|
@ -171,16 +159,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use the generic methode <code>addDefaultRouteState(StateId stateId, Class<T> type, T defaultState)</code> instead.
|
||||
* @param stateId
|
||||
* @param defaultState
|
||||
*/
|
||||
@Deprecated
|
||||
public void addDefaultRouteState(StateId stateId, State defaultState){
|
||||
addDefaultRouteState(stateId, State.class, defaultState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to add a default route state.
|
||||
*
|
||||
|
|
@ -197,16 +175,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
defaultRouteStates_.put(stateId, type.cast(defaultState));
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use generic method <code>addDefaultActivityState(StateId stateId, Class<T> type, T defaultState)</code>
|
||||
* @param stateId
|
||||
* @param defaultState
|
||||
*/
|
||||
@Deprecated
|
||||
public void addDefaultActivityState(StateId stateId, State defaultState){
|
||||
addDefaultActivityState(stateId, State.class, defaultState);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to add default activity state.
|
||||
*
|
||||
|
|
@ -229,23 +197,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
problemStates_.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @Deprecated use generic method instead <code>getActivityState(TourActivity act, StateId stateId, Class<T> type)</code>
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public State getActivityState(TourActivity act, StateId stateId) {
|
||||
if(!activityStates_.containsKey(act)){
|
||||
return getDefaultTypedActivityState(act,stateId,State.class);
|
||||
}
|
||||
States_ actStates = activityStates_.get(act);
|
||||
State state = actStates.getState(stateId, State.class);
|
||||
if(state == null){
|
||||
return getDefaultTypedActivityState(act,stateId,State.class);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns activity state of type 'type'.
|
||||
*
|
||||
|
|
@ -305,18 +256,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param act
|
||||
* @param stateId
|
||||
* @param state
|
||||
* @deprecated use generic method <code>putTypedActivityState(TourActivity act, StateId stateId, Class<T> type, T state)</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void putActivityState(TourActivity act, StateId stateId, State state){
|
||||
putTypedActivityState(act, stateId, State.class, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to memorize state 'state' of type 'type' of act and stateId.
|
||||
*
|
||||
|
|
@ -336,11 +275,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
putInternalTypedActivityState(act, stateId, type, state);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
void putInternalActivityState(TourActivity act, StateId stateId, State state){
|
||||
putInternalTypedActivityState(act, stateId, State.class, state);
|
||||
}
|
||||
|
||||
<T> void putInternalTypedActivityState(TourActivity act, StateId stateId, Class<T> type, T state){
|
||||
if(!activityStates_.containsKey(act)){
|
||||
activityStates_.put(act, new States_());
|
||||
|
|
@ -349,11 +283,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
actStates.putState(stateId, type, state);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
void putInternalRouteState(VehicleRoute route, StateId stateId, State state){
|
||||
putTypedInternalRouteState(route, stateId, State.class, state);
|
||||
}
|
||||
|
||||
<T> void putTypedInternalRouteState(VehicleRoute route, StateId stateId, Class<T> type, T state){
|
||||
if(!vehicleRouteStates_.containsKey(route)){
|
||||
vehicleRouteStates_.put(route, new States_());
|
||||
|
|
@ -362,11 +291,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
routeStates.putState(stateId, type, state);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void putRouteState(VehicleRoute route, StateId stateId, State state){
|
||||
putTypedRouteState(route, stateId, State.class, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generic method to memorize state 'state' of type 'type' of route and stateId.
|
||||
*
|
||||
|
|
@ -386,20 +310,6 @@ public class StateManager implements RouteAndActivityStateGetter, IterationStart
|
|||
putTypedInternalRouteState(route, stateId, type, state);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public State getRouteState(VehicleRoute route, StateId stateId) {
|
||||
if(!vehicleRouteStates_.containsKey(route)){
|
||||
return getDefaultTypedRouteState(stateId,State.class);
|
||||
}
|
||||
States_ routeStates = vehicleRouteStates_.get(route);
|
||||
State state = routeStates.getState(stateId,State.class);
|
||||
if(state == null){
|
||||
return getDefaultTypedRouteState(stateId, State.class);
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds state updater.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ import jsprit.core.problem.vehicle.VehicleTypeKey;
|
|||
import jsprit.core.util.Coordinate;
|
||||
import jsprit.core.util.CrowFlyCosts;
|
||||
import jsprit.core.util.Locations;
|
||||
import jsprit.core.util.Neighborhood;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
@ -64,20 +63,6 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class VehicleRoutingProblem {
|
||||
|
||||
/**
|
||||
* Overall problem constraints.
|
||||
*
|
||||
* <p>DELIVERIES_FIRST corresponds to the vehicle routing problem with back hauls, i.e. before a vehicle is not entirely unloaded, no pickup can be made.
|
||||
*
|
||||
* @deprecated define and add constraint directly with .addConstraint(...) - since constraints are too diverse to put them in an enum
|
||||
* @author stefan
|
||||
*
|
||||
*/
|
||||
@Deprecated
|
||||
public enum Constraint {
|
||||
DELIVERIES_FIRST
|
||||
}
|
||||
|
||||
/**
|
||||
* Builder to build the routing-problem.
|
||||
*
|
||||
|
|
@ -109,49 +94,27 @@ public class VehicleRoutingProblem {
|
|||
|
||||
};
|
||||
|
||||
private Map<String,Job> jobs;
|
||||
private Map<String,Job> jobs = new HashMap<String, Job>();
|
||||
|
||||
private Map<String,Job> tentativeJobs = new HashMap<String,Job>();
|
||||
|
||||
private Set<String> jobsInInitialRoutes = new HashSet<String>();
|
||||
|
||||
private Collection<Service> services;
|
||||
private Collection<Service> services = new ArrayList<Service>();
|
||||
|
||||
private Map<String, Coordinate> coordinates;
|
||||
private Map<String, Coordinate> coordinates = new HashMap<String, Coordinate>();
|
||||
|
||||
private Map<String, Coordinate> tentative_coordinates = new HashMap<String, Coordinate>();
|
||||
|
||||
private FleetSize fleetSize = FleetSize.INFINITE;
|
||||
|
||||
/**
|
||||
* @deprecated is not going to be used anymore
|
||||
*/
|
||||
private FleetComposition fleetComposition = FleetComposition.HOMOGENEOUS;
|
||||
|
||||
private Collection<VehicleType> vehicleTypes;
|
||||
private Collection<VehicleType> vehicleTypes = new ArrayList<VehicleType>();
|
||||
|
||||
private Collection<VehicleRoute> initialRoutes = new ArrayList<VehicleRoute>();
|
||||
|
||||
private Set<Vehicle> uniqueVehicles = new HashSet<Vehicle>();
|
||||
|
||||
/**
|
||||
* @deprecated is not going to be used anymore
|
||||
*/
|
||||
private Collection<Constraint> problemConstraints;
|
||||
|
||||
private Collection<jsprit.core.problem.constraint.Constraint> constraints;
|
||||
|
||||
/**
|
||||
* by default all locations are neighbors
|
||||
* @deprecated is not going to be used anymore
|
||||
*/
|
||||
private Neighborhood neighborhood = new Neighborhood() {
|
||||
|
||||
@Override
|
||||
public boolean areNeighbors(String location1, String location2) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
private Collection<jsprit.core.problem.constraint.Constraint> constraints = new ArrayList<jsprit.core.problem.constraint.Constraint>();
|
||||
|
||||
private boolean addPenaltyVehicles = false;
|
||||
|
||||
|
|
@ -159,20 +122,6 @@ public class VehicleRoutingProblem {
|
|||
|
||||
private Double penaltyFixedCosts = null;
|
||||
|
||||
/**
|
||||
* @deprecated use static method .newInstance() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder() {
|
||||
jobs = new HashMap<String, Job>();
|
||||
new ArrayList<Vehicle>();
|
||||
coordinates = new HashMap<String, Coordinate>();
|
||||
vehicleTypes = new ArrayList<VehicleType>();
|
||||
services = new ArrayList<Service>();
|
||||
problemConstraints = new ArrayList<VehicleRoutingProblem.Constraint>();
|
||||
constraints = new ArrayList<jsprit.core.problem.constraint.Constraint>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a location (i.e. coordinate) and returns the key of the location which is Coordinate.toString().
|
||||
*
|
||||
|
|
@ -517,43 +466,15 @@ public class VehicleRoutingProblem {
|
|||
return Collections.unmodifiableCollection(tentativeJobs.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets an unmodifiable collection of already added services.
|
||||
*
|
||||
* @return collection of services
|
||||
* @deprecated use .getAddedJobs() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public Collection<Service> getAddedServices(){
|
||||
return Collections.unmodifiableCollection(services);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the fleetComposition.
|
||||
*
|
||||
* <p>FleetComposition is either FleetComposition.HETEROGENEOUS or FleetComposition.HOMOGENEOUS
|
||||
*
|
||||
* @deprecated has no effect
|
||||
* @param fleetComposition
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder setFleetComposition(FleetComposition fleetComposition){
|
||||
this.fleetComposition = fleetComposition;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a service to jobList.
|
||||
*
|
||||
* <p>If jobList already contains service, a warning message is printed, and the existing job will be overwritten.
|
||||
*
|
||||
* @deprecated use addJob(...) instead
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder addService(Service service){
|
||||
private Builder addService(Service service){
|
||||
coordinates.put(service.getLocationId(), service.getCoord());
|
||||
if(jobs.containsKey(service.getId())){ logger.warn("service " + service + " already in job list. overrides existing job."); }
|
||||
jobs.put(service.getId(),service);
|
||||
|
|
@ -561,41 +482,7 @@ public class VehicleRoutingProblem {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a vehicleType.
|
||||
*
|
||||
* @deprecated use add vehicle instead
|
||||
* @param type
|
||||
* @return builder
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder addVehicleType(VehicleType type){
|
||||
vehicleTypes.add(type);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the neighborhood.
|
||||
*
|
||||
* @deprecated use HardRoute- or ActivityLevelConstraint instead
|
||||
* @param neighborhood
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder setNeighborhood(Neighborhood neighborhood){
|
||||
this.neighborhood = neighborhood;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use .addConstraint(new ServiceDeliveriesFirstConstraint())
|
||||
* @param constraint
|
||||
*/
|
||||
@Deprecated
|
||||
public void addProblemConstraint(Constraint constraint){
|
||||
if(!problemConstraints.contains(constraint)) problemConstraints.add(constraint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -664,33 +551,14 @@ public class VehicleRoutingProblem {
|
|||
|
||||
private final Locations locations;
|
||||
|
||||
/**
|
||||
* @deprecated not used anymore
|
||||
*/
|
||||
private Neighborhood neighborhood;
|
||||
|
||||
/**
|
||||
* An enum that indicates fleetSizeComposition. By default, it is HOMOGENOUS.
|
||||
* @deprecated
|
||||
*/
|
||||
private FleetComposition fleetComposition;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
private Collection<Constraint> problemConstraints;
|
||||
|
||||
private VehicleRoutingProblem(Builder builder) {
|
||||
this.jobs = builder.jobs;
|
||||
this.fleetComposition = builder.fleetComposition;
|
||||
this.fleetSize = builder.fleetSize;
|
||||
this.vehicles=builder.uniqueVehicles;
|
||||
this.vehicleTypes = builder.vehicleTypes;
|
||||
this.initialVehicleRoutes = builder.initialRoutes;
|
||||
this.transportCosts = builder.transportCosts;
|
||||
this.activityCosts = builder.activityCosts;
|
||||
this.neighborhood = builder.neighborhood;
|
||||
this.problemConstraints = builder.problemConstraints;
|
||||
this.constraints = builder.constraints;
|
||||
this.locations = builder.getLocations();
|
||||
logger.info("initialise " + this);
|
||||
|
|
@ -776,37 +644,5 @@ public class VehicleRoutingProblem {
|
|||
public Locations getLocations(){
|
||||
return locations;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns fleet-composition.
|
||||
*
|
||||
* @return fleetComposition which is either FleetComposition.HETEROGENEOUS or FleetComposition.HOMOGENEOUS
|
||||
* @deprecated it is not used and thus has no effect
|
||||
*/
|
||||
@Deprecated
|
||||
public FleetComposition getFleetComposition() {
|
||||
return fleetComposition;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated see builder.setNeighborhood(...). addConstraint(...) instead.
|
||||
* @return the neighborhood
|
||||
*/
|
||||
@Deprecated
|
||||
public Neighborhood getNeighborhood() {
|
||||
return neighborhood;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns unmodifiable collection of problem-constraints.
|
||||
*
|
||||
* @deprecated use .getConstraints() and builder.add
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public Collection<Constraint> getProblemConstraints(){
|
||||
return Collections.unmodifiableCollection(problemConstraints);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.VehicleRoutingProblem.Constraint;
|
||||
import jsprit.core.problem.misc.JobInsertionContext;
|
||||
import jsprit.core.problem.solution.route.activity.TourActivity;
|
||||
import jsprit.core.problem.solution.route.state.RouteAndActivityStateGetter;
|
||||
|
|
@ -19,7 +18,6 @@ import org.apache.log4j.Logger;
|
|||
* @author schroeder
|
||||
*
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ConstraintManager implements HardActivityStateLevelConstraint, HardRouteStateLevelConstraint, SoftActivityConstraint, SoftRouteConstraint{
|
||||
|
||||
public static enum Priority {
|
||||
|
|
@ -91,9 +89,6 @@ public class ConstraintManager implements HardActivityStateLevelConstraint, Hard
|
|||
|
||||
public void addLoadConstraint(){
|
||||
if(!loadConstraintsSet){
|
||||
if(vrp.getProblemConstraints().contains(Constraint.DELIVERIES_FIRST)){
|
||||
addConstraint(new ServiceDeliveriesFirstConstraint(),Priority.HIGH);
|
||||
}
|
||||
addConstraint(new PickupAndDeliverShipmentLoadActivityLevelConstraint(stateManager),Priority.CRITICAL);
|
||||
addConstraint(new ServiceLoadRouteLevelConstraint(stateManager));
|
||||
addConstraint(new ServiceLoadActivityLevelConstraint(stateManager),Priority.LOW);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import jsprit.core.problem.VehicleRoutingProblem;
|
||||
import jsprit.core.problem.VehicleRoutingProblem.FleetComposition;
|
||||
import jsprit.core.problem.VehicleRoutingProblem.FleetSize;
|
||||
import jsprit.core.problem.driver.Driver;
|
||||
import jsprit.core.problem.driver.DriverImpl;
|
||||
|
|
@ -56,8 +55,6 @@ import org.xml.sax.EntityResolver;
|
|||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class VrpXMLReader{
|
||||
|
||||
public interface ServiceBuilderFactory {
|
||||
|
|
@ -69,15 +66,15 @@ public class VrpXMLReader{
|
|||
@Override
|
||||
public jsprit.core.problem.job.Service.Builder createBuilder(String serviceType, String id, Integer size) {
|
||||
if(serviceType.equals("pickup")){
|
||||
if(size != null) return Pickup.Builder.newInstance(id, size);
|
||||
if(size != null) return Pickup.Builder.newInstance(id).addSizeDimension(0, size);
|
||||
else return Pickup.Builder.newInstance(id);
|
||||
}
|
||||
else if(serviceType.equals("delivery")){
|
||||
if(size != null) return Delivery.Builder.newInstance(id, size);
|
||||
if(size != null) return Delivery.Builder.newInstance(id).addSizeDimension(0, size);
|
||||
else return Delivery.Builder.newInstance(id);
|
||||
}
|
||||
else{
|
||||
if(size != null) return Service.Builder.newInstance(id, size);
|
||||
if(size != null) return Service.Builder.newInstance(id).addSizeDimension(0, size);
|
||||
else return Service.Builder.newInstance(id);
|
||||
|
||||
}
|
||||
|
|
@ -367,14 +364,6 @@ public class VrpXMLReader{
|
|||
if(fleetSize == null) vrpBuilder.setFleetSize(FleetSize.INFINITE);
|
||||
else if(fleetSize.toUpperCase().equals(FleetSize.INFINITE.toString())) vrpBuilder.setFleetSize(FleetSize.INFINITE);
|
||||
else vrpBuilder.setFleetSize(FleetSize.FINITE);
|
||||
|
||||
String fleetComposition = vrpProblem.getString("problemType.fleetComposition");
|
||||
if(fleetComposition == null) vrpBuilder.setFleetComposition(FleetComposition.HOMOGENEOUS);
|
||||
else if(fleetComposition.toUpperCase().equals(FleetComposition.HETEROGENEOUS.toString())){
|
||||
vrpBuilder.setFleetComposition(FleetComposition.HETEROGENEOUS);
|
||||
}
|
||||
else vrpBuilder.setFleetComposition(FleetComposition.HOMOGENEOUS);
|
||||
|
||||
}
|
||||
|
||||
private void readShipments(XMLConfiguration config){
|
||||
|
|
@ -394,7 +383,7 @@ public class VrpXMLReader{
|
|||
|
||||
Shipment.Builder builder;
|
||||
if(capacityString != null){
|
||||
builder = Shipment.Builder.newInstance(id, Integer.parseInt(capacityString));
|
||||
builder = Shipment.Builder.newInstance(id).addSizeDimension(0, Integer.parseInt(capacityString));
|
||||
}
|
||||
else {
|
||||
builder = Shipment.Builder.newInstance(id);
|
||||
|
|
@ -563,7 +552,7 @@ public class VrpXMLReader{
|
|||
|
||||
VehicleTypeImpl.Builder typeBuilder;
|
||||
if(capacityString != null){
|
||||
typeBuilder = VehicleTypeImpl.Builder.newInstance(typeId, Integer.parseInt(capacityString));
|
||||
typeBuilder = VehicleTypeImpl.Builder.newInstance(typeId).addCapacityDimension(0, Integer.parseInt(capacityString));
|
||||
}
|
||||
else {
|
||||
typeBuilder = VehicleTypeImpl.Builder.newInstance(typeId);
|
||||
|
|
|
|||
|
|
@ -268,10 +268,8 @@ public class VrpXMLWriter {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void writeProblemType(XMLConfiguration xmlConfig){
|
||||
xmlConfig.setProperty("problemType.fleetSize", vrp.getFleetSize());
|
||||
xmlConfig.setProperty("problemType.fleetComposition", vrp.getFleetComposition());
|
||||
}
|
||||
|
||||
private void writeVehiclesAndTheirTypes(XMLConfiguration xmlConfig) {
|
||||
|
|
|
|||
|
|
@ -27,23 +27,6 @@ public class Delivery extends Service{
|
|||
|
||||
public static class Builder extends Service.Builder {
|
||||
|
||||
/**
|
||||
* Returns a new instance of Delivery.Builder
|
||||
*
|
||||
* @param id
|
||||
* @param size
|
||||
* @return builder
|
||||
* @throws IllegalArgumentException if size < 0 or id is null
|
||||
* @deprecated use <code>.newInstance(String id)</code> instead, and add a capacity dimension
|
||||
* with dimensionIndex='your index' and and dimsionValue=size to the returned builder
|
||||
*/
|
||||
@Deprecated
|
||||
public static Builder newInstance(String id, int size){
|
||||
Builder builder = new Builder(id,size);
|
||||
builder.addSizeDimension(0, size);
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of builder that builds a delivery.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -33,17 +33,6 @@ public interface Job {
|
|||
* @return id
|
||||
*/
|
||||
public String getId();
|
||||
|
||||
/**
|
||||
* Returns capacity (demand) of job.
|
||||
*
|
||||
* <p>It determines how much capacity this job consumes of vehicle/transport unit.
|
||||
*
|
||||
* @deprecated use <code>.getCapacity()</code> instead
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public int getCapacityDemand();
|
||||
|
||||
/**
|
||||
* Returns size, i.e. capacity-demand, of this job which can consist of an arbitrary number of capacity dimensions.
|
||||
|
|
|
|||
|
|
@ -27,23 +27,6 @@ public class Pickup extends Service {
|
|||
|
||||
public static class Builder extends Service.Builder {
|
||||
|
||||
/**
|
||||
* Returns a new instance of Pickup.Builder
|
||||
*
|
||||
* @param id
|
||||
* @param size
|
||||
* @return builder
|
||||
* @throws IllegalArgumentException if size < 0 or id is null
|
||||
* @deprecated use <code>.newInstance(String id)</code> instead, and add a capacity dimension
|
||||
* with dimensionIndex='your index' and and dimsionValue=size to the returned builder
|
||||
*/
|
||||
@Deprecated
|
||||
public static Builder newInstance(String id, int size){
|
||||
Builder builder = new Builder(id,size);
|
||||
builder.addSizeDimension(0, size);
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of builder that builds a pickup.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -41,25 +41,6 @@ public class Service implements Job {
|
|||
*/
|
||||
public static class Builder {
|
||||
|
||||
/**
|
||||
* Returns a new instance of service-builder.
|
||||
*
|
||||
* <p>Note that if you use this builder, size is assigned to capacity-dimension with index=0.
|
||||
*
|
||||
* @param id of service
|
||||
* @param size of capacity-demand
|
||||
* @return builder
|
||||
* @throws IllegalArgumentException if size < 0 or id is null
|
||||
* @deprecated use <code>.newInstance(String id)</code> instead, and add a capacity dimension
|
||||
* with dimensionIndex='your index' and and dimsionValue=size to the returned builder
|
||||
*/
|
||||
@Deprecated
|
||||
public static Builder newInstance(String id, int size){
|
||||
Builder builder = new Builder(id,size);
|
||||
builder.addSizeDimension(0, size);
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new instance of builder that builds a service.
|
||||
*
|
||||
|
|
@ -267,17 +248,6 @@ public class Service implements Job {
|
|||
return timeWindow;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Deprecated use <code>.getCapacity()</code> instead. if you still use this method, it returns the
|
||||
* capacity dimension with index=0.
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getCapacityDemand() {
|
||||
return size.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the name
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -54,24 +54,11 @@ public class Shipment implements Job{
|
|||
private Capacity capacity;
|
||||
|
||||
/**
|
||||
* Returns a new instance of this builder.
|
||||
*
|
||||
* <p>Note that if you use this builder, size is assigned to capacity-dimension with index=0.
|
||||
* Returns new instance of this builder.
|
||||
*
|
||||
* @param id
|
||||
* @param size
|
||||
* @return builder
|
||||
* @throws IllegalArgumentException if size < 0 or id is null
|
||||
* @deprecated use <code>.newInstance(String id)</code> instead, and add a capacity dimension
|
||||
* with dimensionIndex='your index' and and dimsionValue=size to the returned builder
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static Builder newInstance(String id, int size){
|
||||
Builder builder = new Builder(id,size);
|
||||
builder.addSizeDimension(0, size);
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static Builder newInstance(String id){
|
||||
return new Builder(id);
|
||||
}
|
||||
|
|
@ -90,6 +77,7 @@ public class Shipment implements Job{
|
|||
}
|
||||
|
||||
Builder(String id){
|
||||
if(id == null) throw new IllegalArgumentException("id must not be null");
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
@ -289,16 +277,6 @@ public class Shipment implements Job{
|
|||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Deprecated use <code>.getCapacity()</code> instead. if you still use this method, it returns the
|
||||
* capacity dimension with index=0.
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getCapacityDemand() {
|
||||
return capacity.get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the pickup-location.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -58,20 +58,6 @@ public class VehicleRoute {
|
|||
return new VehicleRoute(route);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a newInstance of {@link VehicleRoute}.
|
||||
*
|
||||
* @param tour
|
||||
* @param driver
|
||||
* @param vehicle
|
||||
* @return VehicleRoute
|
||||
* @deprecated use VehicleRoute.Builder instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static VehicleRoute newInstance(TourActivities tour, Driver driver, Vehicle vehicle) {
|
||||
return new VehicleRoute(tour,driver,vehicle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an empty route.
|
||||
*
|
||||
|
|
@ -356,16 +342,6 @@ public class VehicleRoute {
|
|||
this.driver = route.getDriver();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
private VehicleRoute(TourActivities tour, Driver driver, Vehicle vehicle) {
|
||||
super();
|
||||
verify(tour, driver, vehicle);
|
||||
this.tourActivities = tour;
|
||||
this.vehicle = vehicle;
|
||||
this.driver = driver;
|
||||
setStartAndEnd(vehicle, vehicle.getEarliestDeparture());
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs route.
|
||||
*
|
||||
|
|
@ -379,22 +355,6 @@ public class VehicleRoute {
|
|||
this.end = builder.end;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tour
|
||||
* @param driver
|
||||
* @param vehicle
|
||||
* @deprecated verification is a task of VehicleRoute.Builder
|
||||
*/
|
||||
@Deprecated
|
||||
private void verify(TourActivities tour, Driver driver, Vehicle vehicle) {
|
||||
if(tour == null || driver == null || vehicle == null) throw new IllegalStateException("null is not allowed for tour, driver or vehicle. use emptyRoute. use Tour.emptyTour, DriverImpl.noDriver() and VehicleImpl.noVehicle() instead." +
|
||||
"\n\tor make it easier and use VehicleRoute.emptyRoute()");
|
||||
if(!tour.isEmpty() && vehicle instanceof NoVehicle){
|
||||
throw new IllegalStateException("if tour is not empty. there must be a vehicle for this tour, but there is no vehicle.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an unmodifiable list of activities on this route (without start/end).
|
||||
*
|
||||
|
|
@ -450,29 +410,6 @@ public class VehicleRoute {
|
|||
this.vehicle = vehicle;
|
||||
setStartAndEnd(vehicle, vehicleDepTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the vehicle and its departureTime from <code>vehicle.getStartLocationId()</code>.
|
||||
*
|
||||
* <p>This implies the following:<br>
|
||||
* if start and end are null, new start and end activities are created.<br>
|
||||
* <p>startActivity is initialized with the start-location of the specified vehicle (<code>vehicle.getStartLocationId()</code>). the time-window of this activity is initialized
|
||||
* such that [<code>startActivity.getTheoreticalEarliestOperationStartTime()</code> = <code>vehicle.getEarliestDeparture()</code>][<code>startActivity.getTheoreticalLatestOperationStartTime()</code> = <code>vehicle.getLatestArrival()</code>]
|
||||
* <p>endActivity is initialized with the end-location of the specified vehicle (<code>vehicle.getEndLocationId()</code>). The time-window of the
|
||||
* endActivity is initialized such that [<code>endActivity.getTheoreticalEarliestOperationStartTime()</code> = <code>vehicle.getEarliestDeparture()</code>][<code>endActivity.getTheoreticalLatestOperationStartTime()</code> = <code>vehicle.getLatestArrival()</code>]
|
||||
* <p>startActivity.endTime (<code>startActivity.getEndTime()</code>) is set to max{<code>vehicle.getEarliestDeparture()</code>, <code>vehicleDepTime</code>}.
|
||||
* thus, <code>vehicle.getEarliestDeparture()</code> is a physical constraint that has to be met.
|
||||
*
|
||||
* @param vehicle
|
||||
* @param vehicleDepTime
|
||||
* @deprecated use .setVehicleAndDepartureTime(Vehicle vehicle, double vehicleDepTime) instead
|
||||
*/
|
||||
@Deprecated
|
||||
public void setVehicle(Vehicle vehicle, double vehicleDepTime){
|
||||
this.vehicle = vehicle;
|
||||
setStartAndEnd(vehicle, vehicleDepTime);
|
||||
}
|
||||
|
||||
private void setStartAndEnd(Vehicle vehicle, double vehicleDepTime) {
|
||||
if(!(vehicle instanceof NoVehicle)){
|
||||
if(start == null && end == null){
|
||||
|
|
@ -490,19 +427,6 @@ public class VehicleRoute {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets departureTime of this route, i.e. the time the vehicle departs from its start-location.
|
||||
*
|
||||
* @param vehicleDepTime
|
||||
* @deprecated use .setVehicleAndDepartureTime(...) instead (vehicle requires departureTime and the other way around, and earliestDepartureTime
|
||||
* of a vehicle is a physical constraint of the vehicle and cannot be broken. Using this method might break this constraint.)
|
||||
*/
|
||||
@Deprecated
|
||||
public void setDepartureTime(double vehicleDepTime){
|
||||
if(start == null) throw new IllegalStateException("cannot set departureTime without having a vehicle on this route. use setVehicle(vehicle,departureTime) instead.");
|
||||
start.setEndTime(vehicleDepTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the departureTime of this vehicle in this route.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -26,15 +26,6 @@ public final class DeliverService implements DeliveryActivity{
|
|||
capacity = deliveryActivity.getSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use <code>getCapacity()</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getCapacityDemand() {
|
||||
return delivery.getCapacityDemand()*-1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return delivery.getType();
|
||||
|
|
|
|||
|
|
@ -32,15 +32,6 @@ public final class DeliverShipment implements DeliveryActivity{
|
|||
return shipment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use <code>getCapacity()</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getCapacityDemand() {
|
||||
return shipment.getCapacityDemand()*-1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "deliverShipment";
|
||||
|
|
|
|||
|
|
@ -133,11 +133,6 @@ public final class End implements TourActivity {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacityDemand() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TourActivity duplicate() {
|
||||
return new End(this);
|
||||
|
|
|
|||
|
|
@ -82,16 +82,6 @@ public final class PickupService implements PickupActivity{
|
|||
return pickup;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use <code>getCapacity()</code> instead
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getCapacityDemand() {
|
||||
return pickup.getCapacityDemand();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "[type="+getName()+"][locationId=" + getLocationId()
|
||||
+ "][size=" + getSize().toString()
|
||||
|
|
|
|||
|
|
@ -28,15 +28,6 @@ public final class PickupShipment implements PickupActivity{
|
|||
return shipment;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use <code>getCapacity()</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getCapacityDemand() {
|
||||
return shipment.getCapacityDemand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "pickupShipment";
|
||||
|
|
|
|||
|
|
@ -119,15 +119,6 @@ public class ServiceActivity implements JobActivity{
|
|||
return service.getTimeWindow().getEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use <code>getCapacity()</code> instead
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getCapacityDemand() {
|
||||
return service.getCapacityDemand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getOperationTime() {
|
||||
return service.getServiceDuration();
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package jsprit.core.problem.solution.route.activity;
|
||||
|
||||
import jsprit.core.problem.Capacity;
|
||||
import jsprit.core.util.Coordinate;
|
||||
|
||||
public final class Start implements TourActivity {
|
||||
|
||||
|
|
@ -38,8 +37,6 @@ public final class Start implements TourActivity {
|
|||
|
||||
private String locationId;
|
||||
|
||||
private Coordinate coordinate;
|
||||
|
||||
private double theoretical_earliestOperationStartTime;
|
||||
|
||||
private double theoretical_latestOperationStartTime;
|
||||
|
|
@ -64,16 +61,6 @@ public final class Start implements TourActivity {
|
|||
endTime = start.getEndTime();
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
Coordinate getCoordinate() {
|
||||
return coordinate;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
void setCoordinate(Coordinate coordinate) {
|
||||
this.coordinate = coordinate;
|
||||
}
|
||||
|
||||
public double getTheoreticalEarliestOperationStartTime() {
|
||||
return theoretical_earliestOperationStartTime;
|
||||
}
|
||||
|
|
@ -136,11 +123,6 @@ public final class Start implements TourActivity {
|
|||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacityDemand() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TourActivity duplicate() {
|
||||
return new Start(this);
|
||||
|
|
|
|||
|
|
@ -48,16 +48,6 @@ public interface TourActivity {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the capacity-demand of that activity, in terms of what needs to be loaded or unloaded at
|
||||
* this activity.
|
||||
*
|
||||
* @return int
|
||||
* @deprecated use <code>getCapacity()</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
public int getCapacityDemand();
|
||||
|
||||
/**
|
||||
* Returns the name of this activity.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,17 +18,10 @@ package jsprit.core.problem.solution.route.state;
|
|||
|
||||
import jsprit.core.problem.solution.route.VehicleRoute;
|
||||
import jsprit.core.problem.solution.route.activity.TourActivity;
|
||||
import jsprit.core.problem.solution.route.state.StateFactory.State;
|
||||
import jsprit.core.problem.solution.route.state.StateFactory.StateId;
|
||||
|
||||
public interface RouteAndActivityStateGetter {
|
||||
|
||||
@Deprecated
|
||||
public State getActivityState(TourActivity act, StateId stateId);
|
||||
|
||||
@Deprecated
|
||||
public State getRouteState(VehicleRoute route, StateId stateId);
|
||||
|
||||
public <T> T getActivityState(TourActivity act, StateId stateId, Class<T> type);
|
||||
|
||||
public <T> T getRouteState(VehicleRoute route, StateId stateId, Class<T> type);
|
||||
|
|
|
|||
|
|
@ -79,22 +79,6 @@ class InfiniteVehicles implements VehicleFleetManager{
|
|||
return types.values();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getAvailableVehicles(Vehicle withoutThisType) instead
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Collection<Vehicle> getAvailableVehicles(String withoutThisType, String locationId) {
|
||||
Collection<Vehicle> vehicles = new ArrayList<Vehicle>();
|
||||
VehicleTypeKey thisKey = new VehicleTypeKey(withoutThisType, locationId,locationId, 0., 0.);
|
||||
for(VehicleTypeKey key : types.keySet()){
|
||||
if(!key.equals(thisKey)){
|
||||
vehicles.add(types.get(key));
|
||||
}
|
||||
}
|
||||
return vehicles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Vehicle> getAvailableVehicles(Vehicle withoutThisType) {
|
||||
Collection<Vehicle> vehicles = new ArrayList<Vehicle>();
|
||||
|
|
|
|||
|
|
@ -45,15 +45,6 @@ public class PenaltyVehicleType implements VehicleType{
|
|||
return type.getTypeId();
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use <code>getCapacityDimensions()</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return type.getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleCostParams getVehicleCostParams() {
|
||||
return type.getVehicleCostParams();
|
||||
|
|
|
|||
|
|
@ -41,28 +41,6 @@ public interface Vehicle {
|
|||
*/
|
||||
public abstract double getLatestArrival();
|
||||
|
||||
/**
|
||||
* Returns the location-id of the this vehicle which should be the start-location of this vehicle.
|
||||
*
|
||||
* <p> Consequently, it should be the end-location of this vehicle, if returnToDepot is true.
|
||||
*
|
||||
* @return location-id of this vehicle
|
||||
* @deprecated use getStartLocationId() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract String getLocationId();
|
||||
|
||||
/**
|
||||
* Returns the coordinate of this vehicle which should be the coordinate of the start-location of this vehicle.
|
||||
*
|
||||
* <p> Consequently, it should be the coordinate of the end-location, if returnToDepot is true.
|
||||
*
|
||||
* @return coordinate of this vehicle
|
||||
* @deprecated use getStartLocationCoordinate() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract Coordinate getCoord();
|
||||
|
||||
/**
|
||||
* Returns the {@link VehicleType} of this vehicle.
|
||||
*
|
||||
|
|
@ -77,17 +55,6 @@ public interface Vehicle {
|
|||
*/
|
||||
public abstract String getId();
|
||||
|
||||
/**
|
||||
* Returns the capacity of this vehicle.
|
||||
*
|
||||
* @return capacity
|
||||
* @deprecated use .getType().getCapacityDimensions() - if you still use this method,
|
||||
* but set capacity-dimensions via <code>VehicleTypeImpl.Builder.newInstance(...).addCapacityDimension(...)</code> then this method returns the
|
||||
* dimension with index=0.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract int getCapacity();
|
||||
|
||||
/**
|
||||
* Returns true if vehicle returns to depot, false otherwise.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -62,16 +62,6 @@ public interface VehicleFleetManager {
|
|||
* @return
|
||||
*/
|
||||
public abstract Collection<Vehicle> getAvailableVehicles();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param withoutThisType
|
||||
* @param locationId
|
||||
* @return
|
||||
* @deprecated use .getAvailableVehicles(Vehicle without) instead. this might ignore withoutType and returns all available vehicles
|
||||
*/
|
||||
@Deprecated
|
||||
public Collection<Vehicle> getAvailableVehicles(String withoutThisType, String locationId);
|
||||
|
||||
public Collection<Vehicle> getAvailableVehicles(Vehicle withoutThisType);
|
||||
|
||||
|
|
|
|||
|
|
@ -173,38 +173,6 @@ class VehicleFleetManagerImpl implements VehicleFleetManager {
|
|||
return vehicles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a collection of available vehicles without vehicles with typeId 'withoutThisType' and locationId 'withThisLocation'.
|
||||
*
|
||||
* <p>If there is no vehicle with a certain type and location anymore, it looks up whether a penalty vehicle has been specified with
|
||||
* this type and location. If so, it returns this penalty vehicle. If not, no vehicle with this type and location is returned.
|
||||
*
|
||||
* @param typeId to specify the typeId that should not be the returned collection
|
||||
* @param locationId to specify the locationId that should not be in the returned collection
|
||||
* @return collection of available vehicles without the vehicles that have the typeId 'withoutThisType' AND the locationId 'withThisLocation'.
|
||||
* @deprecated use .getAvailableVehicles(Vehicle without) instead - this might ignore withoutThisType and returns all available vehicles
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Collection<Vehicle> getAvailableVehicles(String withoutThisType, String withThisLocationId) {
|
||||
List<Vehicle> vehicles = new ArrayList<Vehicle>();
|
||||
VehicleTypeKey thisKey = new VehicleTypeKey(withoutThisType, withThisLocationId, withThisLocationId, 0., 0.);
|
||||
for(VehicleTypeKey key : typeMapOfAvailableVehicles.keySet()){
|
||||
if(key.equals(thisKey)) continue;
|
||||
if(!typeMapOfAvailableVehicles.get(key).isEmpty()){
|
||||
vehicles.add(typeMapOfAvailableVehicles.get(key).getVehicle());
|
||||
}
|
||||
else{
|
||||
if(penaltyVehicles.containsKey(key)){
|
||||
vehicles.add(penaltyVehicles.get(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
return vehicles;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<Vehicle> getAvailableVehicles(Vehicle withoutThisType) {
|
||||
List<Vehicle> vehicles = new ArrayList<Vehicle>();
|
||||
|
|
|
|||
|
|
@ -30,16 +30,6 @@ import org.apache.log4j.Logger;
|
|||
|
||||
public class VehicleImpl implements Vehicle {
|
||||
|
||||
/**
|
||||
* @deprecated use createNoVehicle() instead.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static NoVehicle noVehicle(){
|
||||
return createNoVehicle();
|
||||
}
|
||||
|
||||
/**
|
||||
* Extension of {@link VehicleImpl} representing an unspecified vehicle with the id 'noVehicle'
|
||||
* (to avoid null).
|
||||
|
|
@ -48,14 +38,9 @@ public class VehicleImpl implements Vehicle {
|
|||
*
|
||||
*/
|
||||
public static class NoVehicle extends VehicleImpl {
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public NoVehicle() {
|
||||
super(Builder.newInstance("noVehicle").setType(VehicleTypeImpl.newInstance(null, 0, null)));
|
||||
}
|
||||
|
||||
public int getCapacity(){
|
||||
return 0;
|
||||
public NoVehicle() {
|
||||
super(Builder.newInstance("noVehicle").setType(VehicleTypeImpl.Builder.newInstance("noType").build()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -129,38 +114,6 @@ public class VehicleImpl implements Vehicle {
|
|||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets location-id of the vehicle which should be its start-location.
|
||||
*
|
||||
* <p>If returnToDepot is true, it is also its end-location.
|
||||
*
|
||||
* @param id
|
||||
* @return this builder
|
||||
* @deprecated use setStartLocationId(..) instead
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder setLocationId(String id){
|
||||
this.locationId = id;
|
||||
this.startLocationId = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets coordinate of the vehicle which should be the coordinate of start-location.
|
||||
*
|
||||
* <p>If returnToDepot is true, it is also the coordinate of the end-location.
|
||||
*
|
||||
* @param coord
|
||||
* @return this builder
|
||||
* @deprecated use setStartLocationCoordinate(...) instead
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder setLocationCoord(Coordinate coord){
|
||||
this.locationCoord = coord;
|
||||
this.startLocationCoord = coord;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start-location of this vehicle.
|
||||
*
|
||||
|
|
@ -334,14 +287,6 @@ public class VehicleImpl implements Vehicle {
|
|||
return "[id="+id+"][type="+type+"][locationId="+locationId+"][coord=" + coord + "][isReturnToDepot=" + isReturnToDepot() + "]";
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getStartLocationCoordinate() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public Coordinate getCoord() {
|
||||
return coord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEarliestDeparture() {
|
||||
return earliestDeparture;
|
||||
|
|
@ -352,15 +297,6 @@ public class VehicleImpl implements Vehicle {
|
|||
return latestArrival;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getStartLocationId() instead
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public String getLocationId() {
|
||||
return locationId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public VehicleType getType() {
|
||||
return type;
|
||||
|
|
@ -371,12 +307,6 @@ public class VehicleImpl implements Vehicle {
|
|||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getCapacity() {
|
||||
return type.getCapacity();
|
||||
}
|
||||
|
||||
public boolean isReturnToDepot() {
|
||||
return returnToDepot;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,19 +34,6 @@ public interface VehicleType {
|
|||
*/
|
||||
public String getTypeId();
|
||||
|
||||
/**
|
||||
* Returns capacity.
|
||||
*
|
||||
* <p>In future versions there will be a capacity-object with an arbitrary number of capacity dimensions. (stefan,11.01.14)
|
||||
*
|
||||
*
|
||||
* @deprecated use <code>.getCapacityDimensions()</code> - if you still use it, but set CapacityDimensions rather
|
||||
* than setCapacity(...) it will return the capacity.dimension with index=0
|
||||
* @return cap
|
||||
*/
|
||||
@Deprecated
|
||||
public int getCapacity();
|
||||
|
||||
/**
|
||||
* Returns capacity dimensions.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -66,31 +66,10 @@ public class VehicleTypeImpl implements VehicleType {
|
|||
*/
|
||||
public static class Builder{
|
||||
|
||||
/**
|
||||
* Returns a new instance.
|
||||
*
|
||||
* <p>Input parameters are id and capacity. Note that two vehicle-types are equal
|
||||
* if they have the same vehicleId.
|
||||
*
|
||||
* @param id
|
||||
* @param capacity
|
||||
* @return the vehicleType builder
|
||||
* @throws IllegalStateException if capacity is smaller than zero or id is null
|
||||
* @deprecated use <code>newInstance(String id)</code> instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static VehicleTypeImpl.Builder newInstance(String id, int capacity){
|
||||
if(capacity < 0) throw new IllegalStateException("capacity cannot be smaller than zero");
|
||||
if(id == null) throw new IllegalStateException("typeId must be null");
|
||||
Builder builder = new Builder(id,capacity);
|
||||
builder.addCapacityDimension(0, capacity);
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static VehicleTypeImpl.Builder newInstance(String id) {
|
||||
if(id==null) throw new IllegalStateException();
|
||||
return new Builder(id);
|
||||
}
|
||||
|
||||
|
||||
private String id;
|
||||
private int capacity = 0;
|
||||
|
|
@ -108,20 +87,7 @@ public class VehicleTypeImpl implements VehicleType {
|
|||
|
||||
private boolean dimensionAdded = false;
|
||||
|
||||
/**
|
||||
* Constructs the builder.
|
||||
*
|
||||
* @param id
|
||||
* @param capacity
|
||||
*/
|
||||
@Deprecated
|
||||
private Builder(String id, int capacity) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public Builder(String id) {
|
||||
private Builder(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
|
@ -271,15 +237,6 @@ public class VehicleTypeImpl implements VehicleType {
|
|||
private final Capacity capacityDimensions;
|
||||
|
||||
private final double maxVelocity;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated use builder instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static VehicleTypeImpl newInstance(String typeId, int capacity, VehicleTypeImpl.VehicleCostParams para){
|
||||
return new VehicleTypeImpl(typeId, capacity, para);
|
||||
}
|
||||
|
||||
/**
|
||||
* priv constructor constructing vehicle-type
|
||||
|
|
@ -294,23 +251,6 @@ public class VehicleTypeImpl implements VehicleType {
|
|||
capacityDimensions = builder.capacityDimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use Builder.newInstance(...) instead.
|
||||
*
|
||||
* @param typeId
|
||||
* @param capacity
|
||||
* @param vehicleCostParams
|
||||
*/
|
||||
@Deprecated
|
||||
public VehicleTypeImpl(String typeId, int capacity,VehicleTypeImpl.VehicleCostParams vehicleCostParams) {
|
||||
super();
|
||||
this.typeId = typeId;
|
||||
this.capacity = capacity;
|
||||
this.vehicleCostParams = vehicleCostParams;
|
||||
this.capacityDimensions = Capacity.Builder.newInstance().addDimension(0, capacity).build();
|
||||
this.maxVelocity = Double.MAX_VALUE;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see basics.route.VehicleType#getTypeId()
|
||||
*/
|
||||
|
|
@ -319,15 +259,6 @@ public class VehicleTypeImpl implements VehicleType {
|
|||
return typeId;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see basics.route.VehicleType#getCapacity()
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public int getCapacity() {
|
||||
return capacityDimensions.get(0);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see basics.route.VehicleType#getVehicleCostParams()
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -140,39 +140,4 @@ public class SolutionPrinter {
|
|||
return new Jobs(nServices,nShipments);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Prints the details of the solution according to a print-level, i.e. Print.CONCISE or PRINT.VERBOSE.
|
||||
// *
|
||||
// * <p>CONCISE prints total-costs and #vehicles.
|
||||
// * <p>VERBOSE prints the route-details additionally. If the DefaultVehicleRouteCostCalculator (which is the standard-calculator)
|
||||
// * is used in VehicleRoute, then route-costs are differentiated further between transport, activity, vehicle, driver and other-costs.
|
||||
// *
|
||||
// * @param solution
|
||||
// * @param level
|
||||
// *
|
||||
// * @deprecated is not going to work anymore
|
||||
// */
|
||||
// @Deprecated
|
||||
// public static void print(VehicleRoutingProblemSolution solution, Print level){
|
||||
// if(level.equals(Print.CONCISE)){
|
||||
// print(solution);
|
||||
// }
|
||||
// else{
|
||||
// print(solution);
|
||||
// System.out.println("routes");
|
||||
// int routeCount = 1;
|
||||
// for(VehicleRoute route : solution.getRoutes()){
|
||||
// System.out.println("[route="+routeCount+"][departureTime="+route.getStart().getEndTime()+"[total=" + route.getCost() + "]");
|
||||
// if(route.getVehicleRouteCostCalculator() instanceof DefaultVehicleRouteCostCalculator){
|
||||
// DefaultVehicleRouteCostCalculator defaultCalc = (DefaultVehicleRouteCostCalculator) route.getVehicleRouteCostCalculator();
|
||||
// System.out.println("[transport=" + defaultCalc.getTpCosts() + "][activity=" + defaultCalc.getActCosts() +
|
||||
// "][vehicle=" + defaultCalc.getVehicleCosts() + "][driver=" + defaultCalc.getDriverCosts() + "][other=" + defaultCalc.getOther() + "]");
|
||||
// }
|
||||
// routeCount++;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,23 +23,6 @@ import jsprit.core.problem.solution.VehicleRoutingProblemSolution;
|
|||
|
||||
public class Solutions {
|
||||
|
||||
/**
|
||||
*
|
||||
* @deprecated use bestOf instead.
|
||||
* @param solutions
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
public static VehicleRoutingProblemSolution getBest(Collection<VehicleRoutingProblemSolution> solutions){
|
||||
VehicleRoutingProblemSolution best = null;
|
||||
for(VehicleRoutingProblemSolution s : solutions){
|
||||
if(best == null) best = s;
|
||||
else if(s.getCost() < best.getCost()) best = s;
|
||||
}
|
||||
return best;
|
||||
}
|
||||
|
||||
|
||||
public static VehicleRoutingProblemSolution bestOf(Collection<VehicleRoutingProblemSolution> solutions){
|
||||
VehicleRoutingProblemSolution best = null;
|
||||
for(VehicleRoutingProblemSolution s : solutions){
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
</xs:element>
|
||||
<xs:element name="fleetComposition">
|
||||
<xs:element name="fleetComposition" minOccurs="0" maxOccurs="1">
|
||||
<xs:simpleType>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="HOMOGENEOUS" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue