REPOSITORY
ontariotech/path-optimization Private
[참조 MVP] 농작업 경로 최적화 A-SW — 작업 구간을 최근접 휴리스틱으로 재정렬해 공차 이동거리를 줄입니다.
https://git.agrithing.ai/ontariotech/path-optimization.git 31e9d33 feat: adopt python SERVICE SDV reference implementation
9a8e645 feat: adopt python SERVICE SDV reference implementation
78244d2 ci: add language-specific static and dynamic analysis
3e39860 docs: define component scope and interface contract
511863b ci: verify contract tests and evidence package
de87e68 feat: add executable reference MVP
fe5cc8b docs: define component scope and interface contract
2 items · main
·/ asw_component/component.py
python · 661 B · 20ebeb9 Download
from __future__ import annotationsimport mathdef execute(payload: dict) -> dict: current = list(payload.get("start", [0, 0])) remaining = list(payload.get("tasks", [])) order, distance = [], 0.0 while remaining: task = min(remaining, key=lambda item: math.dist(current, item["point"])) leg = math.dist(current, task["point"]) order.append({"id": task["id"], "point": task["point"], "transfer_distance_m": round(leg, 3)}) distance += leg current = task["point"] remaining.remove(task) return {"algorithm": "nearest_neighbor", "order": order, "total_transfer_distance_m": round(distance, 3)}