cross a two missionaries from left to right) that can be applied to a particular state and returns the valid successor states. The generateSuccessors method checks the actions (e.g. The problem was solved using three different languages: Java, Python and Prolog: JavaĪ State class saves the current state of the problem, that is, how many missionaries and cannibals are in each side of the river and where is the boat (left or right). And, in some variations, one of the cannibals has only one arm and cannot row. The boat cannot cross the river by itself with no people on board. In this problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries). Solutions for the Missionaries and Cannibals Problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |