This chapter contains an overview about the usage of agent and capability
properties, that allow to change the behavior of the agent. In general,
properties represent static expressions, i.e. they are interpreted but
only once when an agent instance is loaded.
Properties can be defined in two different ways. First, you can use the
properties section of the agent (and capability) XML
file and add an arbitrary number of properties. Secondly, the agent tag has
an optional attribute "propertyfile" which refers to an XML file containing
important definitions. The default value of this attribute is the
jadex/config/runtime.properties.xml
file which specifies basic Jadex agent properties
and normally can be used for all agents, but if you would like to provide the
same set of properties to several agents, you can define your own XML property
file and set the properties attribute of your agents accordingly.
Properties specified in the properties section override values loaded from the included property file. In addition, some properties can be defined individually for each capability, which otherwise inherits the properties of the outer capability or agent. Table 12.1, “Available properties” gives an overview of all available properties. The scope denotes, if the property can only be specified for the agent as a whole, or can be adjusted to different values for individual capabilities.
Table 12.1. Available properties
Scope | Property | Default | Possible Values |
---|---|---|---|
agent | max_planstep_time | unlimited | Positive long or 0 for unlimited |
agent | storedmessages.size | unlimited | Positive int or 0 for unlimited |
agent | debugging | false | {true , false } |
capability | logging.level | SEVERE | java.util.logging.Level instances |
capability | logging.useParentHandlers | true | {true , false } |
capability | logging.addConsoleHandler | java.util.logging.Level instances | |
capability | logging.level.exceptions | SEVERE | java.util.logging.Level instances |
The Jadex sytem has to take care that only one plan step is executed at a time, therefore it waits until a plan step returns. With the help of the "max_planstep_time" property it is possible to set the maximum execution time for a single planstep in milliseconds. Per default the execution time is not limited and a plan might execute as long plan steps as it want to (note that long plan steps are not recommended, because they hinder the agent in responding to urgent events). A plan running longer than the maximum plan step time will be forcefully aborted by the system. This feature is only available for standard, but not for mobile plans.
The "storedmessages.size" property can be used to restrict the number of monitored conversations. Generally, an agent has to keep track of its sent messages for being able to associate an incoming message to already sent messages. This means an agent has to know what it sent to determine if it received some reply of a previous message. When restricting the number of conversations, and a message arrives belonging to an ongoing conversation that was removed from the cache, the agent might not be able to route the message to the correct capability.
The "debugging" property influences the execution mode of the agent.
When setting debugging to true
the agent is halted
after startup and set to single-step mode. You can then use the debugger
tab of the introspector tool execute the agent step-by-step and observe
its behavior.
The logging properties can be used to adjust the logging behavior according to the Java Logging API. The level influences the amount of logging information produced by the agent (logging information below the level will be completely ignored). Setting "useParentHandlers" to "true" will forward logging information to the parent handler, which by Java default causes logging output up to the INFO level to be displayed on the console. If you want to direct more detailed logging output to the console use the "addConsoleHandler" property, which creates a custom logging handler for console ouput with the specified logging level. More about logging settings can be found in [Jadex Tool Guide].
The "logging.level.exceptions" property can be used to specify the logging
level for uncatched exceptions occurring in plan bodies. Using the default
settings for logging (non-BDI specific) exceptions are printed out as SEVERE
log messages to the console. You can adjust the level settings to suppress
exception log messages from plans that you expect to throw exceptions.
The following concrete subclasses of the abstract
jadex.runtime.BDIFailureException
may occur:
jadex.runtime.AgentDeathException
jadex.runtime.GoalFailureException
jadex.runtime.MessageFailureException
jadex.runtime.PlanFailureException
jadex.runtime.TimeoutException
Figure 12.2, “Example properties section” shows an example property section setting logging and plan step options.