ml4co_kit.task.routing.base
Base Task Class for Routing Problems.
Classes
|
Define the distance types as an enumeration. |
|
Distance evaluator for different distance types. |
|
Define the rounding types as an enumeration. |
|
Base class for all routing problems in the ML4CO kit. |
- class ml4co_kit.task.routing.base.DISTANCE_TYPE(value)[source]
Bases:
str,EnumDefine the distance types as an enumeration.
- ATT = 'ATT'
- EUC_2D = 'EUC_2D'
- EUC_3D = 'EUC_3D'
- GEO = 'GEO'
- MAN_2D = 'MAN_2D'
- MAN_3D = 'MAN_3D'
- MAX_2D = 'MAX_2D'
- MAX_3D = 'MAX_3D'
- class ml4co_kit.task.routing.base.DisntanceEvaluator(distance_type: DISTANCE_TYPE, round_type: ROUND_TYPE, geo_radius: float = 6371.393)[source]
Bases:
objectDistance evaluator for different distance types.
- static att(start: ndarray, end: ndarray)[source]
Return the Att distance between start and end points.
- cal_dist_matrix(coords: ndarray) ndarray[source]
Calculate the distance matrix for the given coordinates.
- cal_distance(start: ndarray, end: ndarray) float[source]
Return the distance based on the specified distance type.
- static euclidean(start: ndarray, end: ndarray)[source]
Return the Euclidean distance between start and end points.
- geographical(start: ndarray, end: ndarray)[source]
Return the Geographical distance between start and end points.
- static manhattan(start: ndarray, end: ndarray)[source]
Return the Manhattan distance between start and end points.
- class ml4co_kit.task.routing.base.ROUND_TYPE(value)[source]
Bases:
str,EnumDefine the rounding types as an enumeration.
- CEIL = 'ceil'
- FLOOR = 'floor'
- NO = 'no'
- ROUND = 'round'
- class ml4co_kit.task.routing.base.RoutingTaskBase(task_type: ~ml4co_kit.task.base.TASK_TYPE, minimize: bool, distance_type: ~ml4co_kit.task.routing.base.DISTANCE_TYPE, round_type: ~ml4co_kit.task.routing.base.ROUND_TYPE, precision: ~numpy.float32 | ~numpy.float64 = <class 'numpy.float32'>)[source]
Bases:
TaskBaseBase class for all routing problems in the ML4CO kit.