There are two pieces to running the Metaglue system. The first is to start up the catalog, which monitors and handles the other agents that are running. Afterwards, other agents can be started to make the system work.
Before running any Metaglue agents, you have to start up the catalog. This can be done by running the command
java metaglue.MetaglueAgent -catalog
If you're trying to use multiple machines in the agent system, be sure to note the machine name where the catalog is running. When starting up agents, You will need to specifiy the location of this catalog.
If there are any problems starting up the catalog, most notably error
messages that say that the metaglue.MetaglueAgent
class cannot be
found, be sure that the CLASSPATH environment variable
(see section Installation) is set properly.
The Metaglue system maintains information about the state of the agent
environment in a database. To remove any old or stale information, you
should start up the catalog with the -purge
option:
java metaglue.MetaglueAgent -catalog -purge
Once the catalog has been started, you can start up an agent by
specifying a society, catalog, and agent name when the
MetaglueAgent
starts up:
java metaglue.MetaglueAgent <society> <catalogHost> <agentName>
Here, the <society> is a society name. The actual name here doesn't matter much; agents use them to communicate with each other, and they serve as a kind of namespace so that your agents can keep their information separate from a similar agent operating on behalf of someone else. A good society name to use might be your name, or your initials, or something else unique to you.
The <catalogHost> is simply the name of a machine running the
catalog (see section Starting the Catalog). If all your agents run on the
same machine, you can use localhost
and the agent will look
locally for the catalog, but for distributed environments you will need
to correctly specify the name (or IP address) of the machine running the
catalog.
Finally the <agentName> is simply a class name specifying an agent.
A good test example is agentland.debug.PowerTester
(see section Debugging Agents), which will show a simple window with a text
field in it when it starts up.
If you just want to start a VM on a machine without starting up an agent (for example, if you need to prepare a machine to receive agents via the tiedTo call), you can do so by starting up the Metaglue agent with only the society and catalog host as arguments:
java metaglue.MetaglueAgent <society> <catalogHost>
Go to the first, previous, next, last section, table of contents.