From c4d2e65992200cfbaafb751e29e68b804c6befe8 Mon Sep 17 00:00:00 2001 From: oblonski <4sschroeder@gmail.com> Date: Sat, 28 Dec 2013 08:25:30 +0100 Subject: [PATCH] add javadoc --- .../core/problem/VehicleRoutingProblem.java | 109 ++++++++++-------- .../jsprit/core/problem/io/VrpXMLWriter.java | 1 + 2 files changed, 63 insertions(+), 47 deletions(-) diff --git a/jsprit-core/src/main/java/jsprit/core/problem/VehicleRoutingProblem.java b/jsprit-core/src/main/java/jsprit/core/problem/VehicleRoutingProblem.java index 5dfdcb97..80377132 100644 --- a/jsprit-core/src/main/java/jsprit/core/problem/VehicleRoutingProblem.java +++ b/jsprit-core/src/main/java/jsprit/core/problem/VehicleRoutingProblem.java @@ -112,23 +112,23 @@ public class VehicleRoutingProblem { private FleetSize fleetSize = FleetSize.INFINITE; - /* - * @deprecated is not going to be used anymore - */ + /** + * @deprecated is not going to be used anymore + */ private FleetComposition fleetComposition = FleetComposition.HOMOGENEOUS; private Collection vehicleTypes; - /** - * @deprecated is not going to be used anymore - */ + /** + * @deprecated is not going to be used anymore + */ private Collection problemConstraints; private Collection constraints; /** * by default all locations are neighbors - * @deprecated is not going to be used anymore + * @deprecated is not going to be used anymore */ private Neighborhood neighborhood = new Neighborhood() { @@ -346,25 +346,25 @@ public class VehicleRoutingProblem { return this; } + /** + * Returns an unmodifiable collection of already added jobs. + * + * @return collection of jobs + */ + public Collection getAddedJobs(){ + return Collections.unmodifiableCollection(jobs.values()); + } + /** * Gets an unmodifiable collection of already added services. * * @return collection of services - * @deprecated use .getAddedJobs() instead + * @deprecated use .getAddedJobs() instead */ - @Deprecated + @Deprecated public Collection getAddedServices(){ return Collections.unmodifiableCollection(services); } - - /** - * Returns an unmodifiable collection of already added jobs. - * - * @return collection of jobs - */ - public Collection getAddedJobs(){ - return Collections.unmodifiableCollection(jobs.values()); - } /** * Sets the fleetComposition. @@ -457,17 +457,24 @@ public class VehicleRoutingProblem { HETEROGENEOUS, HOMOGENEOUS; } - private static Logger logger = Logger.getLogger(VehicleRoutingProblem.class); + /** + * logger logging for this class + */ + private final static Logger logger = Logger.getLogger(VehicleRoutingProblem.class); - private VehicleRoutingTransportCosts transportCosts; + /** + * contains transportation costs, i.e. the costs traveling from location A to B + */ + private final VehicleRoutingTransportCosts transportCosts; - private VehicleRoutingActivityCosts activityCosts; - - /** - * @deprecated not used anymore - */ - private Neighborhood neighborhood; + /** + * contains activity costs, i.e. the costs imposed by an activity + */ + private final VehicleRoutingActivityCosts activityCosts; + /** + * map of jobs, stored by jobId + */ private final Map jobs; /** @@ -478,26 +485,34 @@ public class VehicleRoutingProblem { /** * Collection that contains all available types. */ - private Collection vehicleTypes; + private final Collection vehicleTypes; /** * An enum that indicates type of fleetSize. By default, it is INFINTE */ - private FleetSize fleetSize = FleetSize.INFINITE; + private final FleetSize fleetSize; + /** + * contains all constraints + */ + private final Collection constraints; + + /** + * @deprecated not used anymore + */ + private Neighborhood neighborhood; + /** * An enum that indicates fleetSizeComposition. By default, it is HOMOGENOUS. - * @deprecated + * @deprecated */ private FleetComposition fleetComposition; - - /** - * deprecated - */ + + /** + * @deprecated + */ private Collection problemConstraints; - - private Collection constraints; - + private VehicleRoutingProblem(Builder builder) { this.jobs = builder.jobs; this.fleetComposition = builder.fleetComposition; @@ -518,17 +533,6 @@ public class VehicleRoutingProblem { "transportCost="+transportCosts+"][activityCosts="+activityCosts+"]"; } - /** - * 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; - } - /** * Returns type of fleetSize, either INFINITE or FINITE. * @@ -596,6 +600,17 @@ public class VehicleRoutingProblem { return Collections.unmodifiableCollection(constraints); } + /** + * 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 diff --git a/jsprit-core/src/main/java/jsprit/core/problem/io/VrpXMLWriter.java b/jsprit-core/src/main/java/jsprit/core/problem/io/VrpXMLWriter.java index 01ab1d30..231779d1 100644 --- a/jsprit-core/src/main/java/jsprit/core/problem/io/VrpXMLWriter.java +++ b/jsprit-core/src/main/java/jsprit/core/problem/io/VrpXMLWriter.java @@ -218,6 +218,7 @@ public class VrpXMLWriter { } } + @SuppressWarnings("deprecation") private void writeProblemType(XMLConfiguration xmlConfig){ xmlConfig.setProperty("problemType.fleetSize", vrp.getFleetSize()); xmlConfig.setProperty("problemType.fleetComposition", vrp.getFleetComposition());