Skip to content

Commit ea47f42

Browse files
committed
Readme files updated.
1 parent a6d1f3e commit ea47f42

File tree

4 files changed

+170
-188
lines changed

4 files changed

+170
-188
lines changed

aima-core/README.txt renamed to aima-core/README.md

Lines changed: 19 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ For examples of how to use the various algorithms and supporting classes, look a
4040

4141
== Notes on Search ==
4242

43-
To solve a problem with (non CSP )Search .
44-
# you need to write five classes:
43+
To solve a problem with (non CSP )Search you need to write five classes:
4544
# a class that represents the Problem state. This class is independent of the framework and does NOT need to subclass anything. Let us, for the rest of these instruction, assume you are going to solve the NQueens problem. So in this step you need to write something like aima.core.environment.nqueens.NQueensBoard.
4645
# an implementation of the aima.core.search.framework.GoalTest interface. This implements only a single function ---boolean isGoalState(Object state); The parameter state is an instance of the class you created in step 1-a above. For the NQueensProblem you would need to write something like aima.core.environment.nqueens.NQueensGoalTest.
4746
# an implementation of the aima.core.search.framework.ActionsFunction interface. This generates the allowable actions from a particular state. An example is aima.core.environment.nqueens.NQueensFunctionFactory.NQActionsFunction.
@@ -56,55 +55,25 @@ To actually search you need to
5655
# instantiate a SearchAgent and
5756
# print any actions and metrics
5857

59-
A good example (from the NQueens Demo ) is:
58+
A good example (from the NQueens Demo) is:
6059
{{{
6160
private static void nQueensWithBreadthFirstSearch() {
62-
try {
63-
System.out.println("\nNQueensDemo BFS -->");
64-
Problem problem = new Problem(new NQueensBoard(8),
65-
NQueensFunctionFactory.getActionsFunction(),
66-
NQueensFunctionFactory.getResultFunction(),
67-
new NQueensGoalTest());
68-
Search search = new BreadthFirstSearch(new TreeSearch());
69-
SearchAgent agent = new SearchAgent(problem, search);
70-
printActions(agent.getActions());
71-
printInstrumentation(agent.getInstrumentation());
72-
} catch (Exception e1) {
73-
e1.printStackTrace();
74-
}
75-
}
61+
try {
62+
System.out.println("\nNQueensDemo BFS -->");
63+
Problem problem = new Problem(new NQueensBoard(boardSize), NQueensFunctionFactory.getIActionsFunction(),
64+
NQueensFunctionFactory.getResultFunction(), new NQueensGoalTest());
65+
SearchForActions search = new BreadthFirstSearch(new TreeSearch());
66+
SearchAgent agent = new SearchAgent(problem, search);
67+
printActions(agent.getActions());
68+
printInstrumentation(agent.getInstrumentation());
69+
} catch (Exception e) {
70+
e.printStackTrace();
71+
}
72+
}
73+
}
7674
}}}
7775

