1
0
Fork 0
mirror of https://github.com/graphhopper/jsprit.git synced 2020-01-24 07:45:05 +01:00

driver breaks

This commit is contained in:
oblonski 2015-09-24 08:00:21 +02:00
parent 778b141c3d
commit be2358ab7c
2 changed files with 5 additions and 9 deletions

View file

@ -11,7 +11,7 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package jsprit.core.algorithm.recreate;
@ -80,16 +80,16 @@ final class BreakInsertionCalculator implements JobInsertionCostsCalculator{
public void setJobActivityFactory(JobActivityFactory jobActivityFactory){
this.activityFactory = jobActivityFactory;
}
@Override
public String toString() {
return "[name=calculatesServiceInsertion]";
}
/**
* Calculates the marginal cost of inserting job i locally. This is based on the
* assumption that cost changes can entirely covered by only looking at the predecessor i-1 and its successor i+1.
*
*
*/
@Override
public InsertionData getInsertionData(final VehicleRoute currentRoute, final Job jobToInsert, final Vehicle newVehicle, double newVehicleDepartureTime, final Driver newDriver, final double bestKnownCosts) {
@ -103,10 +103,6 @@ final class BreakInsertionCalculator implements JobInsertionCostsCalculator{
BreakActivity breakAct2Insert = (BreakActivity) activityFactory.createActivities(breakToInsert).get(0);
insertionContext.getAssociatedActivities().add(breakAct2Insert);
boolean differentVehicles = false;
if(!currentRoute.isEmpty()){
differentVehicles = currentRoute.getVehicle() != newVehicle;
}
/*
check hard constraints at route level
*/

View file

@ -47,7 +47,7 @@ public class BreakExample {
*/
final int WEIGHT_INDEX = 0;
VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType")
.addCapacityDimension(WEIGHT_INDEX, 2).setCostPerWaitingTime(1.);
.addCapacityDimension(WEIGHT_INDEX, 2).setCostPerWaitingTime(1.0);
VehicleType vehicleType = vehicleTypeBuilder.build();
/*