vs.plotagent
Interface IThreadManager

All Superinterfaces:
IAgentModule
All Known Implementing Classes:
BasicThreadManager

public interface IThreadManager
extends IAgentModule

The task of the thread manager is to set up story environments and characters so that it matches the description of the beginning of a thread. The initial design is that threads have preconditions, setting definitions and character goals. The thread manager should contain functionality to: - see if an thread is applicable - determine whether thread was already used - remember which thread is currently being used - setup the environment for the thread A question is how much of this should be implemented in Prolog, and how much in Java.

Author:
swartjes

Nested Class Summary
static class IThreadManager.StoryPhase
           
 
Method Summary
 void addThread(java.lang.String threadString)
          Tries to start the given thread.
 void assignResolutionGoal(Goal goal, PlotThread thread)
          Assigns a resolution goal to a character.
 void executeThread(PlotThread thread)
          Executes the thread, meaning that setting and characters are set up.
 void finishThread(PlotThread thread)
          Signals that a thread is finished (i.e. that a character has achieved his resolution goal
 PlotThread getCurrentThread()
          Determines what the current thread is
 java.util.Vector<java.lang.String> getPossibleThreads()
          Determines all possible threads and returns their Prolog identifier strings
 java.util.Vector<Goal> getThreadGoals(java.lang.String characterURI)
          Retrieves the episodic goals, defined for certain character, if any.
 boolean startingThread()
          Returns whether the thread manager is trying to start an thread at this point
 
Methods inherited from interface vs.IAgentModule
getAgent
 

Method Detail

addThread

void addThread(java.lang.String threadString)
Tries to start the given thread. If it is not already possible, it will be added to the plot goal manager in an attempt to make this possible.


executeThread

void executeThread(PlotThread thread)
Executes the thread, meaning that setting and characters are set up.

Parameters:
thread - the thread to execute.

getCurrentThread

PlotThread getCurrentThread()
Determines what the current thread is

Returns:
a prolog string representing the thread identifier

finishThread

void finishThread(PlotThread thread)
Signals that a thread is finished (i.e. that a character has achieved his resolution goal


getPossibleThreads

java.util.Vector<java.lang.String> getPossibleThreads()
Determines all possible threads and returns their Prolog identifier strings

Returns:
the prolog strings representing the thread identifiers (e.g. thread-on-ship(X))

getThreadGoals

java.util.Vector<Goal> getThreadGoals(java.lang.String characterURI)
Retrieves the episodic goals, defined for certain character, if any.

Parameters:
characterURI - the URI of the character to retrieve episodic goals for
Returns:
its episodic goals

startingThread

boolean startingThread()
Returns whether the thread manager is trying to start an thread at this point

Returns:
true if an thread is being started, false if not

assignResolutionGoal

void assignResolutionGoal(Goal goal,
                          PlotThread thread)
Assigns a resolution goal to a character.

Parameters:
goal - the goal to assign to the character (the character is embedded in the goal)
thread - the plot thread this assignment comes from; used for logging purposes