mirror of
https://github.com/graphhopper/jsprit.git
synced 2020-01-24 07:45:05 +01:00
Merge remote-tracking branch 'michalmac/dvrp' into michalmac_master
This commit is contained in:
commit
cfd60f5eec
5 changed files with 8 additions and 9 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -12,3 +12,4 @@
|
||||||
# Eclipse
|
# Eclipse
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
|
/.settings/
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,7 @@ public class Skills {
|
||||||
* @return true if skill is included, false otherwise
|
* @return true if skill is included, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean containsSkill(String skill) {
|
public boolean containsSkill(String skill) {
|
||||||
return skills.contains(skill.toLowerCase());
|
return skills.contains(skill.trim().toLowerCase());// trim to be consistent with addSkill()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@ public class Coordinate {
|
||||||
return new Coordinate(x, y);
|
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) {
|
public Coordinate(double x, double y) {
|
||||||
super();
|
super();
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,8 @@ public class EuclideanCosts extends AbstractForwardVehicleRoutingTransportCosts
|
||||||
private double calculateDistance(Location fromLocation, Location toLocation) {
|
private double calculateDistance(Location fromLocation, Location toLocation) {
|
||||||
Coordinate from = null;
|
Coordinate from = null;
|
||||||
Coordinate to = null;
|
Coordinate to = null;
|
||||||
if (fromLocation.getCoordinate() != null & toLocation.getCoordinate() != null) {
|
from = fromLocation.getCoordinate();
|
||||||
from = fromLocation.getCoordinate();
|
to = toLocation.getCoordinate();
|
||||||
to = toLocation.getCoordinate();
|
|
||||||
}
|
|
||||||
if (from == null || to == null) throw new NullPointerException();
|
|
||||||
return calculateDistance(from, to);
|
return calculateDistance(from, to);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
1
jsprit-examples/.gitignore
vendored
1
jsprit-examples/.gitignore
vendored
|
|
@ -13,3 +13,4 @@
|
||||||
.project
|
.project
|
||||||
.classpath
|
.classpath
|
||||||
.settings
|
.settings
|
||||||
|
/.factorypath
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue