Presentation is loading. Please wait.

Presentation is loading. Please wait.

Assignment #1: Desperate Jealous Husbands

Similar presentations


Presentation on theme: "Assignment #1: Desperate Jealous Husbands"— Presentation transcript:

1 Assignment #1: Desperate Jealous Husbands
Artificial Intelligence IS-383 Dr. Daniel Vallejo Team: Ruslán Ledesma Garza Juan Fernando Santos Montaño Liliana Rojas Campos Jair Cazarin Villanueva

2 Agenda Problem Statement. Architecture. Algorithm. Demo.

3 Problem Statement Problem:
Three jealous husbands and their wives need to cross a river. They find a small boat that can contain no more than two people. At least one person has to be in the boat for each crossing.

4 Problem Statement Goal:
Find a schedule of crossings that will permit all six people to cross the river so that none of the women shall be left in company with any of the men, unless her husband is present. It is assumed that all passengers on the boat unboard before the next trip and at least one person has to be in the boat for each crossing.

5 Architecture MVC (Model, View, Controller).

6 Architecture Controller: Model: View
Processes and responds to events from the View. Invoke changes on the model. Model: A.k.a. Domain Layer. Interchangeable models. (we have the possibility to change the main algorithm). View Two views: text based and graphical.

7 Architecture DJHState:
Encapsulate the states of both sides of the river and the boat. Implements the basic moves or states that can be used according to the problem statement. Generate possible movements in order to get the solution.

8 Architecture Main Program: public class DesperateJealousHusbands {
public static void main(String args[]) DJHModelInterface model = new DJHModel(); DJHControllerInterface controller = new DJHController(model); }

9 Algorithm DFS (Depth First Search) a.k.a. Brute Force.
State aware algorithm (won’t repeat states). Recursive-Iterative solution distributed in two recursive functions. DFS1: Move to right bank and verify goal. Move two people. DFS2: Move to left bank. Move 1 or 2 people. Stops on first solution.

10 Demo


Download ppt "Assignment #1: Desperate Jealous Husbands"

Similar presentations


Ads by Google