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:
parent
6b8e4c8a79
commit
c55d67e3c2
5 changed files with 77 additions and 4 deletions
|
|
@ -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).
|
||||
*
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ public class Shipment implements Job{
|
|||
return demand;
|
||||
}
|
||||
|
||||
public int getDemand() {
|
||||
public int getSize() {
|
||||
return demand;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue