mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
What is new in 1.6.2?
This commit is contained in:
parent
2b3fd0f3fa
commit
18680c9028
1 changed files with 38 additions and 20 deletions
58
WHATS_NEW.md
58
WHATS_NEW.md
|
|
@ -1,6 +1,24 @@
|
||||||
WHATS NEW
|
WHATS NEW
|
||||||
==========
|
==========
|
||||||
------------------------------
|
------------------------------
|
||||||
|
<b>2016-02-02</b> new release **v1.6.2**
|
||||||
|
|
||||||
|
Consideration of Waiting Times:
|
||||||
|
This takes waiting times at customer sites into account. If costs for waiting is specified then
|
||||||
|
instead of just waiting at customer sites for time windows to open, the algorithm seeks to serve other customers to reduce total completion time.
|
||||||
|
To see how this can be specified, look at [this example](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/MultipleTimeWindowExample2.java#L50)
|
||||||
|
|
||||||
|
Multiple Time Windows:
|
||||||
|
To see how this can be specified, look at [this example](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/MultipleTimeWindowExample.java#L61)
|
||||||
|
|
||||||
|
Driver Breaks:
|
||||||
|
To see how this can be specified, look at [this example](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/BreakExample.java)
|
||||||
|
|
||||||
|
Fast Regret:
|
||||||
|
Fast regret boosts your computation, i.e. it reduces computation time significantly. However, it can only be use currently if no complicated dependencies between jobs and activities are defined.
|
||||||
|
To see how this can be specified, look at [this example](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/MultipleDepotExample2.java#L108)
|
||||||
|
|
||||||
|
|
||||||
<b>2015-08-10</b> new release **v1.6.1**
|
<b>2015-08-10</b> new release **v1.6.1**
|
||||||
|
|
||||||
Jsprit results are now reproducible since every time the algorithm runs, a unique random number generator (always starting with a
|
Jsprit results are now reproducible since every time the algorithm runs, a unique random number generator (always starting with a
|
||||||
|
|
@ -79,7 +97,7 @@ jsprit made a big step towards analysing and designing your own ruin and recreat
|
||||||
First, it is now possible to record and view each and every algorithm step which allows you to visualise the search, e.g. neighborhoods
|
First, it is now possible to record and view each and every algorithm step which allows you to visualise the search, e.g. neighborhoods
|
||||||
and the emergence of new structures. It is as easy as importing the corresponding classes from jsprit-analysis and coding the following lines:
|
and the emergence of new structures. It is as easy as importing the corresponding classes from jsprit-analysis and coding the following lines:
|
||||||
|
|
||||||
<pre><code>AlgorithmEventsRecorder recorder = new AlgorithmEventsRecorder(vrp,"output/events.dgs.gz");
|
<pre><code>AlgorithmEventsRecorder recorder = new AlgorithmEventsRecorder(vrp,"output/events.dgs.gz");
|
||||||
recorder.setRecordingRange(0,100); //lets you specify the iterations you want to record
|
recorder.setRecordingRange(0,100); //lets you specify the iterations you want to record
|
||||||
vehicleRoutingAlgorithm.addListener(recorder);
|
vehicleRoutingAlgorithm.addListener(recorder);
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
@ -95,13 +113,13 @@ viewer.display("output/events.dgs.gz");
|
||||||
|
|
||||||
It is not only beautiful, but it allows you to understand why jsprit can find and cannot find certain solutions, and it allows you to immediately analyze your own strategies which brings us to the second improvement.
|
It is not only beautiful, but it allows you to understand why jsprit can find and cannot find certain solutions, and it allows you to immediately analyze your own strategies which brings us to the second improvement.
|
||||||
|
|
||||||
With <code>AbstractRuinStrategy</code> and <code>AbstractInsertionStrategy</code> it is easy to implement your own strategies. The
|
With <code>AbstractRuinStrategy</code> and <code>AbstractInsertionStrategy</code> it is easy to implement your own strategies. The
|
||||||
abstract classes do all the non-intuitive and tricky stuff (such as informing listeners that a job has been inserted etc.) for you and you can focus on your strategies.
|
abstract classes do all the non-intuitive and tricky stuff (such as informing listeners that a job has been inserted etc.) for you and you can focus on your strategies.
|
||||||
|
|
||||||
With the <code>PrettyAlgorithmBuilder</code> you can finally build your algorithm, basically just by adding your strategies. All
|
With the <code>PrettyAlgorithmBuilder</code> you can finally build your algorithm, basically just by adding your strategies. All
|
||||||
other things that need to be done to wire up the components of your algorithm does the builder for you.
|
other things that need to be done to wire up the components of your algorithm does the builder for you.
|
||||||
|
|
||||||
A third improvement in this regard is that you can switch on and off certain strategies or just change their weights in the course of the search (which allow you to adapt your strategies e.g.
|
A third improvement in this regard is that you can switch on and off certain strategies or just change their weights in the course of the search (which allow you to adapt your strategies e.g.
|
||||||
according to its recorded success). You do that by informing the strategy manager to change a strategy's weight much like this:
|
according to its recorded success). You do that by informing the strategy manager to change a strategy's weight much like this:
|
||||||
|
|
||||||
<pre><code>vra.getSearchStrategyManager().informStrategyWeightChanged(strategyId, 0.); //which is basically switching off the strategy
|
<pre><code>vra.getSearchStrategyManager().informStrategyWeightChanged(strategyId, 0.); //which is basically switching off the strategy
|
||||||
|
|
@ -109,7 +127,7 @@ according to its recorded success). You do that by informing the strategy manage
|
||||||
|
|
||||||
This comes with two changes. Strategy probabilities are now strategy weights (and do not need to be smaller than 1) and the probability of choosing a strategy is simply a function of
|
This comes with two changes. Strategy probabilities are now strategy weights (and do not need to be smaller than 1) and the probability of choosing a strategy is simply a function of
|
||||||
the strategy's weight and all other weights (i.e. prob(i) = weight(i) / sumOfAllWeights). The second change is that strategies
|
the strategy's weight and all other weights (i.e. prob(i) = weight(i) / sumOfAllWeights). The second change is that strategies
|
||||||
now require a unique id. Latter might break your code if (and only if) you already build your algorithm from scratch.
|
now require a unique id. Latter might break your code if (and only if) you already build your algorithm from scratch.
|
||||||
|
|
||||||
This [example](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/BuildAlgorithmFromScratch.java)
|
This [example](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/BuildAlgorithmFromScratch.java)
|
||||||
illustrates a few of the outlined features.
|
illustrates a few of the outlined features.
|
||||||
|
|
@ -118,7 +136,7 @@ Another new feature which is worth to mention is a new insertion strategy called
|
||||||
The one with the highest score will be inserted first. The scoring function is based on opportunity costs, i.e. it compares the best insertion alternative with the second best.
|
The one with the highest score will be inserted first. The scoring function is based on opportunity costs, i.e. it compares the best insertion alternative with the second best.
|
||||||
If the difference between both is high, the job will be preferred, i.e. it will be inserted earlier than later. The scoring function comes with default parameters. However, you
|
If the difference between both is high, the job will be preferred, i.e. it will be inserted earlier than later. The scoring function comes with default parameters. However, you
|
||||||
can replace params or overwrite the whole scoring function with your own (which currently means that you need to build your algorithm from scratch).
|
can replace params or overwrite the whole scoring function with your own (which currently means that you need to build your algorithm from scratch).
|
||||||
Note, that this strategy will have a significant impact on the computational performance. If you run it with the same no. of iterations as you run BestInsertion, you are
|
Note, that this strategy will have a significant impact on the computational performance. If you run it with the same no. of iterations as you run BestInsertion, you are
|
||||||
likely to wait forever. However, since it is a bit more 'intelligent' you do not need as many iterations. It is also recommended to use the [concurrent mode](https://github.com/jsprit/jsprit/blob/master/jsprit-core/src/main/java/jsprit/core/algorithm/recreate/RegretInsertionConcurrent.java) since RegretInsertion
|
likely to wait forever. However, since it is a bit more 'intelligent' you do not need as many iterations. It is also recommended to use the [concurrent mode](https://github.com/jsprit/jsprit/blob/master/jsprit-core/src/main/java/jsprit/core/algorithm/recreate/RegretInsertionConcurrent.java) since RegretInsertion
|
||||||
is best suited for concurrent calculation.
|
is best suited for concurrent calculation.
|
||||||
|
|
||||||
|
|
@ -130,7 +148,7 @@ Last, you can use spherical coordinates (i.e. longitude and latitude) since [Gre
|
||||||
|
|
||||||
<b>2014-10-14</b> new release **v1.4.2**
|
<b>2014-10-14</b> new release **v1.4.2**
|
||||||
|
|
||||||
It has a new feature to analyse your VehicleRoutingProblemSolution.
|
It has a new feature to analyse your VehicleRoutingProblemSolution.
|
||||||
|
|
||||||
jsprit.core.analysis.SolutionAnalszer provides a way to easily calculate statistics for your solution such as load after activity, load before activity, picked load on route, delivered load on route, load at beginning of route, load at end, waiting time on route and total waiting time in solution, total transport time and distance and many more. Additionally, you can check whether jsprit's default constraints are violated or not. This might be important if you change your solution ex-post by removing a job etc.. Look at this example to see a (incomplete) list of what can be calculated out-of-the-box now: [VRPWithBackhauls - SolutionAnalyser](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/VRPWithBackhaulsExample2.java)
|
jsprit.core.analysis.SolutionAnalszer provides a way to easily calculate statistics for your solution such as load after activity, load before activity, picked load on route, delivered load on route, load at beginning of route, load at end, waiting time on route and total waiting time in solution, total transport time and distance and many more. Additionally, you can check whether jsprit's default constraints are violated or not. This might be important if you change your solution ex-post by removing a job etc.. Look at this example to see a (incomplete) list of what can be calculated out-of-the-box now: [VRPWithBackhauls - SolutionAnalyser](https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/VRPWithBackhaulsExample2.java)
|
||||||
|
|
||||||
|
|
@ -152,8 +170,8 @@ v1.4 breaks your code! Look at [changelog](https://github.com/jsprit/jsprit/blob
|
||||||
<b> SKILLS </b>
|
<b> SKILLS </b>
|
||||||
|
|
||||||
Skills can now be included easily (see for example https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/SolomonWithSkillsExample.java).
|
Skills can now be included easily (see for example https://github.com/jsprit/jsprit/blob/master/jsprit-examples/src/main/java/jsprit/examples/SolomonWithSkillsExample.java).
|
||||||
It lets you assign hard requirements to jobs and vehicles/drivers. For example, your vehicle requires a loading bridge to unload freight at customer A or
|
It lets you assign hard requirements to jobs and vehicles/drivers. For example, your vehicle requires a loading bridge to unload freight at customer A or
|
||||||
a technician requires a screwdriver, a hammer and an electric drill to serve customer A.
|
a technician requires a screwdriver, a hammer and an electric drill to serve customer A.
|
||||||
You assign latter skills to your customer as follows:
|
You assign latter skills to your customer as follows:
|
||||||
|
|
||||||
<pre><code>Service service = Service.Builder.newInstance(serviceId).addRequiredSkill("screwdriver")
|
<pre><code>Service service = Service.Builder.newInstance(serviceId).addRequiredSkill("screwdriver")
|
||||||
|
|
@ -161,10 +179,10 @@ You assign latter skills to your customer as follows:
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
Assign these skills to your technician as well:
|
Assign these skills to your technician as well:
|
||||||
|
|
||||||
<pre><code>VehicleImpl skilled_technician = VehicleImpl.Builder.newInstance(technicianId).addSkill("screwdriver")
|
<pre><code>VehicleImpl skilled_technician = VehicleImpl.Builder.newInstance(technicianId).addSkill("screwdriver")
|
||||||
.addSkill("hammer").addSkill("electric-drill"). ... .build();
|
.addSkill("hammer").addSkill("electric-drill"). ... .build();
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
|
||||||
Note that you can add an arbitrary number of skills to jobs and vehicles.
|
Note that you can add an arbitrary number of skills to jobs and vehicles.
|
||||||
|
|
@ -175,7 +193,7 @@ To enable the algorithm to consider skills, you need to use <code>core.algorithm
|
||||||
VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(skillProblem,yourConfig);
|
VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(skillProblem,yourConfig);
|
||||||
vraBuilder.addCoreConstraints();
|
vraBuilder.addCoreConstraints();
|
||||||
vraBuilder.addDefaultCostCalculators();
|
vraBuilder.addDefaultCostCalculators();
|
||||||
|
|
||||||
StateManager stateManager = new StateManager(skillProblem);
|
StateManager stateManager = new StateManager(skillProblem);
|
||||||
<b>stateManager.updateSkillStates();</b>
|
<b>stateManager.updateSkillStates();</b>
|
||||||
|
|
||||||
|
|
@ -189,13 +207,13 @@ VehicleRoutingAlgorithm vra = vraBuilder.build();
|
||||||
|
|
||||||
<b> UNASSIGNED JOB LIST</b>
|
<b> UNASSIGNED JOB LIST</b>
|
||||||
|
|
||||||
A solution can now consists of assigned and unassigned jobs. There are various reasons for unassigned jobs, e.g.
|
A solution can now consists of assigned and unassigned jobs. There are various reasons for unassigned jobs, e.g.
|
||||||
demand exceeds available capacity, the job cannot be served within driver's operation time or the job is just too costly to
|
demand exceeds available capacity, the job cannot be served within driver's operation time or the job is just too costly to
|
||||||
serve it with your own fleet.
|
serve it with your own fleet.
|
||||||
|
|
||||||
Note that jsprit uses a "soft" approach to deal with unassigned jobs, i.e. each unassigned job will be penalyzed in the objective function
|
Note that jsprit uses a "soft" approach to deal with unassigned jobs, i.e. each unassigned job will be penalyzed in the objective function
|
||||||
(see default objective https://github.com/jsprit/jsprit/blob/master/jsprit-core/src/main/java/jsprit/core/algorithm/VariablePlusFixedSolutionCostCalculatorFactory.java [line 55]).
|
(see default objective https://github.com/jsprit/jsprit/blob/master/jsprit-core/src/main/java/jsprit/core/algorithm/VariablePlusFixedSolutionCostCalculatorFactory.java [line 55]).
|
||||||
If you omit penalyzing them, you probably end up with a solution consisting solely of unassigned jobs (the less the better in terms of total costs).
|
If you omit penalyzing them, you probably end up with a solution consisting solely of unassigned jobs (the less the better in terms of total costs).
|
||||||
This, however, easily enables you to define objective functions that maximizes profits.
|
This, however, easily enables you to define objective functions that maximizes profits.
|
||||||
|
|
||||||
<b>Thus, if you already use your own custom objective function, you need to manually adapt it and add penalties for unassigned jobs.</b>
|
<b>Thus, if you already use your own custom objective function, you need to manually adapt it and add penalties for unassigned jobs.</b>
|
||||||
|
|
@ -213,7 +231,7 @@ If you implement core.problem.constraint.SoftActivityContraint and core.problem.
|
||||||
and
|
and
|
||||||
|
|
||||||
<code>public ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime);</code>
|
<code>public ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime);</code>
|
||||||
|
|
||||||
you can now retrieve additional information from iFacts. If newAct is "deliverShipment" then
|
you can now retrieve additional information from iFacts. If newAct is "deliverShipment" then
|
||||||
|
|
||||||
<code>iFacts.getRelatedActivityContext();</code>
|
<code>iFacts.getRelatedActivityContext();</code>
|
||||||
|
|
@ -230,9 +248,9 @@ This allows you to easily implement LIFO and FIFO constraints (since you now kno
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
<b>2014-08-15</b> [YourKit](http://www.yourkit.com/home/) supports jsprit with its full-featured Java Profiler.
|
<b>2014-08-15</b> [YourKit](http://www.yourkit.com/home/) supports jsprit with its full-featured Java Profiler.
|
||||||
|
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
<b>2014-08-10</b> jsprit uses Travis for continuous integration (https://travis-ci.org/jsprit/jsprit)
|
<b>2014-08-10</b> jsprit uses Travis for continuous integration (https://travis-ci.org/jsprit/jsprit)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue