Skip to content

Commit

Permalink
- proper facility switch
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry committed Dec 16, 2017
1 parent e861cff commit e2df807
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions core/src/MyStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,17 @@ private void switchGoToFacility(VehicleGroupInfo myGroup) {
Point2D otherAp = other.getAveragePoint();
FacilityWrapper otherF = other.goToFacility;

boolean f1 = otherAp.getDistanceTo(otherF) > otherAp.getDistanceTo(myF);

double distanceTo = otherAp.getDistanceTo(otherF);
if (distanceTo == 0) {
distanceTo = 1;
}
if (myAp.getDistanceTo(otherF) / distanceTo < 0.78 && distanceTo > 64) {
myGroup.goToFacility = other.goToFacility;
other.goToFacility = null; //TODO mb do not reset
}

/* boolean f1 = otherAp.getDistanceTo(otherF) > otherAp.getDistanceTo(myF);
boolean f2 = myAp.getDistanceTo(myF) > myAp.getDistanceTo(otherAp);
double currentDistance = myAp.getDistanceTo(myF) + otherAp.getDistanceTo(otherF);
Expand All @@ -1023,7 +1033,7 @@ private void switchGoToFacility(VehicleGroupInfo myGroup) {
other.goToFacility = myF;
other.switchCount++;
myGroup.switchCount++;
}
}*/
}
}
}
Expand Down Expand Up @@ -1964,7 +1974,7 @@ private List<VehicleGroupInfo> getGroups(Ownership ownership) {
}

for (Map.Entry<VehicleGroupInfo, FacilityWrapper> e : bestSetup.map.entrySet()) {
e.getKey().goToFacility = e.getValue();
e.getKey().goToFacility = e.getValue();
}
}

Expand Down

0 comments on commit e2df807

Please sign in to comment.