코드보고 계산하는 것?
얌마 원래 어려운 거여. 그래서 괜춘한 프로그래밍 언어에선 갖가지 툴을 제공한다. 예를들면, 시간 측정 하는 거지.
니가 데이터 늘리면서 측정해보면, 인풋 사이즈 : 걸린 시간 보면 대충 관계를 알게 된다.
statistics(runtime, _),
schedule(riva at Start, riva at End, Schedule),
member(arrive(malcesine at _), Schedule), before(17:00, Start),
statistics(runtime, T).
Start = 18:5,
End = 20:20,
Schedule = [depart(riva at 18:5), arrive(torbole at 18:20), arrive(limone at 18:50), arrive(malcesine at 19:10), stay(malcesine, 19:10, 19:15), depart(malcesine at 19:15), arrive(limone at 19:35), arrive(torbole at 20:5), arrive(riva at 20:20)],
T = [279793, 68]
statistics(runtime, _),
sail(riva at Start, _), before(17:00, Start),
schedule(riva at Start, riva at End, Schedule),
member(arrive(malcesine at _), Schedule), before(17:00, Start),
statistics(runtime, T).
Start = 18:5,
End = 20:20,
Schedule = [depart(riva at 18:5), arrive(torbole at 18:20), arrive(limone at 18:50), arrive(malcesine at 19:10), stay(malcesine, 19:10, 19:15), depart(malcesine at 19:15), arrive(limone at 19:35), arrive(torbole at 20:5), arrive(riva at 20:20)],
T = [279804, 4]
그래프 탐색 스케줄링 코든데, 보면 위에껀 68cpu time. 아래껀 4cpu time 이런거지. 코드가 길면서 시간이 짧계 만드는 것. 니가 코드를 보고 왜 그런지 알아야 할 수 있는 거다.
끗
;; - dc App