2014-10-14 new release v1.4.2
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
Note that this feature is sponsored by Open Door Logistics.
2014-09-25 new release v1.4.1
It contains a fix of a critical bug (see #134).
2014-09-08 new release v1.4
v1.4 breaks your code! Look at changelog to migrate from v1.3.1 to v1.4.
SKILLS
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 a technician requires a screwdriver, a hammer and an electric drill to serve customer A. You assign latter skills to your customer as follows:
Service service = Service.Builder.newInstance(serviceId).addRequiredSkill("screwdriver")
.addRequiredSkill("hammer").addRequiredSkill("electric-drill"). ... .build();
Assign these skills to your technician as well:
VehicleImpl skilled_technician = VehicleImpl.Builder.newInstance(technicianId).addSkill("screwdriver")
.addSkill("hammer").addSkill("electric-drill"). ... .build();
Note that you can add an arbitrary number of skills to jobs and vehicles.
To enable the algorithm to consider skills, you need to use core.algorithm.VehicleRoutingAlgorithmBuilder
as follows:
VehicleRoutingAlgorithmBuilder vraBuilder = new VehicleRoutingAlgorithmBuilder(skillProblem,yourConfig);
vraBuilder.addCoreConstraints();
vraBuilder.addDefaultCostCalculators();
StateManager stateManager = new StateManager(skillProblem);
stateManager.updateSkillStates();
ConstraintManager constraintManager = new ConstraintManager(skillProblem,stateManager);
constraintManager.addSkillsConstraint();
VehicleRoutingAlgorithm vra = vraBuilder.build();
UNASSIGNED JOB LIST
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 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 (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). This, however, easily enables you to define objective functions that maximizes profits.
Thus, if you already use your own custom objective function, you need to manually adapt it and add penalties for unassigned jobs.
LIFO and FIFO CONSTRAINTS
You can now retrieve additional information about related activities from JobInsertionContext (see graphhopper#127).
If one deals with shipments then two activities will be inserted: pickupShipment and deliverShipment.
If you implement core.problem.constraint.SoftActivityContraint and core.problem.constraint.HardActivityConstraint and thus
public double getCosts(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime);
and
public ConstraintsStatus fulfilled(JobInsertionContext iFacts, TourActivity prevAct, TourActivity newAct, TourActivity nextAct, double prevActDepTime);
you can now retrieve additional information from iFacts. If newAct is "deliverShipment" then
iFacts.getRelatedActivityContext();
provides arrivalTime, endTime and potentialInsertionIndex of the related "pickupShipment" (see javadoc of ActivityContext).
This allows you to easily implement LIFO and FIFO constraints (since you now know where the pickup activity will be inserted).
2014-08-20 jsprit has a mailing list (https://groups.google.com/group/jsprit-mailing-list)
2014-08-15 YourKit supports jsprit with its full-featured Java Profiler.
2014-08-10 jsprit uses Travis for continuous integration (https://travis-ci.org/jsprit/jsprit)