Class RunJadeMAS

All Implemented Interfaces:
RunLocalMASMBean, NotificationBroadcaster, NotificationEmitter

public class RunJadeMAS extends RunLocalMAS
Runs MASProject using JADE infrastructure. This class reads the mas2j project and create the corresponding agents.
  • Field Details

    • controllerName

      public static String controllerName
    • environmentName

      public static String environmentName
  • Constructor Details

    • RunJadeMAS

      public RunJadeMAS()
  • Method Details

    • main

      public static void main(String[] args) throws JasonException
      Throws:
      JasonException
    • init

      public int init(String[] args)
      Overrides:
      init in class RunLocalMAS
    • create

      public void create() throws JasonException
      Description copied from class: RunLocalMAS
      create environment, agents, controller
      Overrides:
      create in class RunLocalMAS
      Throws:
      JasonException
    • createButtons

      public void createButtons()
      Overrides:
      createButtons in class RunLocalMAS
    • startContainer

      public boolean startContainer()
    • createEnvironment

      public void createEnvironment() throws JasonException
      Overrides:
      createEnvironment in class RunLocalMAS
      Throws:
      JasonException
    • createController

      public void createController() throws JasonException
      Overrides:
      createController in class RunLocalMAS
      Throws:
      JasonException
    • createAgs

      public void createAgs() throws JasonException
      Overrides:
      createAgs in class RunLocalMAS
      Throws:
      JasonException
    • startAgs

      public void startAgs()
      Overrides:
      startAgs in class RunLocalMAS
    • finish

      public void finish()
      Overrides:
      finish in class BaseLocalMAS
    • prepareArgs

      protected String[] prepareArgs(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(String arg)
      Test if an argument actually references a file.
      Parameters:
      arg - The argument to test.
      Returns:
      True if it does, false otherwise.