2013-04-18 23:35:02 +02:00
|
|
|
package net.osmand.router;
|
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
import java.util.Map;
|
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
import net.osmand.binary.RouteDataObject;
|
|
|
|
import net.osmand.router.BinaryRoutePlanner.RouteSegment;
|
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
public interface VehicleRouter {
|
2013-04-18 23:35:02 +02:00
|
|
|
|
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
public boolean containsAttribute(String attribute);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
public String getAttribute(String attribute);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
/**
|
|
|
|
* return if the road is accepted for routing
|
|
|
|
*/
|
|
|
|
public boolean acceptLine(RouteDataObject way);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
/**
|
|
|
|
* return oneway +/- 1 if it is oneway and 0 if both ways
|
|
|
|
*/
|
|
|
|
public int isOneWay(RouteDataObject road);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2014-07-18 17:50:38 +02:00
|
|
|
/**
|
|
|
|
* return penalty transition in seconds
|
|
|
|
*/
|
|
|
|
public float getPenaltyTransition(RouteDataObject road);
|
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
/**
|
2014-02-02 14:06:09 +01:00
|
|
|
* return delay in seconds (0 no obstacles)
|
2013-04-18 23:35:02 +02:00
|
|
|
*/
|
2014-02-02 14:06:09 +01:00
|
|
|
public float defineObstacle(RouteDataObject road, int point);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
2014-02-02 14:06:09 +01:00
|
|
|
/**
|
|
|
|
* return delay in seconds (0 no obstacles)
|
|
|
|
*/
|
|
|
|
public float defineRoutingObstacle(RouteDataObject road, int point);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
|
|
|
/**
|
2014-02-02 14:06:09 +01:00
|
|
|
* return routing speed in m/s for vehicle for specified road
|
2013-04-18 23:35:02 +02:00
|
|
|
*/
|
2014-02-02 14:06:09 +01:00
|
|
|
public float defineRoutingSpeed(RouteDataObject road);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* return real speed in m/s for vehicle for specified road
|
|
|
|
*/
|
|
|
|
public float defineVehicleSpeed(RouteDataObject road);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* define priority to multiply the speed for g(x) A*
|
|
|
|
*/
|
2014-02-02 14:06:09 +01:00
|
|
|
public float defineSpeedPriority(RouteDataObject road);
|
2013-04-18 23:35:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for A* routing to calculate g(x)
|
|
|
|
*
|
|
|
|
* @return minimal speed at road in m/s
|
|
|
|
*/
|
2014-02-02 14:06:09 +01:00
|
|
|
public float getMinDefaultSpeed();
|
2013-04-18 23:35:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Used for A* routing to predict h(x) : it should be great any g(x)
|
|
|
|
*
|
|
|
|
* @return maximum speed to calculate shortest distance
|
|
|
|
*/
|
2014-02-02 14:06:09 +01:00
|
|
|
public float getMaxDefaultSpeed();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* aware of road restrictions
|
|
|
|
*/
|
|
|
|
public boolean restrictionsAware();
|
2013-04-18 23:35:02 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Calculate turn time
|
|
|
|
*/
|
2014-02-02 14:06:09 +01:00
|
|
|
public double calculateTurnTime(RouteSegment segment, int segmentEnd, RouteSegment prev, int prevSegmentEnd);
|
|
|
|
|
|
|
|
|
|
|
|
public VehicleRouter build(Map<String, String> params);
|
|
|
|
|
2013-04-18 23:35:02 +02:00
|
|
|
}
|