You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please visit [Simple Example](Simple-Example.md) to get to know how you can analyse the solution.
111
+
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.
Copy file name to clipboardexpand all lines: docs/Walkthrough Constraints.md
+7-4
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,11 @@ It is assumed that you know the basics of the [applied algorithm](Meta-Heuristic
2
2
removed job is re-inserted into the ruined solution again (one after another). To actually insert a job, the algorithm
3
3
calculates its "best" insertion position. This implies also to check the feasibility of the insertion step
4
4
which is in turn dependent on constraints (such as capacity constraints).
5
-
jsprit knows hard and soft constraints. Whereas hard constraints must be met and cannot be broken, soft constraints
6
-
are always fulfilled but uses penalties to express "good" and "bad" insertions.
5
+
6
+
## jsprit knows hard and soft constraints.
7
+
8
+
- Hard constraints must be met and cannot be broken
9
+
- soft constraints are always fulfilled but uses penalties to express "good" and "bad" insertions.
7
10
8
11
jsprit comes with built-in or default constraints (such as capacity and time-window constraints) and allows you to add
9
12
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.
44
47
45
48
A route is basically a sequence of activities. Each route has a start- and an end-activity, and in between other activities of type <code>core.problem.solution.route.activity.TourActivity</code>.
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:
49
52
50
53
<pre><code>HardRouteConstraint constraint = new HardRouteConstraint(){
@@ -61,7 +64,7 @@ The JobInsertionContext tells you the context of the insertion step, i.e. the sp
61
64
a specified route (<code>iContext.getRoute()</code>) as well as the vehicle
62
65
that should be employed on that route (<code>iContext.getNewVehicle()</code>).
63
66
64
-
####Example:
67
+
####Example:
65
68
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:
0 commit comments