ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.platform
Class AbleAgentSituation

java.lang.Object
  extended bycom.ibm.able.platform.AbleAgentSituation
All Implemented Interfaces:
java.io.Serializable

public class AbleAgentSituation
extends java.lang.Object
implements java.io.Serializable

The AbleAgentSituation class defines a situation that an AblePlatformDefaultAgent with an AgentCapability may encounter.

A capability of an agent defines a role or behavior that the agent can take on. An example of an AgentCapability might be "DASD Monitor". Each AgentCapability of an agent may encounter one or more situations, and these are defined by this class. An example of an AgentSituation for a "DASD Monitor" AgentCapability might be "DASD is thrashing". This AgentSituation object holds the severity and type of situation encountered, and also all of the possible responses that an agent might take when encountering this situation.

Each AgentCapability of an agent has an automation level, and the response an agent may take when encountering an AgentSituation is influenced by that automation level:

If the automation level of this situation's AgentCapability is set to YES, the situation's yesResponse is the response that is taken by a well behaved agent.

If the automation level of this situation's AgentCapability is set to NO, the situation's noResponse is the response that is taken by a well behaved agent.

If the autonomy level of this situation's AgentCapability is set to ASK, then an AgentSituationReport is created that is filled with all possible responses to the situation. AgentSituationReports are sent to the AgentLoggingService, where they may be responded to by another agent or a human being.

Since:
ABLE n.n.n
See Also:
Serialized Form

Field Summary
static AbleMessageContainer FAILURE_REQUEST
          Situation request type: Failure
static int HIGH_SEVERITY
          Situation severity level: High
static AbleMessageContainer HIGH_SEVERITY_STRING
           
static AbleMessageContainer INFO_SITUATION
          Situation request type: Information
static int LOW_SEVERITY
          Situation severity level: Low
static AbleMessageContainer LOW_SEVERITY_STRING
          Grab the NLS strings for the severity levels
static int MEDIUM_SEVERITY
          Situation severity level: Medium
static AbleMessageContainer MEDIUM_SEVERITY_STRING
           
static AbleMessageContainer PERMISSION_REQUEST
          Situation request type: Ask permission
 
Constructor Summary
AbleAgentSituation(AbleAgentSituation theAgentSituation)
          Creates an AgentSituation from another AgentSituation (copy constructor).
AbleAgentSituation(java.io.Serializable theSituationIdentifier, AbleMessageContainer theSituationName, int theSeverityLevel, AbleMessageContainer theSituationType, AbleMessageContainer[] theResponses)
          Creates an AgentSituation.
 
Method Summary
 java.lang.String debugString()
          Returns a translated representation of this AgentSituation.
 boolean equals(java.lang.Object theObject)
          Compares this AgentSituation with another to determine if the situations are equal.
 void formatResponse(int theResponseIndex, java.lang.Object[] theSubText)
          Formats a response with the supplied substitution text.
 void formatSituationName(java.lang.Object[] theSubText)
          Formats the situation name with the supplied substitution text.
 AbleMessageContainer getName()
          Method getName
 AbleMessageContainer getNoResponse()
          Method getNoResponse
 AbleMessageContainer getResponse(int responseIndex)
          Method getReponse
 AbleMessageContainer[] getResponses()
          Gets a reference to the list of responses.
 int getSeverityLevel()
          Method getSeverityLevel
 AbleMessageContainer getSeverityLevelString()
          Method getSeverityLevelString
 java.io.Serializable getSituationIdentifier()
          Method getSituationIdentifier
 AbleMessageContainer getSituationType()
          Method getSituationType
 AbleMessageContainer getYesResponse()
          Method getYesResponse
 int hashCode()
          Returns the hashCode of this AgentSituation.
 java.lang.String toString()
          Returns a brief description of this AgentSituation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOW_SEVERITY

public static final int LOW_SEVERITY
Situation severity level: Low

See Also:
Constant Field Values

MEDIUM_SEVERITY

public static final int MEDIUM_SEVERITY
Situation severity level: Medium

See Also:
Constant Field Values

HIGH_SEVERITY

public static final int HIGH_SEVERITY
Situation severity level: High

See Also:
Constant Field Values

LOW_SEVERITY_STRING

public static final AbleMessageContainer LOW_SEVERITY_STRING
Grab the NLS strings for the severity levels


MEDIUM_SEVERITY_STRING

public static final AbleMessageContainer MEDIUM_SEVERITY_STRING

HIGH_SEVERITY_STRING

public static final AbleMessageContainer HIGH_SEVERITY_STRING

