TMST.representation
Class TMST

java.lang.Object
  extended byLocalKnowledgeModel
      extended byTMST.representation.TMST

public class TMST
extends LocalKnowledgeModel

See Also:
Serialized Form

Constructor Summary
TMST()
           
TMST(java.lang.String file)
           
 
Method Summary
 void activate()
          Method for activating the all entities in the tmst which are solvable.
 void analyzeAndPrint()
          Method printing all entities part of the tmst to stdout.
 void dependencyAnalyzation()
          Method for extracting input/output dependencies from all PSMs in the TMST.
 boolean generateSolution()
          Method for generating the solution of a tmst.
 boolean generateSolutionSpace()
          Method for generating the solution space of a tmst.
 Action getAction(java.lang.String actionname)
          Method returning the specified action, or null if it does not exist.
 Action[] getActions(java.lang.String actionType)
          Method for getting all actions with a specified type
 Action[] getAllActions()
          Method returning the names of all actions part of the TMST as Strings.
 Executor[] getAllExecutors()
          Method returning all executors part of the TMST.
 java.util.ArrayList getAllProblemSolvingMethods()
          Method returning all the problem solving methods part of a TMST.
 java.util.ArrayList getAllTasks()
          Method returning all tasks part of the TMST.
 FileWriter getFileWriter()
          Method returning the filewriter of this TMST.
 java.lang.String getInitialInput()
          Method getting the initial input of the problem solving.
 Task getInitialProblem()
          Method returning the initial problem of this task structure tree, or null if it does not exist.
 ProblemSolvingMethod getProblemSolvingMethod(java.lang.String psmname)
          Method returning the specified problem solving method, or null if it does not exist.
 Task getTask(java.lang.String taskname)
          Method returning the specified task, or null if it does not exist.
 int getTeamID()
          Method returning the teamID of this TMST New method added by Kari Roessland.
 boolean isSpacePart(Entity ent)
          Method for tagging an entity part of the solution space.
 void printSolutionAndCost()
          Method printing enitities part of the solution and the cost related to them.
 void setAsInitialProblem(Task initialProblem)
          Method for setting a task as the initial problem to solve - the root node in the task-method tree structure.
 void setFileWriter(FileWriter fileWriter)
          Method setting the filewriter, by giving the name of a file New method added by Kari Roessland.
 void setInitialInput(java.lang.String input)
          Method setting the initial input of the problem solving.
 void setTeamID(int id)
          Method setting the teamID of this TMST New method added by Kari Roessland.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TMST

public TMST()

TMST

public TMST(java.lang.String file)
     throws java.io.IOException,
            java.lang.ClassNotFoundException
Method Detail

setFileWriter

public void setFileWriter(FileWriter fileWriter)
Method setting the filewriter, by giving the name of a file New method added by Kari Roessland.


getFileWriter

public FileWriter getFileWriter()
Method returning the filewriter of this TMST. New method added by Kari Roessland.

Returns:
The filewriter

getTeamID

public int getTeamID()
Method returning the teamID of this TMST New method added by Kari Roessland.

Returns:
The teamID

setTeamID

public void setTeamID(int id)
Method setting the teamID of this TMST New method added by Kari Roessland.

Parameters:
id - - the teamID

setInitialInput

public void setInitialInput(java.lang.String input)
Method setting the initial input of the problem solving. New method added by Kari Roessland.

Parameters:
input - The initial input

getInitialInput

public java.lang.String getInitialInput()
Method getting the initial input of the problem solving. New method added by Kari Roessland.

Returns:
The initial input

getAction

public Action getAction(java.lang.String actionname)
Method returning the specified action, or null if it does not exist.


getActions

public Action[] getActions(java.lang.String actionType)
Method for getting all actions with a specified type


getTask

public Task getTask(java.lang.String taskname)
Method returning the specified task, or null if it does not exist.

Parameters:
taskname -
Returns:
Task The task specified.

getAllProblemSolvingMethods

public java.util.ArrayList getAllProblemSolvingMethods()
Method returning all the problem solving methods part of a TMST.

Returns:
ArrayList The name of all PSMs in the TMST stored in an ArrayList as Strings.

getAllActions

public Action[] getAllActions()
Method returning the names of all actions part of the TMST as Strings.

Returns:
ArrayList The name of the actions stored in an ArrayList as Strings.

getAllTasks

public java.util.ArrayList getAllTasks()
Method returning all tasks part of the TMST.

Returns:
ArrayList An ArrayList containing the name of all tasks in the TMST.

getAllExecutors

public Executor[] getAllExecutors()
Method returning all executors part of the TMST.

Returns:
ArrayList An Array of all the executors part of the TMST.

getProblemSolvingMethod

public ProblemSolvingMethod getProblemSolvingMethod(java.lang.String psmname)
Method returning the specified problem solving method, or null if it does not exist.


getInitialProblem

public Task getInitialProblem()
Method returning the initial problem of this task structure tree, or null if it does not exist.

Returns:
Task The task which has been specified as the initial problem of the task structure tree.

printSolutionAndCost

public void printSolutionAndCost()
Method printing enitities part of the solution and the cost related to them. Modified by Kari Roessland.


setAsInitialProblem

public void setAsInitialProblem(Task initialProblem)
                         throws java.lang.Exception
Method for setting a task as the initial problem to solve - the root node in the task-method tree structure. Every TMST structure may only have one Initial Problem, so setting two or more tasks as inital problems throws exception.

Throws:
java.lang.Exception

dependencyAnalyzation

public void dependencyAnalyzation()
Method for extracting input/output dependencies from all PSMs in the TMST.


generateSolutionSpace

public boolean generateSolutionSpace()
                              throws NameAlreadyExistException
Method for generating the solution space of a tmst. It does not only return the solution space, but store it as a private variable in the tmst as well. Modified by Kari Roessland.

Returns:
true if there are a solution and false if not.
Throws:
NameAlreadyExistException

isSpacePart

public boolean isSpacePart(Entity ent)
Method for tagging an entity part of the solution space. New method added by Kari Roessland.

Parameters:
ent - - the entity to be tagged

generateSolution

public boolean generateSolution()
                         throws NameAlreadyExistException
Method for generating the solution of a tmst. It does not only return the solution but store it as a private variable as well. Modified by Kari Roessland

Returns:
The status of the solution generation.
Throws:
NameAlreadyExistException

activate

public void activate()
Method for activating the all entities in the tmst which are solvable. Starts with collecting all the executors, and activates all actions and all related entities which are solvable when an action is performed.


analyzeAndPrint

public void analyzeAndPrint()
Method printing all entities part of the tmst to stdout.