TMST.representation
Class ProblemSolvingMethod

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

public class ProblemSolvingMethod
extends EntityType

Class describing Problem Solving Methods. PSMs describe what to do by pointing to tasks which solve a certain task which refers to the PSM. Parameters the PSM may hold:

Comment: (Kari Roessland) All the getMethods should return ArrayLists and not regular lists.

See Also:
Serialized Form

Constructor Summary
ProblemSolvingMethod(Entity ent)
          Cosntructor for encpsulating an entity as a psm (to be allowed to use psm methods on it)
ProblemSolvingMethod(TMST tmst, java.lang.String name, java.lang.String description)
          Constructor for Problem Solving Methods
 
Method Summary
 Assumption[] getAssumptions()
          Method for getting the assumptions for the current problem solving method.
 java.util.ArrayList getControlInformation()
          A method that returns all Constraints that apply for this psm
 Cost getCost()
          Method returning the cost entity of this psm.
 float getCostValue()
          Method returning the cost entity of this psm.
 Input[] getInput()
          Method which returns the input this method requires
 java.util.ArrayList getInputsString()
          Method for getting all input-entities as strings
 Output[] getOutput()
          Method which returns any output related to this psm
 java.lang.String getOutputString()
          Method for getting the output entity as a string - this method assume that there is only one output.
 Task[] getSubtasks()
          A method that returns all subtasks that this problem solving method points to
 boolean isActivated()
          Method for checking whether an action is activated or not.
protected  boolean isFulFilled()
          Method which checks whether all subtasks of this problem solving method are activated.
 boolean isSolutionPart()
          Method for checking whether a psm is part of the solution or not.
 boolean isSpacePart()
          Method for checking whether a PSM 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 psm.
 void setAssumptions(Assumption[] ass)
          Method for setting the assumptions related to the psm.
 void setControlInformation(java.lang.String value)
          Method for adding a value to the control information of this PSM
 void setControlInformation(Value value)
          Method for adding a value to the control information of this PSM
protected  void setCost(float costValue)
          Method for setting the cost of a PSM.
 void setInput(Input input)
          Method for setting input of the PSM
 void setInputs(Input[] ins)
          Method which sets the input needed for to solve the psm >> Assumptions?
 void setOutput(Output output)
          Method for setting an output for the psm.
 void setOutputs(Output[] outs)
          Method for setting a set of outputs for the psm.
 void setSubtask(Task subtask)
          Method for setting one subtask for this PSM to point to
 void setSubtasks(Task[] subtasks)
          Method for setting a set of subtasks as the tasks this PSM points to.
 void updateControlInformation(ControlInformation ci)
          Method for updating the control information of this PSM
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProblemSolvingMethod

public ProblemSolvingMethod(TMST tmst,
                            java.lang.String name,
                            java.lang.String description)
                     throws NameAlreadyExistException
Constructor for Problem Solving Methods

Parameters:
tmst - The TMST this problem solving method belongs to
name - The name of the problem solving method
description - Description of the PSM

ProblemSolvingMethod

public ProblemSolvingMethod(Entity ent)
                     throws EntityTypeNotMatchedException
Cosntructor for encpsulating an entity as a psm (to be allowed to use psm methods on it)

Parameters:
ent - The entity to encapsulate.
Method Detail

isSpacePart

public boolean isSpacePart()
Method for checking whether a PSM 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 psm is part of the solution or not.

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

isFulFilled

protected boolean isFulFilled()
Method which checks whether all subtasks of this problem solving method are activated. If they are true will be returned, else false.


setCost

protected void setCost(float costValue)
                throws AlreadyHasValueException
Method for setting the cost of a PSM. Takes a float as parameter.

Throws:
AlreadyHasValueException

getCost

public Cost getCost()
             throws AlreadyHasValueException
Method returning the cost entity of this psm.

Returns:
Cost
Throws:
AlreadyHasValueException

getCostValue

public float getCostValue()
                   throws AlreadyHasValueException
Method returning the cost entity of this psm.

Returns:
Cost
Throws:
AlreadyHasValueException

setSubtask

public void setSubtask(Task subtask)
Method for setting one subtask for this PSM to point to

Parameters:
subtask - The task to point to.

setSubtasks

public void setSubtasks(Task[] subtasks)
Method for setting a set of subtasks as the tasks this PSM points to.

Parameters:
subtasks - The set of subtasks which is to be associated with this psm.

getSubtasks

public Task[] getSubtasks()
A method that returns all subtasks that this problem solving method points to

Returns:
Task[] The subtasks which this psm points to

setControlInformation

public void setControlInformation(java.lang.String value)
Method for adding a value to the control information of this PSM

Parameters:
value - Value to add to the control information, as a String.

setControlInformation

public void setControlInformation(Value value)
Method for adding a value to the control information of this PSM

Parameters:
value - Value to add to the control information, as a Value class instance.

updateControlInformation

public void updateControlInformation(ControlInformation ci)
                              throws java.lang.Exception
Method for updating the control information of this PSM

Parameters:
ci - The control information which is to be associated with the psm.
Throws:
java.lang.Exception

getControlInformation

public java.util.ArrayList getControlInformation()
A method that returns all Constraints that apply for this psm

Returns:
ArrayList The control information associated to the psm. Changed by Kari Roessland

setOutput

public void setOutput(Output output)
Method for setting an output for the psm.

Parameters:
output - The output

setOutputs

public void setOutputs(Output[] outs)
Method for setting a set of outputs for the psm.

Parameters:
outs - The set of output

getOutput

public Output[] getOutput()
Method which returns any output related to this psm

Returns:
Output Yeah, the output ...

getOutputString

public java.lang.String getOutputString()
Method for getting the output entity as a string - this method assume that there is only one output.

Returns:
String The name of the output entity

setInput

public void setInput(Input input)
Method for setting input of the PSM

Parameters:
input - The input.

setInputs

public void setInputs(Input[] ins)
Method which sets the input needed for to solve the psm >> Assumptions?

Parameters:
ins - The set of inputs assigned to the PSMs

getInput

public Input[] getInput()
Method which returns the input this method requires

Returns:
Input[] The method returns an array containing all inputs associated with the psm.

getInputsString

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

Returns:
ArrayList A list of input-entities as strings

setAssumption

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

Parameters:
ass - The assumptions which apply for the psm

setAssumptions

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

Parameters:
ass - The assumptions which apply for the psm

getAssumptions

public Assumption[] getAssumptions()
                            throws java.lang.Exception
Method for getting the assumptions for the current problem solving method.

Returns:
Assumption The assumptions related to the psm.
Throws:
java.lang.Exception

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.


matches

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

Parameters:
value - The entity to match against.
Returns:
boolean The method returns true if the entity value matches the this entity type, and false if not.