LOMS

Local Map System

From: Michael Cozzi

Domain:
People are always getting lost. Some people simply have trouble finding where to go. This is what LOMS is designed for. The idea is that this LOMS could be interfaced with a web page and allow people to find their way around. This version knows just a map of Toms River and in fact only a portion of Toms River.

This will be useful for all the tourist that visit this town or the surronding area. During the summer there are many tourists. All the user needs to do is input the names of the two streets at the closest intersection and the name of there destination (street name only).

I initialy intended to have this be able to go from building number to building number, but this would have turned out to be a very large task to undertake.

Illustration:
Here is an example of the output you will get from a given query.

| ?- input(hardenbrook, james, neil).

Get on hardenbrook.
Turn right onto james.
Turn right onto wright.
Turn left onto division.
Turn left onto neil.
You are now on: neil


As you can see the street extensions have been removed. It is really James Street Wright Avenue, Division Street, and Neil Road.
The following is the start of the LOMS which takes the users input and calls clauses to interpret the given street names into useful terms for the system.

input(A, B, Dest) :-
intersect(Int, A, D),
intersect(Int, B, Db),
A \== B,
meets(Int, X, south),
addbeen([], X, Newbeen),
firstprint(X),
(routedone(X, Dest, Newbeen); route(X, north, Dest, Newbeen)).



Methods:

The code is can be quite messy looking if you only see part of it so I will not be showing code here. However, I will quickly go throught the implementation. The user inputs the three streets mentioned in the DOMAIN. The interpreter of LOMS then finds which street segments intersect at the given intersection. For consistancy you are started on the south corner of the intersection.
LOMS then traverses through a search for adjacent road segments, and their adjacent and so on. To avoid looping back a list is kept of the road segments we have already visited. The output is printed after the print clauses determine turn direction if a tuirn is even needed.

Conclusions:

First of all this was immensly harder than I thought in the beggining. Many things that I wanted to do with LOMS needed to be trashed because of time constraints or simple coding problems and difficulty in logically implementing them.
This project has generated interest in programming that lately has been lacking in myself. Although I would not call LOMS a complete success I have found an error that I am not seeing the way to fix it, maybe my brain is fried due to the time of the year. I really do not know but it was very aggrevating not to be able to fix this problem.
Apparently whenever the trace takes a turn to the north, the program gets stuck in an infinite loop. I do not know if this is coincidence with the north direction or an error in the coding.