teamSpace.structure
Class PlanLibrary

java.lang.Object
  extended byteamSpace.structure.PlanLibrary

public class PlanLibrary
extends java.lang.Object

This class represents the plan of the problem solving process, and serves as an interface to the TMST. It has different methods to extract information from the plan.


Constructor Summary
PlanLibrary(TMST tmst, java.lang.String composer)
          The constructor
 
Method Summary
 java.lang.String getAction(java.lang.String taskName)
          The method returns the action that is coupled to a task, and is part of the solution.
 java.lang.String getActionInput(java.lang.String actionName)
          The method return the name of the input of an action.
 java.lang.String getActionOutput(java.lang.String actionName)
          The method return the name of the output of an action
 java.lang.String getActionType(java.lang.String actionName)
          The method returns the action-type of an action
 java.lang.String getComposer()
          The method returns the composer of this problem, which is the agent, requesting the team space.
 java.lang.String getExecutor(java.lang.String actionName)
          The method returns the executor (agentname and adress) of an action
 java.lang.String getGoal(java.lang.String taskName)
          The method returns goal of a specified task.
 java.lang.String getInitialGoal()
          The method returns the initial goal as a string.
 java.lang.String getInitialInput()
          The method returns the initial input as a string.
 java.lang.String getInitialTask()
          The method returns the name of the initial task
 java.lang.String getInputValue(java.lang.String inputName)
          The method returns the inputvalue of the specified input
 java.util.ArrayList getIODependencies(java.lang.String psmName)
          The method returns a list of strings describing IO-dependecies related to a psm.
 java.lang.String getOutputValue(java.lang.String outputName)
          The method returns the outputvalue of the specified output
 java.lang.String getPSM(java.lang.String taskName)
          The method returns the PSM that is coupled to a task, and is part of the solution.
 java.lang.String getPSMInput(java.lang.String psmName)
          The method return the name of the input of psm.
 java.lang.String getPSMOutput(java.lang.String psmName)
          The method return the name of the output of a psm (problem solving method)
 java.lang.String getTaskInput(java.lang.String taskName)
          The method return the name of the input of a task.
 java.lang.String getTaskOutput(java.lang.String taskName)
          The method return the name of the output of a task
 java.lang.String[] getTasks(java.lang.String psmName)
          The method returns an array with the tasks connected to a psm.
 int getTeamID()
          The method returns the teamID stored in the TMST as an int.
 void setFileWriter(FileWriter fileWriter)
          This method sets the FileWriter that handles printing the output of the problem solving steps to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlanLibrary

public PlanLibrary(TMST tmst,
                   java.lang.String composer)
The constructor

Parameters:
tmst - The TMST (task structure tree) that has problem solving information (the plan)
composer - The name-adress of the requester of the problem
Method Detail

setFileWriter

public void setFileWriter(FileWriter fileWriter)
This method sets the FileWriter that handles printing the output of the problem solving steps to a file.

Parameters:
fileWriter - Reference to the FileWriter used by all agents working on the problem of one certain TR

getInitialTask

public java.lang.String getInitialTask()
The method returns the name of the initial task

Returns:
A string with the name of the initial task

getPSM

public java.lang.String getPSM(java.lang.String taskName)
The method returns the PSM that is coupled to a task, and is part of the solution. There is only ONE PSM per task that is part of the solution.

Parameters:
taskName - - The name of the task which it's PSM should be returned
Returns:
The name of the PSM coupled to the task or an empty string if it is not found

getAction

public java.lang.String getAction(java.lang.String taskName)
The method returns the action that is coupled to a task, and is part of the solution. There is only ONE action per task that is part of the solution.

Parameters:
taskName - - The name of the task
Returns:
The name of the action coupled to the task or an empty string if it is not found

getTasks

public java.lang.String[] getTasks(java.lang.String psmName)
The method returns an array with the tasks connected to a psm. If the psm is part of the solution space, all of subtasks are too.

Parameters:
psmName - - The name of the problem solving method
Returns:
An array of task names, returns null if no tasks are found

getActionInput

public java.lang.String getActionInput(java.lang.String actionName)
The method return the name of the input of an action. The method still only handles that an action has one input.

Parameters:
actionName - - The name of the action
Returns:
The name of the input

getActionOutput

public java.lang.String getActionOutput(java.lang.String actionName)
The method return the name of the output of an action

Parameters:
actionName - - The name of the action
Returns:
The name of the output

getTaskInput

public java.lang.String getTaskInput(java.lang.String taskName)
The method return the name of the input of a task. The method still only handles that a task has one input.

Parameters:
taskName - - The name of the task
Returns:
The name of the input

getTaskOutput

public java.lang.String getTaskOutput(java.lang.String taskName)
The method return the name of the output of a task

Parameters:
taskName - - The name of the task
Returns:
The name of the output

getPSMInput

public java.lang.String getPSMInput(java.lang.String psmName)
The method return the name of the input of psm. The method still only handles that a psm has one input.

Parameters:
psmName - - The name of the psm
Returns:
The name of the input

getPSMOutput

public java.lang.String getPSMOutput(java.lang.String psmName)
The method return the name of the output of a psm (problem solving method)

Parameters:
psmName - - The name of the psm
Returns:
The name of the output

getIODependencies

public java.util.ArrayList getIODependencies(java.lang.String psmName)
The method returns a list of strings describing IO-dependecies related to a psm. The IO-dependencies are between the psm's subtasks.

Parameters:
psmName - - The name of the psm
Returns:
An ArrayList with IO-dependencies

getExecutor

public java.lang.String getExecutor(java.lang.String actionName)
The method returns the executor (agentname and adress) of an action

Parameters:
actionName - - The name of the action
Returns:
The executor of the specified action

getActionType

public java.lang.String getActionType(java.lang.String actionName)
The method returns the action-type of an action

Parameters:
actionName - - The name of the action
Returns:
The name of the action-type

getComposer

public java.lang.String getComposer()
The method returns the composer of this problem, which is the agent, requesting the team space.

Returns:
The decomposer name and adress as a string.

getInputValue

public java.lang.String getInputValue(java.lang.String inputName)
The method returns the inputvalue of the specified input

Parameters:
inputName - - The specified input
Returns:
The input value as a String

getOutputValue

public java.lang.String getOutputValue(java.lang.String outputName)
The method returns the outputvalue of the specified output

Parameters:
outputName - - The specified output
Returns:
The output value as a String

getGoal

public java.lang.String getGoal(java.lang.String taskName)
The method returns goal of a specified task. This method only handles that a task has a single goal.

Parameters:
taskName - - The specified task
Returns:
The goal as a String

getInitialGoal

public java.lang.String getInitialGoal()
The method returns the initial goal as a string.

Returns:
The initial goal

getInitialInput

public java.lang.String getInitialInput()
The method returns the initial input as a string.

Returns:
The initial input

getTeamID

public int getTeamID()
The method returns the teamID stored in the TMST as an int. This is the same teamID that is stored in the TeamSpace (structure) - class.

Returns:
The teamID as an int