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

Merge pull request #382 from michalmac/master

small refinements
This commit is contained in:
Stefan Schröder 2017-10-24 15:48:33 +02:00 committed by GitHub
commit fac5db530e
4 changed files with 6 additions and 12 deletions

3
.gitignore vendored
View file

@ -11,4 +11,5 @@
# Eclipse
.project
.classpath
.classpath
/.settings/

View file

@ -109,7 +109,7 @@ public class Skills {
* @return true if skill is included, false otherwise
*/
public boolean containsSkill(String skill) {
return skills.contains(skill.toLowerCase());
return skills.contains(skill.trim().toLowerCase());// trim to be consistent with addSkill()
}
@Override

View file

@ -23,9 +23,9 @@ public class Coordinate {
return new Coordinate(x, y);
}
private double x;
private final double x;
private double y;
private final double y;
public Coordinate(double x, double y) {
super();

View file

@ -58,14 +58,7 @@ public class EuclideanCosts extends AbstractForwardVehicleRoutingTransportCosts
}
private double calculateDistance(Location fromLocation, Location toLocation) {
Coordinate from = null;
Coordinate to = null;
if (fromLocation.getCoordinate() != null & toLocation.getCoordinate() != null) {
from = fromLocation.getCoordinate();
to = toLocation.getCoordinate();
}
if (from == null || to == null) throw new NullPointerException();
return calculateDistance(from, to);
return calculateDistance(fromLocation.getCoordinate(), toLocation.getCoordinate());
}
private double calculateDistance(Coordinate from, Coordinate to) {