Hi.
I’m doing a project in java with Jsprit getting the distances between points with the google API and declaring them in a CostMatrix.
I’m declaring them like this:
costMatrixBuilder.addTransportTime(A,B, trix.rows[3].elements[3].duration.inSeconds);
(Pretty simple and no problems with that).
But i just need to have a different time cost from A=>B and B=>A (Because roads directions,etc…) so:
¿Is there any way in jsprit to manage this?
The matrix needs the distance for every combination including A => B, B=>A, A=>C, C=>A, B=>C, C=>B etc. Therefore if you just fill the matrix with the data for every combination then you are covered for variations of each direction.
Actually the matrix does not need the b->a distance. If u give him the a->b. It just overwrite the other one and uses the 2nd you declare.
In my example i’m just doing:
And its working fine (with no errors) but the distance between B and A is the one i declarate as distance between A and B
and if i add costMatrixBuilder.addTransportTime(B, A, xxx);
it just remplaces the first one with that one.