unsw.cse.mica.tools
Class MobMaker
java.lang.Object
unsw.cse.mica.agent.DefaultAgent2
unsw.cse.mica.agent.GUIAgent
unsw.cse.mica.tools.MobMaker
- All Implemented Interfaces:
- Agent, MessageHandler
public class MobMaker
- extends GUIAgent
A simple agent for writing mobs to the blackboard.
- Author:
- mmcgill
Method Summary |
void |
createComponents(MicaProperties args)
Function that is called in the init method that should be overridden by
subclasses. |
void |
handleNewMob(Mob m)
This method is called when a new MICA object has arrived. |
void |
init(MicaProperties args)
Connect using the value given for param "name" in the args if the value exists,
otherwise use the class name |
static void |
main(java.lang.String[] arg)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MobMaker
public MobMaker()
init
public void init(MicaProperties args)
throws MicaException
- Description copied from class:
DefaultAgent2
- Connect using the value given for param "name" in the args if the value exists,
otherwise use the class name
- Specified by:
init
in interface Agent
- Overrides:
init
in class GUIAgent
- Parameters:
args
- Additional arguments provided to the agent. If the agent is started from with
the 'Runner' tool, the args array contains the values provided from within the runner's
XML configuration file. Otherwise, the exact contents will depend on the calling method.
- Throws:
MicaException
createComponents
public void createComponents(MicaProperties args)
- Description copied from class:
GUIAgent
- Function that is called in the init method that should be overridden by
subclasses. Subclasses should use this method to construct the elements
for their GUIs and place the elements in frame.
- Specified by:
createComponents
in class GUIAgent
- Parameters:
args
- the args passed to the init method
handleNewMob
public void handleNewMob(Mob m)
- Description copied from interface:
MessageHandler
- This method is called when a new MICA object has arrived.
Whenever a mob is written to the blackboard that the agent has registered
an interest in the handleNewMob
is called. It is passed the new Mob (MICA object)
as a parameter so it can decide any further actions.
Note: The handleNewMob is called asynchronously. You should not
make any assumptions about its synchronizations.
- Specified by:
handleNewMob
in interface MessageHandler
- Overrides:
handleNewMob
in class DefaultAgent2
- Parameters:
m
- the mob that has been written to the blackboard
main
public static void main(java.lang.String[] arg)
throws MicaException
- Throws:
MicaException