|
1 | | -package aima.gui.demo.agent; |
2 | | - |
3 | | -import aima.core.agent.Agent; |
4 | | -import aima.core.agent.Environment; |
5 | | -import aima.core.agent.EnvironmentView; |
6 | | -import aima.core.agent.impl.SimpleEnvironmentView; |
7 | | -import aima.core.environment.vacuum.ModelBasedReflexVacuumAgent; |
8 | | -import aima.core.environment.vacuum.VacuumEnvironment; |
9 | | - |
10 | | -/** |
11 | | - * Demonstrates, how to set up a simple environment, place an agent in it, |
12 | | - * and run it. The vacuum world is used as a simple example. |
13 | | - * |
14 | | - * @author Ruediger Lunde |
15 | | - */ |
16 | | -public class TrivialVacuumProg { |
17 | | - public static void main(String[] args) { |
18 | | - // create environment with random state of cleaning. |
19 | | - Environment env = new VacuumEnvironment(); |
20 | | - EnvironmentView view = new SimpleEnvironmentView(); |
21 | | - env.addEnvironmentView(view); |
22 | | - |
23 | | - Agent a = null; |
24 | | - a = new ModelBasedReflexVacuumAgent(); |
25 | | - // a = new ReflexVacuumAgent(); |
26 | | - // a = new SimpleReflexVacuumAgent(); |
27 | | - // a = new TableDrivenVacuumAgent(); |
28 | | - |
29 | | - env.addAgent(a); |
30 | | - env.step(16); |
31 | | - env.notifyViews("Performance=" + env.getPerformanceMeasure(a)); |
32 | | - } |
33 | | -} |
| 1 | +package aima.gui.prog.agent; |
| 2 | + |
| 3 | +import aima.core.agent.Agent; |
| 4 | +import aima.core.agent.Environment; |
| 5 | +import aima.core.agent.EnvironmentView; |
| 6 | +import aima.core.agent.impl.SimpleEnvironmentView; |
| 7 | +import aima.core.environment.vacuum.ModelBasedReflexVacuumAgent; |
| 8 | +import aima.core.environment.vacuum.VacuumEnvironment; |
| 9 | + |
| 10 | +/** |
| 11 | + * Demonstrates, how to set up a simple environment, place an agent in it, |
| 12 | + * and run it. The vacuum world is used as a simple example. |
| 13 | + * |
| 14 | + * @author Ruediger Lunde |
| 15 | + */ |
| 16 | +public class TrivialVacuumProg { |
| 17 | + public static void main(String[] args) { |
| 18 | + // create environment with random state of cleaning. |
| 19 | + Environment env = new VacuumEnvironment(); |
| 20 | + EnvironmentView view = new SimpleEnvironmentView(); |
| 21 | + env.addEnvironmentView(view); |
| 22 | + |
| 23 | + Agent a = null; |
| 24 | + a = new ModelBasedReflexVacuumAgent(); |
| 25 | + // a = new ReflexVacuumAgent(); |
| 26 | + // a = new SimpleReflexVacuumAgent(); |
| 27 | + // a = new TableDrivenVacuumAgent(); |
| 28 | + |
| 29 | + env.addAgent(a); |
| 30 | + env.step(16); |
| 31 | + env.notifyViews("Performance=" + env.getPerformanceMeasure(a)); |
| 32 | + } |
| 33 | +} |
0 commit comments