kaos.autonomy.situation
Class DataRepository

java.lang.Object
  extended by kaos.autonomy.situation.DataRepository

public class DataRepository
extends java.lang.Object


Constructor Summary
DataRepository(Kaa currentKaaReasoner)
           
 
Method Summary
 java.lang.String delegateToWhichAgent(java.lang.String agentName, java.lang.String currentAction)
          check to which agent a given action can be delegated
 java.lang.String[] getActionAchievabilityStatusList()
          get the list of action achievability status
 java.lang.String[] getActionCapabilityStatusList()
          get the list of action capability status
 java.util.Set getActionsForAgent(java.lang.String agentID)
          get the actions an agent can perform
 java.lang.String[] getAdjustmentChoiceList(java.lang.String policyType, boolean addDelegationAction)
          get the list of AA choices
 double getAdjustmentCost(java.lang.String adjustmentAction)
          get the cost of autonomy adjustment
 java.util.List getAllAgentsInDirectory()
          get all agents currently registered in D.S.
 double getDelegationCost(java.lang.String action)
          get the cost of delegation
 double getMaxValue()
          get the max cost value
 java.lang.String[] getResourceAndServiceStateList()
          get the list of resource/serive states
 java.lang.String[] getResourceList(java.lang.String action)
          get the list of resources
 double getResourceOrServiceCost(java.lang.String name, java.lang.String status)
          get the number of risk cost values
 java.lang.String getResourceOrServiceStatus(java.lang.String name)
          get the status of a given resource/service
 double getRiskCost(java.lang.String adjustmentAction, java.lang.String failedAction)
          gets the cost of risk
 int getRiskLevelNumber()
          get the number of risk cost values
 java.lang.String[] getServiceList(java.lang.String action)
          get the list of services
 int getValueLevelNumber()
          get the number of numeric cost values
 boolean isAdjustmentCostIncluded()
          checks whether AA cost is included or not
 boolean isDelegable(java.lang.String agentName, java.lang.String currentAction)
          check whether a given action is delegable or not
 boolean isDelegationIncluded(java.lang.String[] actionList)
          checks whether delegation is in the AA choice list or not
 boolean isQuantitativeRiskType()
          tells whether risk is quantitative or not
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataRepository

public DataRepository(Kaa currentKaaReasoner)
Method Detail

getAdjustmentChoiceList

public java.lang.String[] getAdjustmentChoiceList(java.lang.String policyType,
                                                  boolean addDelegationAction)
get the list of AA choices

Parameters:
addDelegationAction - Whether to include delegation or not
Returns:
The list of choices in string array

getActionAchievabilityStatusList

public java.lang.String[] getActionAchievabilityStatusList()
get the list of action achievability status

Returns:
The list of action status

getActionCapabilityStatusList

public java.lang.String[] getActionCapabilityStatusList()
get the list of action capability status

Returns:
The list of action status

getResourceList

public java.lang.String[] getResourceList(java.lang.String action)
get the list of resources

Parameters:
action - Action name
Returns:
The list of resources

getServiceList

public java.lang.String[] getServiceList(java.lang.String action)
get the list of services

Parameters:
action - Action name
Returns:
The list of services

getResourceAndServiceStateList

public java.lang.String[] getResourceAndServiceStateList()
get the list of resource/serive states

Returns:
The list of states for resource/service

getResourceOrServiceStatus

public java.lang.String getResourceOrServiceStatus(java.lang.String name)
get the status of a given resource/service

Parameters:
name - Name of resource or service
Returns:
Resource/service status (either available or not_available)

getMaxValue

public double getMaxValue()
get the max cost value

Returns:
Max cost value (currently, max cost is 1000)

getValueLevelNumber

public int getValueLevelNumber()
get the number of numeric cost values

Returns:
Cost level number (currently, the number of level is 10: 0, 1, 2, ..., 8, max)

getRiskLevelNumber

public int getRiskLevelNumber()
get the number of risk cost values

Returns:
Cost level number (currently, the number of level is 10: 0, 1, 2, ..., 8, max)

getResourceOrServiceCost

public double getResourceOrServiceCost(java.lang.String name,
                                       java.lang.String status)
get the number of risk cost values

Parameters:
name - Name of resource or service
status - Status of a given resource or service
Returns:
Cost of resource/service

getAdjustmentCost

public double getAdjustmentCost(java.lang.String adjustmentAction)
get the cost of autonomy adjustment

Parameters:
action - AA choice
Returns:
Cost of AA

isQuantitativeRiskType

public boolean isQuantitativeRiskType()
tells whether risk is quantitative or not

Returns:
true telling that risk is quantitative

getRiskCost

public double getRiskCost(java.lang.String adjustmentAction,
                          java.lang.String failedAction)
gets the cost of risk

Parameters:
action - Name of action
Returns:
Risk cost

isDelegationIncluded

public boolean isDelegationIncluded(java.lang.String[] actionList)
checks whether delegation is in the AA choice list or not

Parameters:
actionList - List of actions
Returns:
Boolean value which tells whether delegation is included or not

isAdjustmentCostIncluded

public boolean isAdjustmentCostIncluded()
checks whether AA cost is included or not

Returns:
Boolean value which tells whether AA cost is included or not (default is to include it)

getActionsForAgent

public java.util.Set getActionsForAgent(java.lang.String agentID)
                                 throws UnknownConceptException,
                                        DirectoryFailure
get the actions an agent can perform

Parameters:
agentID - A String specifying the agent by its unique GUID
Returns:
A Set containing actions the agent can perform
Throws:
UnknownConceptException - If the agent is not found
DirectoryFailure - If error in the D.S.

getAllAgentsInDirectory

public java.util.List getAllAgentsInDirectory()
                                       throws DirectoryFailure
get all agents currently registered in D.S.

Returns:
A List containing all agents
Throws:
DirectoryFailure - If error in the D.S.

isDelegable

public boolean isDelegable(java.lang.String agentName,
                           java.lang.String currentAction)
                    throws DirectoryFailure
check whether a given action is delegable or not

Parameters:
agentName - Name of actor
currentAction - Name of action to check
Returns:
Boolean value which tells the delegability of an action
Throws:
DirectoryFailure - If error in the D.S.

delegateToWhichAgent

public java.lang.String delegateToWhichAgent(java.lang.String agentName,
                                             java.lang.String currentAction)
                                      throws DirectoryFailure
check to which agent a given action can be delegated

Parameters:
agentName - Name of actor
currentAction - Name of action to check
Returns:
Name of agent (string)
Throws:
DirectoryFailure - If error in the D.S.

getDelegationCost

public double getDelegationCost(java.lang.String action)
get the cost of delegation

Parameters:
action - Name of action to check cost
Returns:
cost