PERMISSION_REQUEST

public static final AbleMessageContainer PERMISSION_REQUEST
Situation request type: Ask permission


FAILURE_REQUEST

public static final AbleMessageContainer FAILURE_REQUEST
Situation request type: Failure


INFO_SITUATION

public static final AbleMessageContainer INFO_SITUATION
Situation request type: Information

Constructor Detail

AbleAgentSituation

public AbleAgentSituation(java.io.Serializable theSituationIdentifier,
                          AbleMessageContainer theSituationName,
                          int theSeverityLevel,
                          AbleMessageContainer theSituationType,
                          AbleMessageContainer[] theResponses)
Creates an AgentSituation.

An AgentSituation is used to define a situation that an agent may encounter. The situaiton belongs to a certain AgentCapabiltiy of the agent.

Everything but the yesResponse and the noResponse is set by the constructor. The yesResponse defaults to the first response in theResponses list and the noResponse defaults to the last entry.

Parameters:
theSituationIdentifier - The identifier of this situation.
theSituationName - The name of this situation.
theSeverityLevel - The severity level of this situation. Must be one of:

AbleAgentSituation

public AbleAgentSituation(AbleAgentSituation theAgentSituation)
Creates an AgentSituation from another AgentSituation (copy constructor).

Parameters:
theAgentSituation - The AgentSituation from which this AgentSituation is created.
Method Detail

getSituationIdentifier

public java.io.Serializable getSituationIdentifier()
Method getSituationIdentifier

Returns:
The identifier of this Situation

getName

public AbleMessageContainer getName()
Method getName

Returns:
The name of this situation

getSeverityLevel

public int getSeverityLevel()
Method getSeverityLevel

Returns:
The severity level:
  • LOW_SEVERITY
  • MEDIUM_SEVERITY
  • HIGH_SEVERITY

    getSeverityLevelString

    public AbleMessageContainer getSeverityLevelString()
    Method getSeverityLevelString

    Returns:
    A string representation of the current severity level. This may be null if the severity level has not been set or if it has been set with an unknown value.

    getSituationType

    public AbleMessageContainer getSituationType()
    Method getSituationType

    Returns:
    The situation type.
    • FAILURE_REQUEST
    • INFO_SITUATION
    • PERMISSION_REQUEST

      getResponses

      public AbleMessageContainer[] getResponses()
      Gets a reference to the list of responses.

      Returns:
      The String[] of all responses.

      getResponse

      public AbleMessageContainer getResponse(int responseIndex)
      Method getReponse

      Parameters:
      responseIndex - The index of the response that is to be returned.
      Returns:
      The response for responseIndex.

      getYesResponse

      public AbleMessageContainer getYesResponse()
      Method getYesResponse

      Returns:
      The response used for the YES response.

      getNoResponse

      public AbleMessageContainer getNoResponse()
      Method getNoResponse

      Returns:
      The response used for the NO response.

      formatSituationName

      public void formatSituationName(java.lang.Object[] theSubText)
      Formats the situation name with the supplied substitution text.

      Parameters:
      theSubText - The substitution text to format the situation name.

      formatResponse

      public void formatResponse(int theResponseIndex,
                                 java.lang.Object[] theSubText)
      Formats a response with the supplied substitution text.

      Parameters:
      theResponseIndex - The index of the response string that is to be formatted.
      theSubText - The substitution text to format the response at theResponseIndex.

      debugString

      public java.lang.String debugString()
      Returns a translated representation of this AgentSituation.

      Returns:
      The translated representation of this AgentSituation.

      equals

      public boolean equals(java.lang.Object theObject)
      Compares this AgentSituation with another to determine if the situations are equal.

      AgentSituation are equal if their internal, private, immutable handles are equal.

      Parameters:
      theObject - An instance of an AgentSituation that is to be compared to this AgentSituation.

      Returns:
      true, if this AgentSituation is equal to the specified AgentSituation; false, otherwise.

      AgentSituations are equal if their internal, private, immutable handles are equal.


      hashCode

      public int hashCode()
      Returns the hashCode of this AgentSituation.

      The hashCode of an AgentSituation is the sum of the hashCodes of all of the the internal, private, immutable handles of this object.

      Returns:
      The sum of the hashCodes of all of the internal, private, immutable data members.

      toString

      public java.lang.String toString()
      Returns a brief description of this AgentSituation.

      Returns:
      A brief description of this AgentSituation.

      ABLE 2.3.0 07/13/2005 14:21:00

      (C) Copyright IBM Corporation 1999, 2005