org.dyncle
Class SASystem

java.lang.Object
  extended by jade.core.Agent
      extended by org.dyncle.SASystem
All Implemented Interfaces:
jade.core.TimerListener, java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
CleaningRobot

public abstract class SASystem
extends jade.core.Agent

An Agent class for implementing self-adaptive systems.

Version:
3.2
Author:
Hiroyuki NAKAGAWA
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class jade.core.Agent
jade.core.Agent.Interrupted
 
Field Summary
 java.util.Map<java.lang.String,CLLoader> classLoaderRepository
          HashMap for storing classloader
 java.lang.ref.WeakReference<java.lang.Object> clWR
          A reference for checking whether the target has been unloaded
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN, MSG_QUEUE_CLASS
 
Constructor Summary
SASystem()
          Default constructor.
 
Method Summary
 void addCLInfo(java.lang.String name, java.lang.String fqn, ComponentBehaviour cb, int pri, java.util.List<java.lang.String> confList)
          Adds the data of specified CL into the CLTable, which is a CL management table.
 boolean canActivate(java.lang.String name)
          Checks whether the specified CL can transit to the activate state or not.
 java.util.List<ComponentBehaviour> findAnotherService(ComponentBehaviour compB)
          Returns components that provide same service of specified component, except specified component itself.
 ComponentBehaviour findComponent(java.lang.String targetCompName)
          Returns a component searched by name.
 java.util.List<ComponentBehaviour> findService(java.lang.String serviceType)
           
 ComponentBehaviour getCL(java.lang.String clName)
          Returns the AD type component of specified CL.
 CLTable getCLTable()
           
 java.util.List<ComponentBehaviour> getLowerPriorityCLs(java.lang.String name)
          Finds the control loops whose priority is lower than that of specified control loop.
 void printReceivedCommand(jade.lang.acl.ACLMessage receive)
          Prints received command.
 void registerComponent(java.lang.String serviceType, ComponentBehaviour compB)
          Registers the specified component.
 void standBy(ComponentBehaviour comp)
          Stands by the component.
 
Methods inherited from class jade.core.Agent
addBehaviour, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, doActivate, doClone, doDelete, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getBootProperties, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AInterface, getO2AObject, getProperty, getQueueSize, getState, here, isRestarting, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, removeTimer, restartLater, restore, restoreBufferedState, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setO2AManager, setQueueSize, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classLoaderRepository

public java.util.Map<java.lang.String,CLLoader> classLoaderRepository
HashMap for storing classloader


clWR

public java.lang.ref.WeakReference<java.lang.Object> clWR
A reference for checking whether the target has been unloaded

Constructor Detail

SASystem

public SASystem()
Default constructor. It does not set the owner agent for this behaviour.

Method Detail

standBy

public void standBy(ComponentBehaviour comp)
Stands by the component. (= addBehaviour() in JADE)

Parameters:
comp -

registerComponent

public void registerComponent(java.lang.String serviceType,
                              ComponentBehaviour compB)
Registers the specified component.

Parameters:
serviceType - : Service type (Service name)
compB - : Component to be registered

findService

public java.util.List<ComponentBehaviour> findService(java.lang.String serviceType)

findComponent

public ComponentBehaviour findComponent(java.lang.String targetCompName)
Returns a component searched by name. This search ignores case (not case sensitive).

Parameters:
targetCompName - : Comonent name.
Returns:
A component whose name is targetCompName

findAnotherService

public java.util.List<ComponentBehaviour> findAnotherService(ComponentBehaviour compB)
Returns components that provide same service of specified component, except specified component itself. (Returns components that has same serviceType)

Parameters:
compB -
Returns:

printReceivedCommand

public void printReceivedCommand(jade.lang.acl.ACLMessage receive)
Prints received command.

Parameters:
receive -

getCLTable

public CLTable getCLTable()

addCLInfo

public void addCLInfo(java.lang.String name,
                      java.lang.String fqn,
                      ComponentBehaviour cb,
                      int pri,
                      java.util.List<java.lang.String> confList)
Adds the data of specified CL into the CLTable, which is a CL management table.

Parameters:
name -
fqn -
cb -
pri -
confList -

getCL

public ComponentBehaviour getCL(java.lang.String clName)
Returns the AD type component of specified CL.

Parameters:
clName - : name of the specified Control loop.
Returns:
AD type component of the control loop.

canActivate

public boolean canActivate(java.lang.String name)
Checks whether the specified CL can transit to the activate state or not. If the other control loop with higher priority is running, the control loop can't transit to the activate state.

Parameters:
name -
Returns:
true if the specified CL can transit to the activate state.

getLowerPriorityCLs

public java.util.List<ComponentBehaviour> getLowerPriorityCLs(java.lang.String name)
Finds the control loops whose priority is lower than that of specified control loop.

Parameters:
name - : control loop name.
Returns:
AD type components whose control loops have lower priority than the specified control loops.