The MicroPsi Web Documentation System
[ start | index | login ]
start > simpleagent

simpleagent

Created by rvuine. Last edited by rvuine, 2 years and 339 days ago. Viewed 1,650 times. #29
[diff] [history] [edit] [rdf]
labels
attachments
accessor.png (7397)
simpleagent.zip (63916)

The simpleagent

About

The simpleagent is our first, simple, implementation of some principles of the Micropsi cognitive architecture. The current simpleagent has been developed by me (rvuine) - at least in terms of node net/java code. I did't come up with the stuff myself, though. Most of the time I'm just trying to convert Joschas ideas into something executable.

The goals

The goals of the simpleagent subproject are threefold:
  1. Proof-of-concept: We want to prove that the runtime system works and that the node net formalism and the toolkit can be used to implement cognitive agents. We do this by implementing and improving parts of the Dörnerian "Psi" agents. This goal can be considered more or less achieved - node nets surely work fine!
  2. Groundwork: We want to provide an agent that can be used by other projects to test and implement their ideas.
  3. A-Life: We want to elaborate the simpleagent (and the toolkit) to a point where several simpleagents, along with other, non-micropsi-agents, inhabit a complex world and show basic intelligent behaviour. The setting will be somewhat like the Dörner-world.
A current, rather stable version of the simpleagent is attached to this page. It is intend to run on toolkits with a version from 0.6.13 upwards (current CVS versions should work as well).

What the simpleagent does

The agent lives in a simulated, discrete environment, surrounded by basic objects that do not make sense for him at first. Exploring the world, he learns to find his way through this world and to satisfy its needs. In the beginning, his behaviour is just trial and error: Moving around, looking at things, trying his abilities (like eating and drinking) on objects and experience the effects on the state of his motivational system. After some while, the agent will know where to do what to reach what ends. Actions and Situations are protocolled, and from these protocols and the knowledge about actions that lead to desired ends, the agent builds "plans" to find new solutions to his problems (currently: survival in an unknown environment).

How to start

To watch the agent explore the world and perhaps learn to fulfill his needs, create a new Micropsi Agent Project named "simpleagent" (important!) and import the zip file. If you didn't do already, select "micropsi" as the current agent. Open the scripting view and double-click the StartScript.
The initial state loads, some modifications are made by the script after which you should see a dialog telling you that the agent is ready to start. Run the net and see the simpleagent move!

How the simpleagent works

The simpleagent is controlled by a nodenet with about 20 native modules. A lot of the logic is in these native modules. Some of them just link or unlink register nodes (which is the simpleagent way of passing "arguments" between nodenet substructures). Other native modules implement very basic functionality. Of special importance is the ScriptExecution module, which executes node net scripts. The whole simpleagent relies on this: basic macros, automatisms and plans, sitation descriptions are scripts and even the main control loop is a script, executed by an instance of ScriptExecution.

The main loop (you can find it in the MainControl nodespace) does two things over and over: act and perceive. (In MicroPsi agents, perception and action are not clearly distinguishable, as perception is done by execution "recognition scripts". But the simpleagent is simple and its perception scripts are started and finished at regular intervals and while the environment is most stable.)

Perception, done in the IEPS (Immediate External Percept Space), establishes or recognizes situations which are made out of features. Situations and features are represented as concept nodes. A very simplistic implementation of Hypercept does the job: It selects a hypothesis from a list, has it checked by an instance of ScriptExecution and marks it as "current situation". A situation forecaster creates hypotheses by looking at the protocol; a SituationImporter creates a new recognition script (schema) if all hypotheses failed. A recognition script typically looks like this:

Situation recognition script

This script is used to recognize a situation called "2BT", which is just some point in the simulated world that happens to have two features. For each feature, there is a SUB-linked macro script that decribes how to check if it "is the case", if the current reality matches the schema. Checking a feature is done by: resetting the fovea, moving the fovea to the point where the feature is expected to be, wait for the feature-sensor to become active (confirming the existence of the feature).

Action: In the MainControl nodespace you can see four alternatives for acting: find and execute an automatism, create and execute a plan, try something by random or do nothing. These alternatives will be tried sequentially. Automatisms are simple protocol fragments or old plans that will be re-executed. Plans are scripts made out of a number of protocol fragments, glued together so they lead to ends. The trial-and-error action does a memory search, chosing an option that hasn't been tried yet in the current situation.

After every action and every perception an element (a concept node) is added to the protocol (located in the ProtocolSpace). Protocol elements represent either a situation or an action taken by the agent. Situation protocol elements have SUB-Links to nodes in the "SituationMemory". The SituationMemory space contains nodes that represent situations and become active if and only if the situation they stand for is the current situation. Action protocol elements have SUB-Links to plans or basic macros. Plans can be found in the PlanSpace, basic macros (movement, eating and drinking) are in the BasicMacros space. The links between protocol elements decay over time and will eventually have a weight of zero -- the elements won't be reachable any more and will be deleted by a garbage collection module. Only protocol fragments that proved useful will survive, as every successful use of any part of the protocol chain will reinforce links.

The ExecutionSpace is the place where action scripts (protocol fragments, plans, basic macros) are copied to be executed.

In the MotivationSpace, motives and emotions are calculated. There are links from all over the agent into the MotivationSpace, signalling the success or failure of action, perception or planning. From this data, emotional parameters are calculated. The simpleagent is very close to Dörners Psi agents from the "Mechanik des Seelenwagens" when it comes to emotions.

The predefined motives, "eat", "drink", "heal", "efficiency" and some less important ones are also calculated in the MotivationSpace. (There are sensors that read the body simulation data for hunger, thirst and pain.) When the agent has performed an action that makes some motive's value decrease, a link will be created between this action's protocol element and the motive node. This data is used by the memory search algorithms that spread activation from the motive nodes when searching for actions that lead to a change in the motive's value.

A third important thing that happens in the MotivationSpace is the selection of goals. All actions that lead to a change in the current motive's value in the right direction are possible goals.

The plan space is the space where new plans are constructed and old, successful plans ("automatisms") are stored. Plans are constructed by looking for all situations that are reachable from the current situation. Then, the algorithm looks for situations that led to the current goal in the past. Whenever it encounters that is not already used in the plan, it will be added to the candidate list. From the list of candidates, the one node that is also in the list of reachable situations and has the shortest distance to the current situation will be selected as next plan element.

The plan "grows" from the current goal towards the current situation. If no complete plan can be constructed, planning fails and the incomplete plan will be deleted.

no comments | post comment

Quicklinks
fields of activity
downloads
installation
getting started
extension (new!)
faq
>>Bugzilla
snipsnap-help

Logged in Users: (0)
… and 7 Guests.



< December 2008 >
SunMonTueWedThuFriSat
123456
78910111213
14151617181920
21222324252627
28293031

>>SnipSnap 1.0b1-uttoxeter

www.cognitive-agents.org