Ohh yes,I completely forgot about that. It works now
PS: glad to be co-nationals :) Thanks for helping a beginer. I am done with the questions for now,sorry for the stress :)
How do i use this predicate minimum? If i use it like this in querry,i get "false":
short(Ori,Dest,Min):-findall([Path,Lenght],route([Ori],Dest,Path,0,Lenght),List),
minimum(List,Min).
Sorry,I ment to put Lenght instead of L:
short_path(X,Y,Len):-findall(Lenght,path([X],Y,Path,0,Lenght),List), Lenght < Len.
Only one request of help i have,here is my code:
minn([H],H).
minn([H|T],Min) :- minn(T,Mum),(H < Mum -> Min = H; Min = Mum)...
I needed to print the path with the lenght less than a lenght i give,something like this:
short_path(X,Y,Len):-findall(L,path([X],Y,Path,0,Lenght),List), Lenght < Len.
But its not good how i wrote.Can you help me?
Thank you,it works now,i didnt understand how to call path.i have one more question if you dont mind: how can i change this code to print only the shortest path ?
i have read it many times,but i dont understand it, oh(1,2,3) what that does numbers reprsent? and again the arguments of path what are representing? Hope you can explain your code that you post it there,I`ll apreciated.Thanks
Cann someone help me how to find path of a route in sistem,like: if i have a route from A to B i need to get all the cities that traverse from A to B ? how can thsi be done ? thanks
If i have this links:
link(detroit,toronto).
link(chicago,washington).
link(denver,sacramento).
link(sacramento,chicago).
link(toronto,chicago).
....................
How can i find witch pair of distinct cities are connected using 2 links ? Any ideea ? Thanks
Hello i have a question regarding my project. I have a few clauses link() that take a origin city,destination,spee limit and duration.( Ex:link(Chicago,Detroit,170,6). ). How can I print only the links with the speed below 100 ? How can I querry that ? Thanks in advance.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.