Mark Humphrys - CA300 - practical


The Tyrrell practical: The WWM in general:

CA300 practical

This module is 70 exam, 30 project.




Guide to this page

There is a lot of information here. Partly this is because I offer you many different ways of solving the problem. If you are overwhelmed by information, you may ask: "What is the bog-standard solution to the problem? Can I avoid any of this material?" So I have marked some sections:

Sections marked in yellow are "advanced" or optional.



The World-Wide-Mind

The practical is based on the "World-Wide-Mind" project. The basic idea of this is that you write a "Mind server" to run in a remote body which is defined at a "World server". The Mind server and World server are remote programs (e.g. CGI scripts) on the Internet which accept via HTTP a defined series of simple commands in plaintext XML and output plaintext XML:

The basic algorithm is to repeatedly:

  1. Send a "Get State" message to World server to get the state of the world, a text description of what the "body" can see.
  2. Send "Get Action" message to Mind server, with the current state of the world as argument, to get the Mind server's suggestion for what action to take in this state.
  3. Send "Take Action" message to World server, with that action as argument.
  4. Repeat the loop.
In pseudo-code:

repeat
{
 State = World.GetState();
 Action = Mind.GetAction(State);
 World.TakeAction(Action);
}	


Tyrrell's world

In this practical, the World server will be an animal-behaviour problem called "Tyrrell's world".

What the creature sees is not the entire world. When we send the World server a "Get State" command to return a text description of what the "creature" can see, it responds with something like this.

The World server:

Some pre-written Mind servers for this World:


Scoreboard


Some old scoreboards are online: And some old Minds are online (i.e. still running as services that can be re-used remotely):

How to solve the problem

The "creature" in Tyrrell's world has multiple conflicting goals. It needs to stay alive, find food and water, avoid predators and dangerous places, hide and sleep at night, keep clean, mate, etc. Your job is to give it a "Mind".

This Mind will repeatedly ask the World to describe itself by sending it a "Get State" message, then tell the creature what to do by sending the World server a "Take Action" message. For example, you could:

  1. Simply run one of the existing Mind servers in the World, and see how well you score.

  2. Construct a totally new Mind server online yourself, and run that. i.e. A program that responds to the HTTP WWM command "Get Action". This program can then be run by other people.

  3. Construct a new Mind "server" offline, and run that. i.e. Simply a program offline that repeatedly queries the World for state and then sends it an action. This program cannot be run by other people.

  4. Construct a new Mind server yourself, online or offline, which calls an existing online Mind server. The WWM architecture encourages this, to encourage re-use of other people's Minds. This is the whole point of the WWM (also here). This is called a MindM server. It may add some actions of its own, or not.

  5. The MindM server may call multiple online Mind servers, and choose between their multiple suggested actions in order to get the action to take. This is called a MindAS server.

  6. Sub-goal only: You may decide to specialise on only one sub-goal, or a small set of sub-goals. e.g. Create the best food-finder. Your friend creates the best predator-avoider. Use the advanced scoreboard to sort based on your sub-goal. A third friend then combines these ultra-specialists into a MindAS system.


3rd year AI practical

The practical is to:
  1. Write a program to drive the agent in the "Tyrrell's world" problem by any means possible, in any programming language, using any method (hand-coded, search, learning, evolution, etc.). From the AI point of view, this illustrates a problem with an unpredictable world, a massive state-space, and no known optimal solution.
  2. Get your score onto the scoreboard.
  3. Write up how you did it, including the full commented source code of all programs involved.
    (Hint: Colour printout in landscape mode is normally the best way to print out code.)
  4. Give me a tidy, bound write-up on paper by the deadline. Use the Project Submission Form as the front page.
  5. Either (a) give this to me at a lecture, or (b) drop it into the project box in L114 that has my name and "CA300" on it.

Rules:

  1. You are not to email me with problems. Instead come to me after lectures (Mon) or at appointed times (Thur). Only email me if there is an emergency (e.g. the site is down).

  2. Or use the CA300 discussion board. I will look at this from time to time:

  3. You may have any number of attempts, with any number of scores on the scoreboard. Please highlight your best score in the write-up.
  4. Please always use your proper name (no nicknames), or scores will NOT be properly credited to you.
  5. If any 2 students have the same name, please use extra identifying info (though the link to your email/homepage should identify you uniquely).



How to write a Mind

The easiest way for you to write a Mind may be to write it in Java using the Tyrrell MDK:

  1. Write it in Java offline using the Tyrrell Mind Development Kit.
  2. Use these submission instructions except:
    1. Instead of emailing it to Ciarán O'Leary, send it to me using this form. This is a feedback form I use for my family tree website. Don't worry about what it says. I'll just use it temporarily for the CA300 project until we design the new web-based system.
    2. Because the form (unlike email) does not identify you, please use your proper name (no nicknames) to identify the file. Please use a naming scheme like: JaneMurphy1.jar, JaneMurphy2.jar, etc.
    3. You can add any special comments I need to read in the "Updates" text box.

  3. Do not email your file to me.
  4. I will put it online when I next log in. Note that at present I cannot update the site from home. So it must wait until I next log in in DCU.
  5. You can make any number of submissions.

  6. How to write a MindM server with the Java toolkit
    Note that you can make your sub-Mind more re-usable in larger Minds by returning accurate "goal" and "steps" information.


Other methods:

I expect most of you will do the above, but it is not compulsory.
You may write your own offline or online Mind server in any programming language you like, using any method you like that gets you onto the scoreboard.



How to see what is happening in the World

Java using Tyrrell MDK:


