public class DistanceMetric extends Object
DistanceMetric.Ellipsoid
).
In the legacy mode (when ellipsoid is not set), distances are computed using Euclidian distance and 1 unit is considered 10 meters.
Modifier and Type | Class and Description |
---|---|
static class |
DistanceMetric.Ellipsoid |
Constructor and Description |
---|
DistanceMetric()
Default properties
|
DistanceMetric(DataProperties properties)
Configured using properties
|
DistanceMetric(DistanceMetric.Ellipsoid model)
With provided ellipsoid
|
DistanceMetric(DistanceMetric.Ellipsoid model,
double speed)
With provided ellipsoid and student speed
|
Modifier and Type | Method and Description |
---|---|
void |
addTravelTime(Long roomId1,
Long roomId2,
Integer travelTimeInMinutes)
Add travel time between two locations
|
protected double |
deg2rad(double deg)
Degrees to radians
|
boolean |
doComputeDistanceConflictsBetweenNonBTBClasses()
True if distances should be considered between classes that are NOT back-to-back.
|
double |
getDistanceInMeters(Double lat1,
Double lon1,
Double lat2,
Double lon2)
Deprecated.
Use @{link
getDistanceInMeters(Long, Double, Double, Long, Double, Double) instead (to include travel time matrix when available). |
double |
getDistanceInMeters(Long roomId1,
Double lat1,
Double lon1,
Long roomId2,
Double lat2,
Double lon2)
Return travel distance between two locations.
|
int |
getDistanceInMinutes(double lat1,
double lon1,
double lat2,
double lon2)
Deprecated.
Use @{link
getDistanceInMinutes(Long, Double, Double, Long, Double, Double) instead (to include travel time matrix when available). |
Integer |
getDistanceInMinutes(Long roomId1,
Double lat1,
Double lon1,
Long roomId2,
Double lat2,
Double lon2)
Return travel time between two locations.
|
double |
getInstructorDiscouragedLimit()
Back-to-back classes in rooms within this limit have discouraged preference
|
double |
getInstructorLongTravelInMinutes()
When Distances.ComputeDistanceConflictsBetweenNonBTBClasses is enabled, distance limit (in minutes)
for a long travel.
|
double |
getInstructorNoPreferenceLimit()
Back-to-back classes in rooms within this limit have neutral preference
|
double |
getInstructorProhibitedLimit()
Back-to-back classes in rooms within this limit have strongly discouraged preference, it is prohibited to exceed this limit.
|
int |
getMaxTravelDistanceInMinutes()
Maximal travel distance between rooms when no coordinates are given
|
Integer |
getTravelTimeInMinutes(Long roomId1,
Long roomId2)
Return travel time between two locations.
|
Map<Long,Map<Long,Integer>> |
getTravelTimes()
Return travel times matrix
|
boolean |
isLegacy()
True if legacy mode is used (Euclidian distance where 1 unit is 10 meters)
|
static void |
main(String[] args)
Few tests
|
double |
minutes2meters(int min)
Converts minutes to meters.
|
public DistanceMetric()
public DistanceMetric(DistanceMetric.Ellipsoid model)
public DistanceMetric(DistanceMetric.Ellipsoid model, double speed)
public DistanceMetric(DataProperties properties)
protected double deg2rad(double deg)
@Deprecated public double getDistanceInMeters(Double lat1, Double lon1, Double lat2, Double lon2)
getDistanceInMeters(Long, Double, Double, Long, Double, Double)
instead (to include travel time matrix when available).@Deprecated public int getDistanceInMinutes(double lat1, double lon1, double lat2, double lon2)
getDistanceInMinutes(Long, Double, Double, Long, Double, Double)
instead (to include travel time matrix when available).public double minutes2meters(int min)
public double getInstructorNoPreferenceLimit()
public double getInstructorDiscouragedLimit()
public double getInstructorProhibitedLimit()
public double getInstructorLongTravelInMinutes()
public boolean isLegacy()
public int getMaxTravelDistanceInMinutes()
public void addTravelTime(Long roomId1, Long roomId2, Integer travelTimeInMinutes)
public Integer getTravelTimeInMinutes(Long roomId1, Long roomId2)
public Integer getDistanceInMinutes(Long roomId1, Double lat1, Double lon1, Long roomId2, Double lat2, Double lon2)
public double getDistanceInMeters(Long roomId1, Double lat1, Double lon1, Long roomId2, Double lat2, Double lon2)
public boolean doComputeDistanceConflictsBetweenNonBTBClasses()