78-
79-
== Search Inheritance Trees ==
80-
81-
There are two inheritance trees in Search. One deals with the "mechanism" of search.
82-
83-
This inheritance hierarchy looks like this:
84-
85-
||[http://aima-java.googlecode.com/svn/trunk/aima-core/src/main/java/aima/core/search/framework/NodeExpander.java NodeExpander] (encapsulates the Node expansion mechanism)||---||---||
86-
||---|| [http://aima-java.googlecode.com/svn/trunk/aima-core/src/main/java/aima/core/search/framework/QueueSearch.java QueueSearch]||---||
87-
||---||---||[http://aima-java.googlecode.com/svn/trunk/aima-core/src/main/java/aima/core/search/framework/GraphSearch.java GraphSearch]||
88-
||---||---||[http://aima-java.googlecode.com/svn/trunk/aima-core/src/main/java/aima/core/search/framework/TreeSearch.java TreeSearch]||
89-
90-
The second tree deals with the search instances you can use to solve a problem. These implement the aima.core.search.framework.Search interface.
91-
92-
||Search||---||---||---||
93-
||---||BreadthFirstSearch||---||---||
94-
||---||DepthFirstSearch||---||---||
95-
||---||HillClimbingSearch||---||---||
96-
||---||PrioritySearch||---||---||
97-
||---||---||BestFirstSearch||---||
98-
99-
etc...
100-
101-
So if you see a declaration like
102-
"SimulatedAnnealingSearch extends NodeExpander implements Search" , do not be confused.
103-
104-
the superclass ([http://aima-java.googlecode.com/svn/trunk/aima-core/src/main/java/aima/core/search/framework/NodeExpander.java NodeExpander]) provides the mechanism of the search and the interface (Search) makes it suitable for use in solving actual problems.
105-
106-
Searches like DepthFirstSearch which need to be used as a search (so implementing the Search interface) and can be configured with either GraphSearch or TreeSearch (the mechanism) have a constructor like
107-
public DepthFirstSearch(QueueSearch search).
76+
For further information about code design, see the [Wiki] (https://github.com/aimacode/aima-java/wiki).
10877

10978
== Logic Notes ==
11079
To use First Order Logic, first you need to create an instance of aima.core.logic.fol.domain.FOLDomain which collects the FOL Constants, Prredicates, and Function etc... that you use to solve a particular problem.
@@ -116,11 +85,13 @@ FOLParser parser = new FOLParser(weaponsDomain);
11685

11786
the basic design of all the logic code is that the parser creates a Composite (Design Patterns by Gamma, et al) parse tree over which various Visitors (Design Patterns by Gamma, et al) traverse. The key difference between the Visitor elucidated in the GOF book and the code is that in the former the visit() methods have a void visit(ConcreteNode) signature while the visitors used in the logic code have a Object visit(ConcreteNode,Object arg) signature. This makes testing easier and allows some recursive code that is hard with the former .
11887

88+
11989
== Probability Notes ==
12090

12191
I have tried to make the code stick very closely to Dr.Norvig's' pseudo-code. Looking at the tests will reveal how to use the code.
12292

123-
==LearningNotes==
93+
94+
== LearningNotes ==
12495

12596
=== Main Classes and responsibilities ===
12697
A <DataSet> is a collection of <Example>s. Wherever you see "examples" in plural in the text, the code uses a DataSet. This makes it easy to aggregate operations that work on collections of examples in one place.
Lines changed: 118 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,119 +1,119 @@
1-
= AIMA-GUI =
2-
3-
by Ruediger Lunde ([email protected])
4-
5-
This project contains graphical applications and command line demos, which
6-
demonstrate the use of some of the aima-core project features. Currently, it
7-
focuses on search algorithms and agent concepts. Application class names end
8-
with "App" and command line demo class names end with "Demo".
9-
Simple demo console applications can be found in package aima.gui.demo.
10-
Graphical demo applications are available based on JavaFX (package aima.gui.fx.applications) and
11-
Swing (package aima.gui.swing.applications). Each platform-specific root package contains an
12-
integrated application providing access to all integrable demos. The individual demos are placed
13-
in sub-packages. Note that JavaFX and Swing demos are structured quite differently.
14-
They use different frameworks (sub-package framework) and also differ in function.
15-
16-
== Requirements ==
17-
# Depends on the aima-core project.
18-
19-
== Current Release: 1.0.9-AIMA-GUI Chp 7 Rewrite Support ==
20-
1.0.9-Chp 7 Rewrite Support : 10 Aug 2014 :<br>
21-
* Updated to work with the latest version of aima-core (0.11.0).
22-
23-
== Running the GUIs and Command Line Demos ==
24-
Under the release/ directory you should find two jar files, aima-core.jar and aima-gui.jar, ensure these are on your CLASSPATH, the different GUI programs that can be run using these are:
25-
* java -jar aima-gui.jar
26-
+ this will run the default AimaDemoApp, this allows you to run all other applications from a central location as well as all of the current command line demos.
27-
28-
* java -classpath aima-gui.jar aima.gui.swing.demo.vacuum.VacuumApp
29-
+ provides a demo of the different agents described in Chapter 2 for tackling the Vacuum World.
30-
* java -classpath aima-gui.jar aima.gui.swing.demo.search.games.EightPuzzleApp
31-
+ provides a demo of the different search algorithms described in Chapter 3 and 4.
32-
* java -classpath aima-gui.jar aima.gui.swing.demo.search.games.NQueensApp
33-
+ provides a demo of the different search algorithms described in Chapter 3 and 4.
34-
* java -classpath aima-gui.jar aima.gui.swing.demo.search.games.TicTacToeApp
35-
+ provides a demo of the different search algorithms described in Chapter 5.
36-
* java -classpath aima-gui.jar aima.gui.swing.demo.search.map.RouteFindingAgentApp
37-
+ provides a demo of the different agents/search algorithms described in Chapters 3 and 4, for tackling route planning tasks within simplified Map environments.
38-
* java -classpath aima-gui.jar aima.gui.swing.demo.search.csp.MapColoringApp
39-
+ provides a demo of the different csp algorithms described in Chapters 6.
40-
41-
The following command line demos can be run as well:
42-
* java -classpath aima-gui.jar aima.gui.demo.agent.TrivialVacuumProg
43-
* java -classpath aima-gui.jar aima.gui.demo.learning.LearningProg
44-
* java -classpath aima-gui.jar aima.gui.demo.logic.DPLLProg
45-
* java -classpath aima-gui.jar aima.gui.demo.logic.FolProg
46-
* java -classpath aima-gui.jar aima.gui.demo.logic.PLFCEntailsProg
47-
* java -classpath aima-gui.jar aima.gui.demo.logic.PLResolutionProg
48-
* java -classpath aima-gui.jar aima.gui.demo.logic.TTEntailsProg
49-
* java -classpath aima-gui.jar aima.gui.demo.logic.WalkSatProg
50-
* java -classpath aima-gui.jar aima.gui.demo.probability.ProbabilityProg
51-
* java -classpath aima-gui.jar aima.gui.demo.search.CSPProg
52-
* java -classpath aima-gui.jar aima.gui.demo.search.EightPuzzleProg
53-
* java -classpath aima-gui.jar aima.gui.demo.search.NQueensProg
54-
* java -classpath aima-gui.jar aima.gui.demo.search.TicTacToeProg
55-
56-
57-
= Change History (Update in reverse chronological order) =
58-
1.0.8-AIMA-GUI And Or Search Supported : 09 Oct 2012 :<br>
59-
* Updated to work with the latest version of aima-core (0.10.5).
60-
61-
1.0.7-AIMA-GUI Connect4 Added : 08 Jan 2012 :<br>
62-
* Updated to work with the latest version of aima-core (0.10.4).
63-
* Added Connect 4 game, which demonstrates improved adversarial search capabilities of aima-core.
64-
* Tic-Tac-Toe command line and gui rewritten to work with improved APIs.
65-
66-
1.0.6-AIMA-GUI Updated : 16 Sept 2011 :<br>
67-
* Updated to work with the latest version of aima-core (0.10.2).
68-
** Moved Chapter 21 Demos on Reinforcement Learning to LearningDemo from ProbabilityDemo.
69-
** Updated Reinforcement Learning Demos to generate data that can be used to create graphs of learning rates and RMS errors in utility.
70-
71-
1.0.5-AIMA-GUI Updated : 31 Jul 2011 :<br>
72-
* Updated to work with the latest version of aima-core (0.10.1).
73-
** Added demo of Fixed-Lag-Smoothing to command line probability demo.
74-
75-
1.0.4-AIMA-GUI Updated : 03 Jul 2011 :<br>
76-
* Updated to work with the latest version of aima-core (0.10.0).
77-
78-
1.0.3-AIMA-GUI Updated : 19 Dec 2010 :<br>
79-
* Updated to work with the latest version of aima-core.
80-
* Menu entry name fixed in MapColoringApp.
81-
82-
1.0.2-AIMA-GUI Clean Up : 05 Nov 2010 :<br>
83-
* AimaDemoFrame now shows complete package path names and orders them lexicographically.
84-
* CSPDemo renamed to MapColoringCSPDemo.
85-
86-
1.0.1-AIMA-GUI Old Demo Re-Added : 02 Oct 2010 :<br>
87-
* Re-added the command line Trivial Vacuum Demo so that its easier
88-
for someone to get up and running with the code.
89-
90-
1.0.0-AIMA-GUI New Games : 22 Aug 2010 :<br>
91-
* New graphical game applications added (8-Puzzle, N-Queens, TicTacToe).
92-
* New graphical CSP application added (map coloring).
93-
* Code consolidated and documentation updated.
94-
95-
0.2.0-AIMA-GUI Enhancements : 15 Mar 2010 :<br>
96-
New features added (inspired by course TDDC17)
97-
* Added all command line demos and GUI demos to a
98-
unified interface for running all of them from one
99-
place.
100-
* Agent simulator now has step and pause button.
101-
* Logic for simulation control buttons improved.
102-
* Design of 2d vacuum view updated.
103-
* Vacuum symbol now animated.
104-
* AgentThread renamed to SimulationThread.
105-
* Map agent controller cleaned up.
106-
* Documentation updated.
107-
108-
0.1.2-AIMAX-OSM Minor Fixes : 09 Feb 2010 :<br>
109-
* Java Doc now uses newer package-info.java mechanism.
110-
* Documentation improvements.
111-
112-
0.1.1-AIMAX-OSM Added : 06 Feb 2010 :<br>
113-
* Major redesign, structures simplified, agent environment now serves as mvc-model.
114-
* Minor updates to support addition of aimax-osm project to AIMA3e-Java.
115-
116-
0.1.0-AIMA3e Published : 10 Dec 2009 :<br>
117-
First full release based on the 3rd edition of AIMA. This projects contains all the GUI and command line demo
118-
code separated out from the original AIMA2e source tree and has been updated to work with the
1+
= AIMA-GUI =
2+
3+
by Ruediger Lunde ([email protected])
4+
5+
This project contains graphical applications and command line demos, which
6+
demonstrate the use of some of the aima-core project features. Currently, it
7+
focuses on search algorithms and agent concepts. Application class names end
8+
with "App" and command line demo class names end with "Demo".
9+
Simple demo command line applications can be found in package aima.gui.demo.
10+
Graphical demo applications are available based on JavaFX (package aima.gui.fx.applications) and
11+
Swing (package aima.gui.swing.applications). Each platform-specific root package contains an
12+
integrated application providing access to all integrable demos. The individual demos are placed
13+
in sub-packages. Note that JavaFX and Swing demos are structured quite differently.
14+
They use different frameworks (sub-package framework) and also differ in function.
15+
16+
== Requirements ==
17+
# Depends on the aima-core project.
18+
19+
== Current Release: 1.0.9-AIMA-GUI Chp 7 Rewrite Support ==
20+
1.0.9-Chp 7 Rewrite Support : 10 Aug 2014 :<br>
21+
* Updated to work with the latest version of aima-core (0.11.0).
22+
23+
== Running the GUIs and Command Line Demos ==
24+
Under the release/ directory you should find two jar files, aima-core.jar and aima-gui.jar, ensure these are on your CLASSPATH, the different GUI programs that can be run using these are:
25+
* java -jar aima-gui.jar
26+
+ this will run the default AimaDemoApp, this allows you to run all other applications from a central location as well as all of the current command line demos.
27+
28+
* java -classpath aima-gui.jar aima.gui.swing.demo.vacuum.VacuumApp
29+
+ provides a demo of the different agents described in Chapter 2 for tackling the Vacuum World.
30+
* java -classpath aima-gui.jar aima.gui.swing.demo.search.games.EightPuzzleApp
31+
+ provides a demo of the different search algorithms described in Chapter 3 and 4.
32+
* java -classpath aima-gui.jar aima.gui.swing.demo.search.games.NQueensApp
33+
+ provides a demo of the different search algorithms described in Chapter 3 and 4.
34+
* java -classpath aima-gui.jar aima.gui.swing.demo.search.games.TicTacToeApp
35+
+ provides a demo of the different search algorithms described in Chapter 5.
36+
* java -classpath aima-gui.jar aima.gui.swing.demo.search.map.RouteFindingAgentApp
37+
+ provides a demo of the different agents/search algorithms described in Chapters 3 and 4, for tackling route planning tasks within simplified Map environments.
38+
* java -classpath aima-gui.jar aima.gui.swing.demo.search.csp.MapColoringApp
39+
+ provides a demo of the different csp algorithms described in Chapters 6.
40+
41+
The following command line demos can be run as well:
42+
* java -classpath aima-gui.jar aima.gui.demo.agent.TrivialVacuumProg
43+
* java -classpath aima-gui.jar aima.gui.demo.learning.LearningProg
44+
* java -classpath aima-gui.jar aima.gui.demo.logic.DPLLProg
45+
* java -classpath aima-gui.jar aima.gui.demo.logic.FolProg
46+
* java -classpath aima-gui.jar aima.gui.demo.logic.PLFCEntailsProg
47+
* java -classpath aima-gui.jar aima.gui.demo.logic.PLResolutionProg
48+
* java -classpath aima-gui.jar aima.gui.demo.logic.TTEntailsProg
49+
* java -classpath aima-gui.jar aima.gui.demo.logic.WalkSatProg
50+
* java -classpath aima-gui.jar aima.gui.demo.probability.ProbabilityProg
51+
* java -classpath aima-gui.jar aima.gui.demo.search.CSPProg
52+
* java -classpath aima-gui.jar aima.gui.demo.search.EightPuzzleProg
53+
* java -classpath aima-gui.jar aima.gui.demo.search.NQueensProg
54+
* java -classpath aima-gui.jar aima.gui.demo.search.TicTacToeProg
55+
56+
57+
= Change History (Update in reverse chronological order) =
58+
1.0.8-AIMA-GUI And Or Search Supported : 09 Oct 2012 :<br>
59+
* Updated to work with the latest version of aima-core (0.10.5).
60+
61+
1.0.7-AIMA-GUI Connect4 Added : 08 Jan 2012 :<br>
62+
* Updated to work with the latest version of aima-core (0.10.4).
63+
* Added Connect 4 game, which demonstrates improved adversarial search capabilities of aima-core.
64+
* Tic-Tac-Toe command line and gui rewritten to work with improved APIs.
65+
66+
1.0.6-AIMA-GUI Updated : 16 Sept 2011 :<br>
67+
* Updated to work with the latest version of aima-core (0.10.2).
68+
** Moved Chapter 21 Demos on Reinforcement Learning to LearningDemo from ProbabilityDemo.
69+
** Updated Reinforcement Learning Demos to generate data that can be used to create graphs of learning rates and RMS errors in utility.
70+
71+
1.0.5-AIMA-GUI Updated : 31 Jul 2011 :<br>
72+
* Updated to work with the latest version of aima-core (0.10.1).
73+
** Added demo of Fixed-Lag-Smoothing to command line probability demo.
74+
75+
1.0.4-AIMA-GUI Updated : 03 Jul 2011 :<br>
76+
* Updated to work with the latest version of aima-core (0.10.0).
77+
78+
1.0.3-AIMA-GUI Updated : 19 Dec 2010 :<br>
79+
* Updated to work with the latest version of aima-core.
80+
* Menu entry name fixed in MapColoringApp.
81+
82+
1.0.2-AIMA-GUI Clean Up : 05 Nov 2010 :<br>
83+
* AimaDemoFrame now shows complete package path names and orders them lexicographically.
84+
* CSPDemo renamed to MapColoringCSPDemo.
85+
86+
1.0.1-AIMA-GUI Old Demo Re-Added : 02 Oct 2010 :<br>
87+
* Re-added the command line Trivial Vacuum Demo so that its easier
88+
for someone to get up and running with the code.
89+
90+
1.0.0-AIMA-GUI New Games : 22 Aug 2010 :<br>
91+
* New graphical game applications added (8-Puzzle, N-Queens, TicTacToe).
92+
* New graphical CSP application added (map coloring).
93+
* Code consolidated and documentation updated.
94+
95+
0.2.0-AIMA-GUI Enhancements : 15 Mar 2010 :<br>
96+
New features added (inspired by course TDDC17)
97+
* Added all command line demos and GUI demos to a
98+
unified interface for running all of them from one
99+
place.
100+
* Agent simulator now has step and pause button.
101+
* Logic for simulation control buttons improved.
102+
* Design of 2d vacuum view updated.
103+
* Vacuum symbol now animated.
104+
* AgentThread renamed to SimulationThread.
105+
* Map agent controller cleaned up.
106+
* Documentation updated.
107+
108+
0.1.2-AIMAX-OSM Minor Fixes : 09 Feb 2010 :<br>
109+
* Java Doc now uses newer package-info.java mechanism.
110+
* Documentation improvements.
111+
112+
0.1.1-AIMAX-OSM Added : 06 Feb 2010 :<br>
113+
* Major redesign, structures simplified, agent environment now serves as mvc-model.
114+
* Minor updates to support addition of aimax-osm project to AIMA3e-Java.
115+
116+
0.1.0-AIMA3e Published : 10 Dec 2009 :<br>
117+
First full release based on the 3rd edition of AIMA. This projects contains all the GUI and command line demo
118+
code separated out from the original AIMA2e source tree and has been updated to work with the
119119
latest version of the aima-core library.

aima-gui/src/main/java/aima/gui/demo/search/NQueensDemo.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,11 @@ private static void nQueensWithBreadthFirstSearch() {
7777
Problem problem = new Problem(new NQueensBoard(boardSize), NQueensFunctionFactory.getIActionsFunction(),
7878
NQueensFunctionFactory.getResultFunction(), new NQueensGoalTest());
7979
SearchForActions search = new BreadthFirstSearch(new TreeSearch());
80-
SearchAgent agent2 = new SearchAgent(problem, search);
81-
printActions(agent2.getActions());
82-
printInstrumentation(agent2.getInstrumentation());
83-
} catch (Exception e1) {
84-
85-
e1.printStackTrace();
80+
SearchAgent agent = new SearchAgent(problem, search);
81+
printActions(agent.getActions());
82+
printInstrumentation(agent.getInstrumentation());
83+
} catch (Exception e) {
84+
e.printStackTrace();
8685
}
8786
}
8887

0 commit comments

Comments
 (0)