diff --git a/README.md b/README.md index 27b2fedf..4255b26f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ jsprit ====== [![Build Status](https://travis-ci.org/graphhopper/jsprit.svg?branch=master)](https://travis-ci.org/graphhopper/jsprit) -jsprit is a java based, open source toolkit for solving rich traveling salesman (TSP) and vehicle routing problems (VRP). -It is lightweight, flexible and easy-to-use, and based on a single all-purpose meta-heuristic currently solving +jsprit is a java based, open source toolkit for solving rich [Traveling Salesman Problems(TSP)](http://en.wikipedia.org/wiki/Travelling_salesman_problem") and [Vehicle Routing Problems(VRP)](http://neo.lcc.uma.es/vrp/vehicle-routing-problem/). +It is lightweight, flexible and easy-to-use, and based on a single all-purpose [meta-heuristic](../docs/Meta-Heuristic.md) currently solving + - Capacitated VRP - Multiple Depot VRP - VRP with Time Windows @@ -16,10 +17,10 @@ It is lightweight, flexible and easy-to-use, and based on a single all-purpose < - Various combination of these types Setting up the problem, defining additional constraints, modifying the algorithms and visualising the discovered solutions is as easy and handy as -reading classical VRP instances to benchmark your algorithm. It is fit for change and extension due to a modular design and a comprehensive set of unit and integration-tests. [More features ...](https://github.com/jsprit/jsprit/wiki/features) +reading classical VRP instances to benchmark your algorithm. It is fit for change and extension due to a modular design and a comprehensive set of unit and integration-tests. [More features ...](../docs/Features.textile) -## Getting Started and Documentation -Please visit [docs](https://github.com/graphhopper/jsprit/blob/master/docs/Home.md) to learn more. For older versions (jsprit then it is easier to keep track of your topic. @@ -51,7 +52,7 @@ You can also use [stackoverflow](http://stackoverflow.com/questions/tagged/jspri For bugs, feature requests or similar use the [issue tracker](https://github.com/jsprit/jsprit/issues). #### Email: -If you cannot get help in the mailing list or you just do not want to discuss your topic publicly, contact us via https://graphhopper.com/#contact +If you cannot get help in the mailing list or you just do not want to discuss your topic publicly, [contact us via mail](https://graphhopper.com/#contact) ## About diff --git a/docs/Classical-Problems-Examples.md b/docs/Classical-Problems-Examples.md index 67e44f95..2ae34087 100644 --- a/docs/Classical-Problems-Examples.md +++ b/docs/Classical-Problems-Examples.md @@ -1,9 +1,9 @@ -- Capacitated VRP -- Multiple Depot VRP -- VRP with Time Windows -- VRP with Backhauls (Deliveries first) -- VRP with Backhauls (mixed Pickups and Deliveries) -- VRP with Pickups and Deliveries -- VRP with Heterogeneous Fleet -- Traveling Salesman Problem -- Dial-a-Ride Problem \ No newline at end of file +- Capacitated VRP +- Multiple Depot VRP +- VRP with Time Windows +- VRP with Backhauls (Deliveries first) +- VRP with Backhauls (mixed Pickups and Deliveries) +- VRP with Pickups and Deliveries +- VRP with Heterogeneous Fleet +- Traveling Salesman Problem +- Dial-a-Ride Problem \ No newline at end of file diff --git a/docs/Dial-a-ride-problem.md b/docs/Dial-a-ride-problem.md index 6b678523..b94a5f3e 100644 --- a/docs/Dial-a-ride-problem.md +++ b/docs/Dial-a-ride-problem.md @@ -1 +1 @@ -You model a dial-a-ride problem much like a vehicle routing problem with pickups and deliveries. The capacity of vehicles can be interpreted as number of seats available. A shipment is here understood as a ride from one location to another (probably you want the shipment to have a capacity-demand of 1). See [VRP with pickups and deliveries](https://github.com/jsprit/jsprit/wiki/VRP-with-pickups-and-deliveries). \ No newline at end of file +You model a dial-a-ride problem much like a vehicle routing problem with pickups and deliveries. The capacity of vehicles can be interpreted as number of seats available. A shipment is here understood as a ride from one location to another (probably you want the shipment to have a capacity-demand of 1). See [VRP with pickups and deliveries](../docs/Vrp-with-pickups-and-deliveries.md). \ No newline at end of file diff --git a/docs/Getting-Started.md b/docs/Getting-Started.md index ac5af692..aea9645f 100644 --- a/docs/Getting-Started.md +++ b/docs/Getting-Started.md @@ -1,7 +1,7 @@ -####Requirements +#### Requirements jsprit requires Java 1.7.0 or later. -####Modules +#### Modules jsprit is a multi-module project and consists of: - jsprit-core - jsprit-analysis @@ -9,19 +9,20 @@ jsprit is a multi-module project and consists of: - jsprit-examples - jsprit-io -####Maven way +#### Maven way If you want to use the latest release of jsprit-core, add the following lines to your pom: -
<dependency>
+```
+<dependency>
    <groupId>com.graphhopper</groupId>
    <artifactId>jsprit-core</artifactId>
    <version>{version}</version>
 </dependency>
-
+``` -Find the latest versions here: [mvn repository](https://mvnrepository.com/artifact/com.graphhopper/jsprit-core). +Find the latest versions here: [mvn repository](https://mvnrepository.com/artifact/com.graphhopper/jsprit-core) -####Build yourself +#### Build yourself If you want to build the master branch yourself, do this: ``` @@ -30,7 +31,7 @@ cd jsprit mvn clean install ``` -####If you do not have an IDE and you want to use Maven +#### If you do not have an IDE and you want to use Maven the following documentation is recommended: @@ -39,6 +40,7 @@ the following documentation is recommended: Here you learn to setup the Java environment and an Integrated Development Environment (IDE). In the subsection Adding Jars to your Project you learn to integrate external libraries in your project. Just copy/paste the above jsprit releases/snapshots to your pom.xml instead of the GeoTools-artifacts. #### If you do not want Maven + to manage your dependencies, go to [maven central](https://search.maven.org/), search for jsprit and download the latest binaries to put them into your classpath. Go ahead and show me a [simple example](Simple-Example.md) of how to setup and solve a vehicle routing problem. diff --git a/docs/VRP-with-time-windows-example.md b/docs/VRP-with-time-windows-example.md index 5a768916..5c5a4e6d 100644 --- a/docs/VRP-with-time-windows-example.md +++ b/docs/VRP-with-time-windows-example.md @@ -108,4 +108,4 @@ Collection solutions = algorithm.searchSolutions( VehicleRoutingProblemSolution bestSolution = Solutions.bestOf(solutions); -Please visit Simple Example to get to know how you can analyse the solution. \ No newline at end of file +Please visit [Simple Example](https://github.com/graphhopper/jsprit/blob/master/jsprit-examples/src/main/java/com/graphhopper/jsprit/examples/SimpleExample.java) to get to know how you can analyse the solution. \ No newline at end of file diff --git a/docs/Walkthrough Constraints.md b/docs/Walkthrough Constraints.md index d37d2e4e..f48fc701 100644 --- a/docs/Walkthrough Constraints.md +++ b/docs/Walkthrough Constraints.md @@ -2,8 +2,11 @@ It is assumed that you know the basics of the [applied algorithm](Meta-Heuristic removed job is re-inserted into the ruined solution again (one after another). To actually insert a job, the algorithm calculates its "best" insertion position. This implies also to check the feasibility of the insertion step which is in turn dependent on constraints (such as capacity constraints). -jsprit knows hard and soft constraints. Whereas hard constraints must be met and cannot be broken, soft constraints -are always fulfilled but uses penalties to express "good" and "bad" insertions. + +## jsprit knows hard and soft constraints. + +- Hard constraints must be met and cannot be broken +- soft constraints are always fulfilled but uses penalties to express "good" and "bad" insertions. jsprit comes with built-in or default constraints (such as capacity and time-window constraints) and allows you to add custom constraints. However, you can also disable the default constraints. To add custom constraints use @@ -44,7 +47,7 @@ There are hard constraints at two different levels: at route and activity level. A route is basically a sequence of activities. Each route has a start- and an end-activity, and in between other activities of type core.problem.solution.route.activity.TourActivity. -###core.problem.constraint.HardRouteConstraint +### core.problem.constraint.HardRouteConstraint A HardRouteConstraint indicates whether a specified job can be inserted into an existing route (along with a specified vehicle). To define it you need to implement the HardRouteConstraint-interface:
HardRouteConstraint constraint = new HardRouteConstraint(){
@@ -61,7 +64,7 @@ The JobInsertionContext tells you the context of the insertion step, i.e. the sp
 a specified route (iContext.getRoute()) as well as the vehicle
 that should be employed on that route (iContext.getNewVehicle()).
 
-####Example:
+#### Example:
 Assume a vehicle with id="1" is not allowed to serve a job with id="job1" (since it is for example too big to access the customer location). Such a constraint can be easily defined as follows:
 
 
final Job jobWithAccessConstraint = routingProblem.getJobs().get("job1");
diff --git a/jsprit-io/src/test/resources/infiniteWriterV2Test.xml b/jsprit-io/src/test/resources/infiniteWriterV2Test.xml
new file mode 100644
index 00000000..9d863897
--- /dev/null
+++ b/jsprit-io/src/test/resources/infiniteWriterV2Test.xml
@@ -0,0 +1,41 @@
+
+
+     
+          INFINITE
+     
+     
+          
+               
+                    
+                         [x=1.0][y=2.0]
+                         
+                    
+                    100.0
+                    
+                         
+                              1.0
+                              2.0
+                         
+                    
+               
+               
+                    
+                         delLoc
+                         
+                    
+                    50.0
+                    
+                         
+                              3.0
+                              4.0
+                         
+                    
+               
+               
+                    10
+               
+               skill3, skill1, skill2
+          
+     
+