edu.udo.cs.ie.cowbots.launcher
Class CowbotsConfig

Package class diagram package CowbotsConfig
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.launcher.CowbotsConfig

public class CowbotsConfig
extends java.lang.Object

utility class that parses a local configuration file for setting up a mas2j. used during initialization by various classes (environment, agent, agentarch).


Field Summary
(package private)  java.util.HashMap<java.lang.String,java.lang.String> agOptions
           
(package private)  java.util.List<java.lang.String[]> allhosts
           
(package private)  java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> allOptions
           
(package private)  java.lang.String clingoPath
           
(package private)  org.w3c.dom.Element config
           
(package private)  java.util.HashMap<java.lang.String,java.lang.String> delibOptions
           
(package private)  java.util.HashMap<java.lang.String,java.lang.String> desgenOptions
           
(package private)  java.lang.String dlvPath
           
(package private)  java.lang.String host
           
(package private) static CowbotsConfig instance
           
(package private)  java.lang.String massimPath
           
 
Constructor Summary
protected CowbotsConfig()
          initializes the local configuration from the local_config.xml file
 
Method Summary
 java.lang.String getClingoPath()
          this method returns the path to a clingo asp solver binary or null
 java.lang.String getDLVPath()
          this methods returns the path to a dlv asp solver binary or null
 java.lang.String getHost()
          this method returns the host for the massim server the agents should connect to.
 java.util.List<java.lang.String[]> getHosts()
          this methods returns all available hosts of massim servers defined in the local_config.xml file. used by the cowbots launcher during mas startup.
static CowbotsConfig getInstance()
          this method returns the global instance of the cowbots configuration
 java.lang.String getMassimPath()
          this method returns the path to a local massim svg output directory
 java.lang.String getOption(java.lang.String component, java.lang.String attribute)
          returns the value of an attribute for one of the freely configurable options in the localconfig class.
protected  java.lang.String prepString(java.lang.String s)
          auxiliary method that removes double quotation marks from a string
 void setHost(java.lang.String host)
          this method sets the massim host for all agents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

org.w3c.dom.Element config

dlvPath

java.lang.String dlvPath

clingoPath

java.lang.String clingoPath

massimPath

java.lang.String massimPath

host

java.lang.String host

allhosts

java.util.List<java.lang.String[]> allhosts

delibOptions

java.util.HashMap<java.lang.String,java.lang.String> delibOptions

agOptions

java.util.HashMap<java.lang.String,java.lang.String> agOptions

allOptions

java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> allOptions

desgenOptions

java.util.HashMap<java.lang.String,java.lang.String> desgenOptions

instance

static CowbotsConfig instance
Constructor Detail

CowbotsConfig

protected CowbotsConfig()
initializes the local configuration from the local_config.xml file

Method Detail

getInstance

public static CowbotsConfig getInstance()
this method returns the global instance of the cowbots configuration

Returns:
CowbotsConfig instance

getDLVPath

public java.lang.String getDLVPath()
this methods returns the path to a dlv asp solver binary or null

Returns:
path to dlv

getClingoPath

public java.lang.String getClingoPath()
this method returns the path to a clingo asp solver binary or null

Returns:
path to dlv

getMassimPath

public java.lang.String getMassimPath()
this method returns the path to a local massim svg output directory

Returns:
local massim svg output directory

setHost

public void setHost(java.lang.String host)
this method sets the massim host for all agents.

Parameters:
host - hostname for massim environment

getHost

public java.lang.String getHost()
this method returns the host for the massim server the agents should connect to.

Returns:
host of massim server

getHosts

public java.util.List<java.lang.String[]> getHosts()
this methods returns all available hosts of massim servers defined in the local_config.xml file. used by the cowbots launcher during mas startup.

Returns:
list of available massim servers

prepString

protected java.lang.String prepString(java.lang.String s)
auxiliary method that removes double quotation marks from a string

Parameters:
s - input string to process
Returns:
processed string or null (if string remains empty)

getOption

public java.lang.String getOption(java.lang.String component,
                                  java.lang.String attribute)
returns the value of an attribute for one of the freely configurable options in the localconfig class.

Parameters:
component - target component to load options for
attribute - attribute value to query
Returns: