mahmoudjobeel1 / Coast-Guard-Plan

A Simplified Coast Guard agent in Prolog with defined fluents, axioms, and a goal predicate to collect passengers from max two ships and drop them at one station, given a 3x3 or 4x4 grid, and capacities of 1 or 2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coast Guard Plan

The Coast Guard problem is a problem where we have a grid (3 x 3) or (4 x 4) represents a sea area and there are 1 or 2 ships each has 1 passenger, our agent (Rescue Boat) task is to try to investigate the grid, reach the ships positions and save people by taking them to Stations. Our agent is a blind one, it doesn’t know in the beginning where it should go, but it has a KB(knowledge base) which informs it of the grid objects positions.


Test Case:

grid(3,3). agent_loc(0,1). ships_loc([[2,2],[1,2]]). station(1,1). capacity(1).

alt text

Result:

  • result(drop,result(left,result(pickup,result(right,result(drop,result(left,result(up,result(pickup,result(right,result(down,result(down,s0)))))))))))
  • result(drop,result(left,result(pickup,result(right,result(drop,result(up,result(left,result(pickup,result(right,result(down,result(down,s0)))))))))))
  • others

Time:

3.46 s

About

A Simplified Coast Guard agent in Prolog with defined fluents, axioms, and a goal predicate to collect passengers from max two ships and drop them at one station, given a 3x3 or 4x4 grid, and capacities of 1 or 2.


Languages

Language:Prolog 100.0%