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

modeling the problem

This commit is contained in:
oblonski 2013-10-16 21:22:46 +02:00
parent 6b8e4c8a79
commit c55d67e3c2
5 changed files with 77 additions and 4 deletions

View file

@ -38,7 +38,7 @@ import basics.route.VehicleRoute;
/**
*
* RuinStrategy that ruins the neighborhood of a randomly selected service. The size and the structure of the neighborhood is defined by
* RuinStrategy that ruins the neighborhood of a randomly selected job. The size and the structure of the neighborhood is defined by
* the share of jobs to be removed and the distance between jobs (where distance not necessarily mean Euclidean distance but an arbitrary
* measure).
*

View file

@ -133,7 +133,7 @@ public class Shipment implements Job{
return demand;
}
public int getDemand() {
public int getSize() {
return demand;
}

View file

@ -236,7 +236,10 @@ public class VehicleRoutingProblem {
if(job instanceof Service) {
addService((Service) job);
}
else throw new IllegalStateException("job can only be a shipment or a service, but is instance of " + job.getClass());
else{
if(jobs.containsKey(job.getId())){ logger.warn("job " + job + " already in job list. overrides existing job."); }
jobs.put(job.getId(),job);
}
return this;
}
@ -357,6 +360,10 @@ public class VehicleRoutingProblem {
public Collection<Service> getAddedServices(){
return Collections.unmodifiableCollection(services);
}
public Collection<Job> getAddedJobs(){
return Collections.unmodifiableCollection(jobs.values());
}
}
/**