TMST.representation
Class Action

java.lang.Object
  extended byEntityType
      extended byTMST.representation.Action

public class Action
extends EntityType

Class describing the actual, executable bit which may be assigned to an agent. Actions are Problem solving methods which are executable. Actions are described by the type of action it is.Parameters actions may hold:

See Also:
Serialized Form

Constructor Summary
Action(Entity ent)
           
Action(TMST tmst, java.lang.String name, java.lang.String description, java.lang.String actiontype)
          Contains action type as string.
 
Method Summary
 Assumption[] getAssumptions()
          Method for getting the assumptions for the current action.
 Cost getExecutionCost()
          Metohod returning the execution cost as cost entity
 float getExecutionCostValue()
          Metohod returning the execution cost as cost entity
 Executor getExecutor()
          Method for getting the executor which has been selected to execute the action
 java.lang.String getExecutorString()
          Method for returning the executor which has been selected to execute the action as a String.
 Input[] getInputs()
          Method for getting all input part the action
 java.util.ArrayList getInputsString()
          Method for getting all input-entities as strings
 Output getOutput()
           
 java.lang.String getOutputString()
          Method for getting the output entity as a string
 java.lang.String getTask()
          Method returning the task that is executed by this action
 ActionType getType()
          Method returning the actiontype of this action
 boolean isActivated()
          Method for checking whether an action is activated or not.
 boolean isSolutionPart()
          Method for checking whether a action is part of the solution or not.
 boolean isSpacePart()
          Method for checking whether a action is part of the solution space or not.
static boolean matches(Entity value)
          Method which has to be overriden (from the class EntityType)
 void setAsActivated()
          Method for setting an action as activated.
 void setAssumption(Assumption ass)
          Method for setting the assumptions related to the action.
 void setAssumptions(Assumption[] ass)
          Method for setting the assumptions related to the action.
protected  void setExecutionCost(Cost cost)
          Private method for setting the execution cost.
 void setExecutor(Executor executor)
           
 void setInput(Input in)
          Method for adding Input to the action
 void setInputs(Input[] ins)
          Method for adding a set of inputs to the action
 void setOutput(Output out)
           
 void setOutputs(Output[] outs)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action(TMST tmst,
              java.lang.String name,
              java.lang.String description,
              java.lang.String actiontype)
       throws NameAlreadyExistException
Contains action type as string.

Parameters:
tmst - The knowledge model that contains the action
name - The name of the action
description - Description of the action.
actiontype - The type of the action, name as string.b

Action

public Action(Entity ent)
       throws EntityTypeNotMatchedException
Method Detail

setExecutor

public void setExecutor(Executor executor)

getExecutionCost

public Cost getExecutionCost()
                      throws AlreadyHasValueException
Metohod returning the execution cost as cost entity

Returns:
Cost The execution cost of this action
Throws:
AlreadyHasValueException

getExecutor

public Executor getExecutor()
                     throws AlreadyHasValueException
Method for getting the executor which has been selected to execute the action

Returns:
Executor The executor of the action
Throws:
AlreadyHasValueException

getExecutorString

public java.lang.String getExecutorString()
Method for returning the executor which has been selected to execute the action as a String.

Returns:
the executor as a String

getExecutionCostValue

public float getExecutionCostValue()
                            throws AlreadyHasValueException
Metohod returning the execution cost as cost entity

Returns:
Cost The execution cost of this action
Throws:
AlreadyHasValueException

isSpacePart

public boolean isSpacePart()
Method for checking whether a action is part of the solution space or not.

Returns:
boolean The method returns true if part of the solution space and false if not.

isSolutionPart

public boolean isSolutionPart()
Method for checking whether a action is part of the solution or not.

Returns:
boolean The method returns true if part of the solution and false if not.

setExecutionCost

protected void setExecutionCost(Cost cost)
                         throws AlreadyHasValueException
Private method for setting the execution cost.

Parameters:
cost - The cost entity to relate to
Throws:
AlreadyHasValueException

setAssumption

public void setAssumption(Assumption ass)
Method for setting the assumptions related to the action.

Parameters:
ass - The assumptions which apply for the action.

setAssumptions

public void setAssumptions(Assumption[] ass)
Method for setting the assumptions related to the action.

Parameters:
ass - The assumptions which apply for the action.

getAssumptions

public Assumption[] getAssumptions()
Method for getting the assumptions for the current action.

Returns:
Assumption[] The assumptions related to the action.

setInput

public void setInput(Input in)
Method for adding Input to the action

Parameters:
in - The input to add to the action

setInputs

public void setInputs(Input[] ins)
Method for adding a set of inputs to the action

Parameters:
ins - The set of inputs to add to the action

getInputs

public Input[] getInputs()
Method for getting all input part the action

Returns:
Input[] All Input entities related to the action

getInputsString

public java.util.ArrayList getInputsString()
Method for getting all input-entities as strings

Returns:
ArrayList A list of input-entities as strings

setOutput

public void setOutput(Output out)

setOutputs

public void setOutputs(Output[] outs)

getOutput

public Output getOutput()
                 throws java.lang.Exception
Throws:
java.lang.Exception

getOutputString

public java.lang.String getOutputString()
Method for getting the output entity as a string

Returns:
The name of the output entity

isActivated

public boolean isActivated()
Method for checking whether an action is activated or not.

Returns:
boolean The method returns true if activated and false if not.

setAsActivated

public void setAsActivated()
Method for setting an action as activated.


getType

public ActionType getType()
                   throws java.lang.Exception
Method returning the actiontype of this action

Returns:
ActionType The action type describing this action
Throws:
java.lang.Exception

getTask

public java.lang.String getTask()
Method returning the task that is executed by this action

Returns:
String A string with the name of the task that is executed by this action

matches

public static boolean matches(Entity value)
Method which has to be overriden (from the class EntityType)

Parameters:
value - The entity to match againts the class Action
Returns:
boolean True if value matches the Action class, and false if not.