文件名称:pathfinding
介绍说明--下载内容来自于网络,使用问题请自行百度
prolog 找路例子程序:
=== === ===
Part 1-Adding connections
Part 2-Simple Path
example
| ?- path1(a,b,P,T).
will produce the response:
T = 15
P = [a,b] ?
Part 3 - Non-repeating path
As an example, the query:
?- path2(a,h,P,T).
will succeed and may produce the bindings:
P = [a,depot,b,d,e,f,h]
T = 155
Part 4 - Generating a path below a cost threshold
As an example, the query:
?- path_below_cost(a,[a,b,c,d,e,f,g,h],RS,300).
returns:
RS = [a,b,depot,c,d,e,g,f,h] ?
RS = [a,c,depot,b,d,e,g,f,h] ?
no
==================================
-prolog to find a way examples : ==================================== Part 1-Adding connections Part 2 - Simple Path example | - path1 (a, b, P, T). will produce the response : T = 15, P = [a, b] Part 3-Non-repeating path As an example, the query :-path2 (a, h, P, T). will succeed and may produce the bindings : P = [a, depot, b, d, e, f, h] T = 155 Part 4-Generating a path below a cost threshold As an example, the query :-path_below_cost (a, [a, b, c, d, e, f, g, h], RS, 300). returns : RS = [a, b, depot, c, d, e , g, f, h] RS = [a, c, depot, b, d, e, g, f, h] no =====================
=== === ===
Part 1-Adding connections
Part 2-Simple Path
example
| ?- path1(a,b,P,T).
will produce the response:
T = 15
P = [a,b] ?
Part 3 - Non-repeating path
As an example, the query:
?- path2(a,h,P,T).
will succeed and may produce the bindings:
P = [a,depot,b,d,e,f,h]
T = 155
Part 4 - Generating a path below a cost threshold
As an example, the query:
?- path_below_cost(a,[a,b,c,d,e,f,g,h],RS,300).
returns:
RS = [a,b,depot,c,d,e,g,f,h] ?
RS = [a,c,depot,b,d,e,g,f,h] ?
no
==================================
-prolog to find a way examples : ==================================== Part 1-Adding connections Part 2 - Simple Path example | - path1 (a, b, P, T). will produce the response : T = 15, P = [a, b] Part 3-Non-repeating path As an example, the query :-path2 (a, h, P, T). will succeed and may produce the bindings : P = [a, depot, b, d, e, f, h] T = 155 Part 4-Generating a path below a cost threshold As an example, the query :-path_below_cost (a, [a, b, c, d, e, f, g, h], RS, 300). returns : RS = [a, b, depot, c, d, e , g, f, h] RS = [a, c, depot, b, d, e, g, f, h] no =====================
(系统自动生成,下载前可以参看下载内容)
下载文件列表
pathfinding.pl
www.dssz.com.txt
www.dssz.com.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.