1315.20 함수 기반 비용 모델링
1. 비용 모델링의 개요
PDDL 함수를 활용한 비용 모델링은 각 액션의 실행에 수반되는 정량적 비용을 도메인에서 명시적으로 표현하고, 플래너가 이를 고려하여 비용 효율적인 계획을 생성하도록 하는 기법이다. 비용은 에너지, 시간, 금전적 비용, 위험도 등 다양한 형태��� 모델링될 수 있다.
2. 기본 비용 모델
2.1 균일 비용 모델
모든 액션에 동일한 비용을 부여하는 가장 단순한 모델이다. 이는 계획 길이(액션 수) 최소화와 동치이다:
(:functions (total_cost))
(:action move :effect (... (increase (total_cost) 1)))
(:action pick :effect (... (increase (total_cost) 1)))
(:action place :effect (... (increase (total_cost) 1)))
(:metric minimize (total_cost))
2.2 액션별 차등 비용 모델
���션 유형에 따라 다른 고정 비용을 부여한다:
(:action move :effect (... (increase (total_cost) 5))) ;; 이동: 비용 5
(:action pick :effect (... (increase (total_cost) 2))) ;; 집기: 비용 2
(:action place :effect (... (increase (total_cost) 1))) ;; 놓기: 비용 1
(:action charge :effect (... (increase (total_cost) 10))) ;; 충전: 비용 10
2.3 매개변수 의존 비용 모델
비용이 액션의 매개변수에 따라 달라진다:
(:functions
(distance ?from - waypoint ?to - waypoint)
(move_cost_per_unit)
(total_cost)
)
(:action move
:parameters (?r - robot ?from - waypoint ?to - waypoint)
:effect (and
(not (robot_at ?r ?from))
(robot_at ?r ?to)
(increase (total_cost) (* (distance ?from ?to) (move_cost_per_unit)))
)
)
3. 다중 비용 요소 모델
3.1 에너지-시간 복합 비용
(:functions
(total_energy_cost)
(total_time_cost)
(energy_weight)
(time_weight)
)
(:action move
:parameters (?r - robot ?from ?to - waypoint)
:effect (and
(not (robot_at ?r ?from))
(robot_at ?r ?to)
(increase (total_energy_cost) (* (distance ?from ?to) (energy_per_meter ?r)))
(increase (total_time_cost) (/ (distance ?from ?to) (speed ?r)))
)
)
;; 가중 합 최소화
(:metric minimize
(+ (* (energy_weight) (total_energy_cost))
(* (time_weight) (total_time_cost))))
3.2 비용-위험 복합 비용
(:functions
(total_cost)
(total_risk)
(path_risk ?from - waypoint ?to - waypoint)
)
(:action move
:effect (and
(...)
(increase (total_cost) (distance ?from ?to))
(increase (total_risk) (path_risk ?from ?to))
)
)
(:metric minimize (+ (total_cost) (* 10 (total_risk))))
4. 로봇 도메인의 비용 모델링 사례
4.1 물류 로봇: 배송 비용
(:functions
(distance ?from ?to - waypoint)
(fuel_cost_per_km)
(handling_cost ?cargo - package)
(total_delivery_cost)
)
(:action deliver
:parameters (?r - robot ?pkg - package ?from ?to - waypoint)
:effect (and
(delivered ?pkg ?to)
(increase (total_delivery_cost)
(+ (* (distance ?from ?to) (fuel_cost_per_km))
(handling_cost ?pkg)))
)
)
4.2 검사 로봇: 커버리지 보상
(:functions
(inspection_value ?area - zone)
(total_value_collected)
(total_energy_spent)
)
(:action inspect_zone
:effect (and
(zone_inspected ?area)
(increase (total_value_collected) (inspection_value ?area))
(increase (total_energy_spent) (inspection_energy ?area))
)
)
;; 가치 최대화와 에너지 최소화의 균형
(:metric maximize (- (total_value_collected) (* 0.5 (total_energy_spent))))
5. 비용 함수와 메트릭의 연계
비용 모델의 최종 목표는 :metric 절에서의 최적화 대상으로 활용되는 것이다:
;; 비용 최소화
(:metric minimize (total_cost))
;; 보상 최대화
(:metric maximize (total_reward))
;; 복합 목표
(:metric minimize (- (total_cost) (* 0.3 (total_quality))))
6. 설계 지침
- 비용의 물리적 의미를 명확히 하라. 비용이 에너지(kWh), 시간(초), 거리(미터), 금전(원) 중 어떤 단위인지를 문서화한다.
- 모든 비용 발생 액션에서 비용을 갱신하라. 누락된 액션이 있으면 비용 최적화가 부정확해진다.
- 비용 값이 항상 양수임을 보장하라. 음의 비용은 무한 루프를 유발할 수 있다.
- 비용 함수의 초기값을 0으로 설정하라. 누적 비용��� 항상 0��서 시작���야 한다.
7. 참고 문헌
- Fox, M. & Long, D. (2003). “PDDL2.1: An Extension to PDDL for Expressing Temporal Planning Domains.” Journal of Artificial Intelligence Research, 20, 61–124.
- Hoffmann, J. (2003). “The Metric-FF Planning System: Translating ‘Ignoring Delete Lists’ to Numeric State Variables.” Journal of Artificial Intelligence Research, 20, 291–341.
- Haslum, P., Lipovetzky, N., Magazzeni, D., & Muise, C. (2019). An Introduction to the Planning Domain Definition Language. Morgan & Claypool Publishers.