|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--SituationRecognizer
This is the main class of the application. The user interface is provided by a SituationWindow
can be shown from this class. This class implements runnable and is started from the
SituationWindow
when the user starts the recognizer. In the run() method a loop is started that
runs the recognition process at specified intervals.
Furthermore this class creates and controls all other classes and windows of the application.
Field Summary | |
protected java.lang.String |
currentSituationName
The name of the situation that has been in the previous recognition process. |
protected double |
endThreshhold
The endThreshhold is the value above which the probability for the end of a situation must be before the situation is considered to be finished. |
protected JESSCommunicator |
jessCommunicator
The JESSCommunicator is a shell around the JESS engine. |
protected JessViewer |
jessViewer
The JessViewer is a window that can show the contents of the JESS engine. |
protected boolean |
running
This boolean is set to false when the user stops the recognition process. |
protected int |
sampleInterval
This is the interval at which the recognition process is run. |
protected java.util.HashMap |
situations
This is the HashMap of the situations that the XMLParser has parsed from the XML file. |
protected java.util.Comparator |
situationsComparator
This comparator compares the start probabilities of two situations. |
protected java.util.HashMap |
situationStates
This is a HashMap of the situations with a Vector with the start and end probability for every situation. |
protected SituationWindow |
situationWindow
The SituationWindow provides the user interface and is used to show the results of
the recognition process to the user. |
protected double |
startThreshhold
The startThreshhold is the value above which the probability for the start of a situation must be before the situation can be detected. |
protected VariableReader |
variableReader
The VariableReader reads the values of all variables from the flight simulator,
displays them in the VariableWindow and puts them in the JESS engine. |
protected VariableWindow |
variableWindow
The VariableWindow shows the values of all variables from the flight simulator. |
protected XMLParser |
xmlParser
The XMLParser parses the xml file and creates a hashmap of Situation objects. |
Constructor Summary | |
SituationRecognizer()
The constructor. |
Method Summary | |
void |
addPerformedAction(java.lang.String situationName)
This method is called from the JESSCommunicator when one of the action rules in the JESS
engine has fires. |
protected void |
addSituationProbs(java.lang.String situationName,
double startProb,
double endProb)
The start and end probabilities for the situation with the given name are stored in a Vector, which is then stored in a HashMap which is passed to the SituationWindow later on. |
boolean |
isRunning()
Returns true if the recognizer is running, false otherwise. |
boolean |
loadXMLFile(java.io.File xmlFile)
Load and parse the knowledge base in the xml file. |
static void |
main(java.lang.String[] args)
The main function of the application. |
void |
pauseRecognizer()
Pause the recognition process by setting the boolean running to false. |
void |
recognizerWillStart()
This method is called just before the recognizer is started. |
void |
run()
Starts the recognition process. |
void |
setSituationState(java.lang.String situationName,
java.lang.String state)
This method is called from the JESSCommunicator when the state of the situation is changed
in the JESS engine. |
void |
showWindow()
Displays the SituationWindow . |
void |
stopRecognizer()
Stops the recognizer, clears the situation states and resets the JESS engine and the situations. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected JESSCommunicator jessCommunicator
JESSCommunicator
is a shell around the JESS engine.
protected JessViewer jessViewer
JessViewer
is a window that can show the contents of the JESS engine.
protected XMLParser xmlParser
XMLParser
parses the xml file and creates a hashmap of Situation objects.
protected VariableWindow variableWindow
VariableWindow
shows the values of all variables from the flight simulator.
protected VariableReader variableReader
VariableReader
reads the values of all variables from the flight simulator,
displays them in the VariableWindow
and puts them in the JESS engine.
protected SituationWindow situationWindow
SituationWindow
provides the user interface and is used to show the results of
the recognition process to the user.
protected java.util.HashMap situations
XMLParser
has parsed from the XML file.
protected java.util.HashMap situationStates
protected int sampleInterval
protected boolean running
protected java.lang.String currentSituationName
protected double startThreshhold
protected double endThreshhold
protected java.util.Comparator situationsComparator
Constructor Detail |
public SituationRecognizer()
Method Detail |
public void showWindow()
SituationWindow
.
public void run()
SituationWindow
to be shown.
9 - the thread is put to sleep for the remaining time of the sampleinterval.
run
in interface java.lang.Runnable
public void pauseRecognizer()
SituationWindow
.
public void stopRecognizer()
public void recognizerWillStart()
public boolean isRunning()
SituationWindow
to see if output has to be generated.
public boolean loadXMLFile(java.io.File xmlFile)
xmlFile
- The file where all the knowledge is stored.
public void setSituationState(java.lang.String situationName, java.lang.String state)
JESSCommunicator
when the state of the situation is changed
in the JESS engine. The situation is retrieved from the HashMap, its state is set and
it is put back into the HashMap.
situationName
- The name of the situation.state
- The new state of the situation.public void addPerformedAction(java.lang.String situationName)
JESSCommunicator
when one of the action rules in the JESS
engine has fires. The situation is retrieved from the HashMap, the action is added and
it is put back into the HashMap.
situationName
- The name of the situation.public static void main(java.lang.String[] args)
args
- Some argumentsprotected void addSituationProbs(java.lang.String situationName, double startProb, double endProb)
SituationWindow
later on. The
SituationWindow
can then show these probabilities to the user.
situationName
- The name of the situation.startProb
- The start probability of the situation.endProb
- The end probability of the situation.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |