The Java (TM) 2 Platform The Wumpus World Copyright (C) 2001 Brian Curry Description =============================================================================== The Wumpus World is a graphical simulation is an environment designed to stress the inference capabilities of an agent. Distribution =============================================================================== A number of files should be supplied you in this compressed archive: Wumpus.sh, a UNIX shell executable. Wumpus.bat, a DOS batch executable. Wumpus.jar, a Java JAR distribution. *.area, each an environment definition. README.txt, this brief introduction. Requirements =============================================================================== The Java VM, version 1.3.1 or greater, as provided in either the Java Development Kit (JDK) or the Java Runtime Environment (JRE) is required for execution of the simulation; this is available online at http://java.sun.com. Earlier versions, namely 1.2.2 or earlier, have typical difficulty compiling nested, abstract, static classes, which I have used frequently in the implementation of the agent. Execution =============================================================================== For UNIX platforms, simply execute the ".sh" script from a user shell prompt. For Windows platforms, simply execute the ".bat" script from a command prompt. Having done so, select the "File->Open..." menu item, choose any of the above environment definitions (that is, a *.area file distributed in this package), and click the "Play" button in the toolbar. One immediately notices the division of the display into a number of graphical components; these are, in no particularly sensible order: the menu bar, the toolbar, the status panel, the legend, and the environs panel. The menu bar, by which the user may "Open..." existing areas, "Make..." new areas through psuedo-random generation, "Save..." the currently open area so that it may be later loaded, or "Close" the currently open area so that another may now be loaded or created, is thus concerned with file manipulation. The toolbar, by which the user may "Play" the simulation in the current area, "Pause" a playing simulation, "Step" the simulation through individual iterations of the gameplay, "Loop" the simulation such that after the completion of one area a new area will be randomly generated, or "Delay" the simulation to better appreciate the fine details, is thus concerned with simulation time and its management. The status panel simply indicates information applying to the current iteration of the simulation, such as the "Action" presently being performed by the agent and the number of "Points" that it has thus accumulated (or sadly lost). One would also do well to note the "Percept" status bar shuffled beneath the others. The legend panel simply denotes objects in the environment by a flat color; as multiple objects, such as the Wumpus, his Gold, or the Agent may coexist concurrently in any given tile, each tile is divided into a number of concentric "frames", the color of which denotes that object as in the legend. The environs panel, most interestingly, is further subdivided into the "Dialectics" (roughly speaking, logical inference) and the "Prospectus" (roughly speaking, a formal proposal), where the "Dialectics" convey the environment as it is thus understood by the agent and where the "Prospectus" conveys the environment as we omnisciently understand it to truly exist. Intentions =============================================================================== Thus is demonstrated the feasibility, but great unpracticality, of coercing a procedural language such as Java to meet the contrary demands of a logical language such as the first-order predicate calculus. The supplied .area file is equivalent to that provided on p. 154 of the textbook; one may be surprised to find that it performs comparably (if not exactly) to the documented stages of the agent's movement as listed later on p. 156. Thus is also demonstrated the preferability of the blind to the alert to the risky forms of the implemented agent. The blind agent randomly chooses from amongst the permissible actions; the alert agent wisely, but cautiously, chooses with care (specifically, it will never enter a tile known to be neither OK nor un-OK); the risky agent foolishly, but often rewardingly, chooses without regard to personal safety or points (specifically, it will enter tiles whose danger is indeterminate). Note than neither of the latter two will ever enter a tile *known* to be un-OK. Due to constricting time constraints, the type of agent to allow can only be changed through the code itself. Please refer to the protected "type" member of the Wumpus.Agent.KnowledgeBase class. Apologies in advance. Admissions =============================================================================== The alert agent is so cautious as to often find himself in a perpetual state of confusion, oscillating between two safe tiles. This is alleviated as much as is reasonable by maintaining a list of recently accessed tiles, but is nonetheless prone to occur. The risky agent is so uncautious as to quickly find himself bled dry of all points, bereft of pride and then left to rot with the Wumpus. Modifying the grevious penalty for death in the "Define Rules..." dialog does appear to mildly allay these suicidal tendencies. The environments randomly generated are rather unforgiving (e.g., that the agent may at times be spawned into the Wumpus or that the gold may be spawned into a Pit); this is entirely intentional and in keeping with the technical discussion of the Wumpus World in our text. If it disturbs you, the "Pit Probability" may quite be lowered in the "Make..." dialog. Lastly, there appears an incidental fluke in the inference of pits that may encourage the agent to declare pits to be where they should so clearly not be. This does not appear especially harmful, as the agent does usually correct the minor intransigence after some inquisitive exploration. Ah, but the agent is quite efficient at dispatching that Wumpus...and all it takes is that one well-timed arrow. Design =============================================================================== I'd rather not discuss it in detail; suffice it to say that provided here is the most complete (and by complete I imply modularity, genericism, and all that fine, dandy stuff) implementation of the Wumpus World in a procedural language (or, at the very least, Java). It's thus unfortunate that time could not (again) be afforded to its documentation, but such are the constraints of Dead Week. Oh, and for a taste of the accomplishment here, you might examine the Wumpus.Agent.Rule.FallibleRule class. Mighty tasty. Criticisms =============================================================================== I again feel inclined to denigrate this emphasis on software engineering. Furthermore, I feel this assignment to have little intrinsic value beyond the realization that Java is indeed a poor substitute for LISP or CLIPS; what might have been achieved more effortlessly in such artificial intelligence specific languages as those is only arrived at with much wasted effort in Java. But, hey--at least it looks pretty, right? ~Brian C. (labrat)