Example #1
0
		private void btnHillClimbing_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "NQueensDemo HillClimbing -->" + System.Environment.NewLine;

			Problem problem =  new Problem(new NQueensBoard(8),new NQueensSuccessorFunction(), new NQueensGoalTest(),new QueensToBePlacedHeuristic());
			Search search =  new HillClimbingSearch();
			SearchAgent agent = new SearchAgent(problem,search);

			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}
Example #2
0
		private void btnRecursiveDLS_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "NQueensDemo recursive DLS -->" + System.Environment.NewLine;

			Problem problem =  new Problem(new NQueensBoard(8),new NQueensSuccessorFunction(), new NQueensGoalTest());
			Search search = new DepthLimitedSearch(8);
			SearchAgent agent = new SearchAgent(problem, search);
			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}
Example #3
0
		private void btnIterativeDeeping_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "NQueensDemo Iterative DS -->" + System.Environment.NewLine;

			Problem problem =  new Problem(new NQueensBoard(8),new NQueensSuccessorFunction(), new NQueensGoalTest());
			Search search =  new IterativeDeepeningSearch();
			SearchAgent agent = new SearchAgent(problem,search);

			
			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}
Example #4
0
		private void btnBreadthFirst_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "NQueensDemo BFS -->" + System.Environment.NewLine;
			Problem problem =  new Problem(new NQueensBoard(8),new NQueensSuccessorFunction(), new NQueensGoalTest());
			Search search = new BreadthFirstSearch(new TreeSearch());
			SearchAgent agent2 = new SearchAgent(problem, search);
			printActions(agent2.getActions());
			printInstrumentation(agent2.getInstrumentation());
		}
Example #5
0
		private void btnSimulatedAnnealing_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "EightPuzzleDemo Simulated Annealing  Search -->" + System.Environment.NewLine;
			Problem problem = new Problem(random1,
				new EightPuzzleSuccessorFunction(),
				new EightPuzzleGoalTest(), new ManhattanHeuristicFunction());
			Search search = new SimulatedAnnealingSearch();
			SearchAgent agent = new SearchAgent(problem, search);
			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}
Example #6
0
		private void btnAStar_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "EightPuzzleDemo AStar Search (MisplacedTileHeursitic)-->" + System.Environment.NewLine;

			Problem problem = new Problem(random1,
				new EightPuzzleSuccessorFunction(),
				new EightPuzzleGoalTest(),
				new MisplacedTilleHeuristicFunction());
			Search search = new AStarSearch(new GraphSearch());
			SearchAgent agent = new SearchAgent(problem, search);
			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}
Example #7
0
		private void btnGreedyBestFirstMan_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "EightPuzzleDemo Greedy Best First Search (ManhattanHeursitic)-->" + System.Environment.NewLine;
			Problem problem = new Problem(boardWithThreeMoveSolution,
				new EightPuzzleSuccessorFunction(),
				new EightPuzzleGoalTest(), new ManhattanHeuristicFunction());
			Search search = new GreedyBestFirstSearch(new GraphSearch());
			SearchAgent agent = new SearchAgent(problem, search);
			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}
Example #8
0
		private void btnIDLS_Click(object sender, System.EventArgs e)
		{
			this.textBox1.Text = "EightPuzzleDemo Iterative DLS-->" + System.Environment.NewLine;
			Problem problem = new Problem(random1,
				new EightPuzzleSuccessorFunction(),
				new EightPuzzleGoalTest());
			Search search = new IterativeDeepeningSearch();
			SearchAgent agent = new SearchAgent(problem, search);
			printActions(agent.getActions());
			printInstrumentation(agent.getInstrumentation());
		}