0

I'm working with a database or knowledge base, whatever you call it in Prolog. It is filled with facts about clients and jobs of a taxi company: client(id, name, surname, list_of_jobs).

The list of jobs is filled with facts in this form: job(from, to, price_per_km, date(day,month,year), no_of_car).

If there is a direct link between 2 locations, there can be in the database a fact as such: distance(Loc_a, loc_b, Km).

The drivers always choose the shortest path from point A to point B.

We need: count_loc(Loc_ N) - A predicate which counts how many times a location has been arrival or departure point in the whole database, stores that number in N and returns N.

most_km(X,Y) - Returns the name and surname of the client which has accumulated the most mileage while driving with this company.

most_money_made(X) - Returns the no_of_car of the taxi car which has made the most money in the month of december 2015.

This is way out of my league but i need to solve it, so if anyone knows and wants to i'd be thrilled.

Daki
  • 11
  • 1

0 Answers0