Other methods:



Send commands through HTML form

An initial way to see how the system works might be to send commands by hand through a HTML form.
These return XML - you may need IE to display the result:

"View Source" on these web pages to see (a) how to send your own name as the user, and (b) how to write a page to send commands to the "Edmund" Mind server.


HTTP scripting

You could repeatedly script these commands in a loop, using any programming language you like, to "run" the existing Mind server in the World: Now try giving your own answer to "Get Action" in the scripting. You can now write a new offline Mind server in any language.

How to write a CGI script

Now put your program online to construct a new online Mind server that others can use. Your own online Mind server could be, for example, a CGI script in any language that takes in WWM commands as plaintext standard input and gives WWM responses as plaintext standard output: Last I looked, CA and DCU would not host undergraduate CGI scripts. But there are many alternatives, for example:
  1. RedBrick allows CGI scripts
  2. Tripod provides free Web space, and allows you install your own CGI scripts - though they have to be in Perl, and there are some restrictions. See Tripod CGI help (and here).


Client

You can use a client to repeatedly run an existing online Mind server in a World server:

Some notes with the Java client:

  1. Java version

  2. Cut and paste

  3. Apparently not relevant if server is within DCU, but relevant if server is outside DCU:

Run your own Mind server remotely

All the Mind servers you have submitted (and all the Mind servers other people have submitted) are all actually online (see their URLs on the scoreboard).

They can all be run remotely, e.g. by sending SOML commands manually:


or by some other method (e.g. using the client).

Very important: Here's how it works. You run your Mind say 100 times offline (i.e. not talking to the World server) and it scores well. You submit it. I will only run it 5 times to give it places on the scoreboard. Since it is a probabilistic world, these may all be "unlucky" runs. To give it more runs to look for a higher score, you should run it yourself remotely using the client (or other method).



Marking

You will get marks for lots of things. This will be a bit of a free-for-all, including marks for scoring, marks for coding, marks for putting things online in different ways, marks for the write-up, marks for re-use, marks for being re-used, and even marks for interesting "cheating" (explained below).

All I ask is that your write-up is honest and explains what you did. I will decide the exact score at the end:


  1. You will get marks for performing well on the standard scoreboard (surviving plus mating).
  2. You will get marks for performing well on some specialised sub-goal on the advanced scoreboard.
  3. You will get marks for the write-up.

  4. Just to say explicitly about the write-up: You will get marks for good analysis of how the world and your mind, or other minds, work. Even if you find a bug in the world, write it up and you can get marks. If you find "bugs" (or at least strange features) in the world, isolate them, replicate them and write it up properly and you will get marks for such analysis.

  5. No Mind server
    1. Even if you didn't write the Mind server, you may still get some marks for using an existing Mind server in a clever way, e.g. with creative arguments.

  6. Mind server
    1. You will get a lot of marks for writing your own Mind server, offline or online. But you must document how it works and why it scored the points it did. If any dishonesty is detected in your write-up you will fail the project and have to repeat next year.
    2. You will get a lot of marks for using search, learning, evolution, or any other interesting algorithm, in your server.
    3. You will get marks for using any method other than the standard Java MDK submission (e.g. other programming languages, offline programs, your own online server, etc.), depending on how much extra work it involved.

  7. MindM server
    1. You will get marks for a Mind server that re-uses an existing Mind server. i.e. A MindM server. The WWM is all about this kind of re-use. It's meant to be this way. But you must document how you did this. If any dishonesty is detected in your write-up you will fail the project and have to repeat next year.
    2. You may re-use your classmates' Mind servers, your own Mind servers, and our pre-written Mind servers (and any other Mind servers you can find). For their URLs see the scoreboard.
    3. You may even re-use previous years' Mind servers, if they are still online. If they are still online, you can see their URLs on the scoreboard.
    4. You will get marks if your Mind server is re-used, even if it was nothing to do with you.

  8. MindAS server
    1. You will get a lot of marks for re-using multiple other Mind servers, and having some kind of "server selection" algorithm. i.e. A MindAS server.

  9. Creative cheat
    1. You may see that you could use someone else's Mind server(s) to score high on the scoreboard, while fooling the scoreboard into thinking it was your Mind server that had the intelligence. You will actually get marks for doing this, provided you write it up properly. If any dishonesty is detected in your write-up you will fail the project and have to repeat next year.

  10. Creative fighting of cheat
    1. You will get marks for any methods to detect and block (or mislead!) such "hijacking" of your Mind server. Again, write it up properly.


Your program will be archived

By default your program will be used in our WWM research project, which aims to find ways of building up complex Minds composed of the works of multiple authors. There is no commercial aspect. This is all free and open software.

By default:

  1. Your program will go into an ongoing WWM library of Mind servers for the Tyrrell world.
  2. Your program may be online forever at our site.
  3. Your program may be re-used in larger, multi-Mind systems.
  4. These will be written up in scientific papers, like our paper at the 7th International Conference on the Simulation of Adaptive Behavior in Edinburgh in 2002.
  5. If your Mind is ever re-used like this, you will be fully credited, including a credit in any published papers.
  6. Previously, we discussed some students' Minds in our paper at the 8th International Conference on the Simulation of Adaptive Behavior in Los Angeles in 2004.
I expect that most of you will like the idea of your clever solution ending up a component in a larger, ongoing system, with your name credited in various papers.

On the other hand, if you do not want this to happen, that's fine. There is no problem, and no penalty. I do not even need to know what your reasons are. Just tell me not to archive your Mind on the form when you submit it.




Return to CA300 page.