How to write a Mind
See
Definitions for the basic terms:
- World
- Mind
- World type (World uses Minds or not)
A Mind is a program that takes "actions" in a World.
To write a new Mind for a World, you need
to understand the state and action formats
of the World.
(Each World can have different state and action formats.)
These formats will be explained by the World author in comments
or in sample Minds.
- The easiest way to proceed is to find a Mind that already works with the World,
and clone it.
The Mind's code will show you
how to parse the World state and
generate correct World actions.
- You can also make a blank new Mind.
Go to the World page and click "New Mind".
Worlds, Minds and Scoreboards
A World that uses Minds will have a "scoreboard" showing how well the Minds have done when running in that World.
- If you write a World that uses Minds,
other people can now write Minds for your World, and get on its scoreboard.
- As the World author, you should help Mind authors by explaining
the state, action and score formats
of your World.
You should probably explain these formats in code comments
and sample Minds.
- To start a new scoreboard
(e.g. for a particular class or event),
just clone the World.
Minds may have memory
Minds may have memory. They may update a data structure on every step.
In JavaScript:
var i; // or any other data structure
AB.mind.newRun = function()
{
i = 1; // or any other initialisation of the data structure
};
AB.mind.getAction = function ( x )
{
i = i + 1; // or any other update to the data structure
return ( action );
};