mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
driver breaks
This commit is contained in:
parent
778b141c3d
commit
be2358ab7c
2 changed files with 5 additions and 9 deletions
|
|
@ -11,7 +11,7 @@
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
* Lesser General Public License for more details.
|
* 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/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
package jsprit.core.algorithm.recreate;
|
package jsprit.core.algorithm.recreate;
|
||||||
|
|
@ -80,16 +80,16 @@ final class BreakInsertionCalculator implements JobInsertionCostsCalculator{
|
||||||
public void setJobActivityFactory(JobActivityFactory jobActivityFactory){
|
public void setJobActivityFactory(JobActivityFactory jobActivityFactory){
|
||||||
this.activityFactory = jobActivityFactory;
|
this.activityFactory = jobActivityFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[name=calculatesServiceInsertion]";
|
return "[name=calculatesServiceInsertion]";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Calculates the marginal cost of inserting job i locally. This is based on the
|
* 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.
|
* assumption that cost changes can entirely covered by only looking at the predecessor i-1 and its successor i+1.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public InsertionData getInsertionData(final VehicleRoute currentRoute, final Job jobToInsert, final Vehicle newVehicle, double newVehicleDepartureTime, final Driver newDriver, final double bestKnownCosts) {
|
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);
|
BreakActivity breakAct2Insert = (BreakActivity) activityFactory.createActivities(breakToInsert).get(0);
|
||||||
insertionContext.getAssociatedActivities().add(breakAct2Insert);
|
insertionContext.getAssociatedActivities().add(breakAct2Insert);
|
||||||
|
|
||||||
boolean differentVehicles = false;
|
|
||||||
if(!currentRoute.isEmpty()){
|
|
||||||
differentVehicles = currentRoute.getVehicle() != newVehicle;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
check hard constraints at route level
|
check hard constraints at route level
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ public class BreakExample {
|
||||||
*/
|
*/
|
||||||
final int WEIGHT_INDEX = 0;
|
final int WEIGHT_INDEX = 0;
|
||||||
VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType")
|
VehicleTypeImpl.Builder vehicleTypeBuilder = VehicleTypeImpl.Builder.newInstance("vehicleType")
|
||||||
.addCapacityDimension(WEIGHT_INDEX, 2).setCostPerWaitingTime(1.);
|
.addCapacityDimension(WEIGHT_INDEX, 2).setCostPerWaitingTime(1.0);
|
||||||
VehicleType vehicleType = vehicleTypeBuilder.build();
|
VehicleType vehicleType = vehicleTypeBuilder.build();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue