mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
add overrides
This commit is contained in:
parent
1a63178e05
commit
7234e12ec7
2 changed files with 4 additions and 3 deletions
|
|
@ -29,6 +29,7 @@ class JobNeighborhoodsImpl implements JobNeighborhoods {
|
|||
logger.info("intialise " + this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<Job> getNearestNeighborsIterator(int nNeighbors, Job neighborTo){
|
||||
TreeSet<ReferencedJob> tree = distanceNodeTree.get(neighborTo.getId());
|
||||
if(tree == null) return new Iterator<Job>() {
|
||||
|
|
@ -46,6 +47,7 @@ class JobNeighborhoodsImpl implements JobNeighborhoods {
|
|||
return new NearestNeighborhoodIterator(descendingIterator, nNeighbors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialise(){
|
||||
logger.info("calculates and memorizes distances from EACH job to EACH job --> n^2 calculations");
|
||||
calculateDistancesFromJob2Job();
|
||||
|
|
|
|||
|
|
@ -32,9 +32,7 @@ class JobNeighborhoodsImplWithCapRestriction implements JobNeighborhoods {
|
|||
logger.info("intialise " + this);
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: obviously nearestNeighbor does not work with a single customer
|
||||
*/
|
||||
@Override
|
||||
public Iterator<Job> getNearestNeighborsIterator(int nNeighbors, Job neighborTo){
|
||||
TreeSet<ReferencedJob> tree = distanceNodeTree.get(neighborTo.getId());
|
||||
if(tree == null) return new Iterator<Job>() {
|
||||
|
|
@ -54,6 +52,7 @@ class JobNeighborhoodsImplWithCapRestriction implements JobNeighborhoods {
|
|||
return new NearestNeighborhoodIterator(descendingIterator, nNeighbors);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialise(){
|
||||
logger.info("calculates distances from EACH job to EACH job --> n^2="+Math.pow(vrp.getJobs().values().size(), 2) + " calculations, but 'only' "+(vrp.getJobs().values().size()*capacity)+ " are cached.");
|
||||
if(capacity==0) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue