jason.infra.jade
Class RunJadeMAS

Package class diagram package RunJadeMAS
java.lang.Object
  extended by jason.infra.centralised.RunCentralisedMAS
      extended by jason.infra.jade.RunJadeMAS

public class RunJadeMAS
extends RunCentralisedMAS

Runs MASProject using JADE infrastructure. This class reads the mas2j project and create the corresponding agents.


Field Summary
static java.lang.String controllerName
           
static java.lang.String environmentName
           
 
Fields inherited from class jason.infra.centralised.RunCentralisedMAS
btDebug, defaultProjectFileName, logPropFile, runner, stopMASFileName
 
Constructor Summary
RunJadeMAS()
           
 
Method Summary
 void create()
          create environment, agents, controller
 void createAgs()
           
protected  void createButtons()
           
 void createController()
           
 void createEnvironment()
           
 void finish()
           
 int init(java.lang.String[] args)
           
protected  boolean isFileName(java.lang.String arg)
          Test if an argument actually references a file.
static void main(java.lang.String[] args)
           
protected  java.lang.String[] prepareArgs(java.lang.String[] args)
          Transform original style boot arguments to new form.
protected  void startAgs()
           
protected  boolean startContainer()
           
 
Methods inherited from class jason.infra.centralised.RunCentralisedMAS
addAg, createPauseButton, createStopButton, delAg, getAg, getAgs, getControllerInfraTier, getEnvironmentInfraTier, getProject, getRunner, isDebug, setupDefaultConsoleLogger, setupLogger, start, startSyncMode, stopAgs, waitEnd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

controllerName

public static java.lang.String controllerName

environmentName

public static java.lang.String environmentName
Constructor Detail

RunJadeMAS

public RunJadeMAS()
Method Detail

main

public static void main(java.lang.String[] args)
                 throws JasonException
Throws:
JasonException

init

public int init(java.lang.String[] args)
Overrides:
init in class RunCentralisedMAS

create

public void create()
            throws JasonException
Description copied from class: RunCentralisedMAS
create environment, agents, controller

Overrides:
create in class RunCentralisedMAS
Throws:
JasonException

createButtons

protected void createButtons()
Overrides:
createButtons in class RunCentralisedMAS

startContainer

protected boolean startContainer()

createEnvironment

public void createEnvironment()
                       throws JasonException
Overrides:
createEnvironment in class RunCentralisedMAS
Throws:
JasonException

createController

public void createController()
                      throws JasonException
Overrides:
createController in class RunCentralisedMAS
Throws:
JasonException

createAgs

public void createAgs()
               throws JasonException
Overrides:
createAgs in class RunCentralisedMAS
Throws:
JasonException

startAgs

protected void startAgs()
Overrides:
startAgs in class RunCentralisedMAS

finish

public void finish()
Overrides:
finish in class RunCentralisedMAS

prepareArgs

protected java.lang.String[] prepareArgs(java.lang.String[] args)
Transform original style boot arguments to new form.
 In the following 'x' and 'y' denote arbitrary strings; 'n' an integer.
 Transformation Rules:
 Original       New
 ------------------------------
 -host x        host:x
 -owner x       owner:x
 -name x        name:x
 -port n        port:n
 -mtp  x        mtp:x
 -aclcodec:x    aclcodec:x
 -conf x        import:x
 -conf          -conf
 -container     -container
 -gui           -gui
 -version       -version
 -v             -version
 -help          -help
 -h             -help
 -nomtp         -nomtp
 -nomobility    -nomobility
 -y x           y:x
 agent list     agents:agent list
 
If the arguments contain either import:x or agents:x we will assume that the arguments are already in the new format and leave them alone. For "import:" we test if what follows is a file name and in the event it isn't we assume that it was if there are any other "-x" options following.

You can't mix the old form with the new as this would make the distinction between foo:bar as meaning a property named foo with a value bar or an agent named foo implmented by class bar impossible.

Parameters:
args - The command line arguments.

isFileName

protected boolean isFileName(java.lang.String arg)
Test if an argument actually references a file.

Parameters:
arg - The argument to test.
Returns:
True if it does, false otherwise.