Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

YadaRunner Class Reference
[YadaRunnableDocuments - also called active documents]

Inheritance diagram for YadaRunner:

Inheritance graph
[legend]
Collaboration diagram for YadaRunner:

Collaboration graph
[legend]
List of all members.

Detailed Description

YadaRunner - document to run YadaJobs. This document is the basic implementation of a YadaRunnableDocument. A more specific implementation of a YadaRunnableDocument is for example the YadaGlsStats. We implement here the basic functionality to select an schedule YadaJobs that run on YadaMachines.

Author:
Michael Daum
Id
YadaRunner.tcl,v 1.27 2004/09/06 13:41:13 micha Exp

Definition at line 23 of file YadaRunner.tcl.

Public Member Functions

 activationHandle ()
 askRunall ()
 backward ()
 breakJob ()
 clear ()
virtual deActivationHandle ()
 displayTitle ()
 forward ()
 fromDOM (domNode rootNode)
 getPersistanceFileName ()
 getTotalLabelRecall ()
 getTotalLexRecall ()
 getTotalScore ()
 getTotalSoftTime ()
 getTotalSolTime ()
 getTotalStructRecall ()
 getTotalTime ()
 hasSavedState ()
virtual init ()
 interruptJobs ()
 isModified ()
 killJob ()
 lastChanged ()
 load ()
 markWordgraph (TclString wordgraph)
 print (TclString message)
 reload ()
 resetModified ()
 resortRows ()
 run (YadaExperiment experiment="")
 runall ()
 save ()
 selectExperiment (TclString experimentName="")
 setModified ()
 setToggle (TclString name, TclRef value="")
 sortRows (TclNumber colNo, TclList args)
 step (TclString wordgraph="")
 termJob ()
 toDOM ()
 unbreakJob ()
 unmarkWordgraph (TclString wordgraph)
 YadaRunner (TclList args)

Static Public Member Functions

 newDocument (TclString className, TclString name)

Public Attributes

TclString hasView = "true"
TclString name = ""
YadaDocument nextDocument
YadaDocument prevDocument
TclString selectedExperiment = ""

Protected Member Functions

 _analyseDocument (DomDocument document, TclExperiment experiment)
 _clearRow ()
 _computeSpeedup (TclNumber time1, TclNumber time2)
 _deleteData ()
 _getActiveWordgraphs ()
 _getDoneWork ()
 _getRowOfWordgraph (TclString wordgraph)
 _getSelectedExperiment ()
 _getSelectedWork ()
 _getUndoneWork ()
 _getWordgraphs ()
 _getXMLFileName (TclString wordgraph)
 _insertData (TclString wordgraph, TclList args)
 _jobConsumer (YadaJob job)
 _registerJob (YadaJob job)
 _showContextMenu (TclNumber x, TclNumber y, TclNumber xroot, TclNumber yroot)
 _traceProcess ()
 _unregisterJob (YadaJob job)
 _viewLogfile (TclList experiments="")
 _viewXmlfile (TclList experiments="")
 askNewLoad ()
 loadUpdatedWordgraphs (TclList args)
 updateModificationTime ()

Protected Attributes

TclArray _analyseResult
TclArray _doneWordgraph
TclNumber _gotBreak = 0
TclNumber _isInitialized = 0
TclNumber _isRunning = 0
TclNumber _lastModificationTime = 0
TclNumber _modified = 0
TclString _selectedContextWordgraph = ""

Private Member Functions

 _analyseDocument (DomDocument document, YadaExperiment experiment)
 _computeStatistics ()
 _getLoadedWordgraphNames ()
 _getSavedWordgraphNames (domNode rootNode)
 _getTypeOfColumn (TclNumber colNo)
 _getUpdatedWordgraphNames ()
 _isModified (domNode rootNode)
 _judgeRow (TclNumber row)
 _resetDataOf (TclList wordgraphs)
 _showStatistics ()
 _toHtml ()

Private Attributes

TclArray _labelledHitsOf
TclArray _lexicalHitsOf
TclNumber _noErrors = 0
TclNumber _noSolutions = 0
TclArray _scoreOf
TclArray _strictHitsOf
TclArray _structHitsOf
TclNumber _totalLabelledRecall = 0
TclNumber _totalLexicalRecall = 0
TclNumber _totalScore = 0
TclNumber _totalSoftTime = 0
TclNumber _totalSolTime = 0
TclNumber _totalStrictRecall = 0
TclNumber _totalStructRecall = 0
TclNumber _totalTime = 0
TclNumber _totalWordgraphs = 0
TclArray _triesOf
TclArray _typeOfColumn


Constructor & Destructor Documentation

YadaRunner::YadaRunner TclList  args  ) 
 

constructor

Definition at line 91 of file YadaRunner.tcl.


Member Function Documentation

YadaRunnableDocument::_analyseDocument DomDocument  document,
TclExperiment  experiment
[protected, inherited]
 

analyse a given DomDocument produced with the help of a YadaExperiment. This method extracts all the information that we normaly are interested in in runnable documents. Classes (like YadaGlsStats) overload this function and extract extra information not analysed here. So as a sideeffect the resulting data is stored into the protected variable _analyseResult as documented above. In some cases where the DomDocument is illformed we still try to extract as many information as possible. In case of any error you will notice that by a return code of 0. Error messages are give by print(). The experiment is consulted especialy when no evaluation data is contained in the document in order to get the number of tries in the statistics correctly an which is only provided by the used CDG grammar, especialy the contained annotation of the lattice.

Parameters:
document the DomDocument resulting from a dom parse
experiment the experiment with which we produced this document
Definition at line 1051 of file YadaRunnableDocument.tcl.

YadaRunner::_analyseDocument DomDocument  document,
YadaExperiment  experiment
[private]
 

_analyseDocument

Definition at line 383 of file YadaRunner.tcl.

YadaRunnableDocument::_clearRow  )  [protected, inherited]
 

_clearRow

Definition at line 1641 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_computeSpeedup TclNumber  time1,
TclNumber  time2
[protected, inherited]
 

_computeSpeedup

Definition at line 718 of file YadaRunnableDocument.tcl.

YadaRunner::_computeStatistics  )  [private]
 

_computeStatistics

Reimplemented from YadaRunnableDocument.

Definition at line 427 of file YadaRunner.tcl.

YadaRunnableDocument::_deleteData  )  [protected, inherited]
 

_deleteData

Definition at line 1717 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_getActiveWordgraphs  )  [protected, inherited]
 

_getActiveWordgraphs

Definition at line 960 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_getDoneWork  )  [protected, inherited]
 

_getDoneWork

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 819 of file YadaRunnableDocument.tcl.

YadaRunner::_getLoadedWordgraphNames  )  [private]
 

Gets all loaded wordgraphs (i.e. the wordgraphs that appear in the document's table)

Returns:
list of currently loaded wordgraphs
Definition at line 1072 of file YadaRunner.tcl.

YadaRunnableDocument::_getRowOfWordgraph TclString  wordgraph  )  [protected, inherited]
 

_getRowOfWordgraph

Definition at line 449 of file YadaRunnableDocument.tcl.

YadaRunner::_getSavedWordgraphNames domNode  rootNode  )  [private]
 

Returns list of wordgraph names saved in the runner document xml file

Parameters:
rootNode root domNode of document's xml file
Definition at line 1030 of file YadaRunner.tcl.

YadaRunnableDocument::_getSelectedExperiment  )  [protected, inherited]
 

_getSelectedExperiment

Definition at line 784 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_getSelectedWork  )  [protected, inherited]
 

_getSelectedWork

Definition at line 795 of file YadaRunnableDocument.tcl.

YadaRunner::_getTypeOfColumn TclNumber  colNo  )  [private]
 

_getTypeOfColumn

Reimplemented from YadaRunnableDocument.

Definition at line 555 of file YadaRunner.tcl.

YadaRunnableDocument::_getUndoneWork  )  [protected, inherited]
 

_getUndoneWork

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 835 of file YadaRunnableDocument.tcl.

YadaRunner::_getUpdatedWordgraphNames  )  [private]
 

Returns a list of selected wordgraphs that are not in the xml document in their most recent state and have to be loaded from wordgraph xml file; a wordgraph is in the list, if there exists some corresponding wordgraph xml file and it is newer than the document xml file

for invisible runner objects, selected experiment has to be set by configure command Definition at line 988 of file YadaRunner.tcl.

YadaRunnableDocument::_getWordgraphs  )  [protected, inherited]
 

_getWordgraphs: get all wordgraphs of a experiments grammar

handle the case that only the 'data model' of the document is being used

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 764 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_getXMLFileName TclString  wordgraph  )  [protected, inherited]
 

Returns wordgraph file name for selected experiment.

Definition at line 1845 of file YadaRunnableDocument.tcl.

Referenced by YadaRunnableDocument::_resetDataOf().

YadaRunnableDocument::_insertData TclString  wordgraph,
TclList  args
[protected, inherited]
 

_insertData

Definition at line 977 of file YadaRunnableDocument.tcl.

YadaRunner::_isModified domNode  rootNode  )  [private]
 

Returns true, if document file is not synchronized with actual document, false otherwise

Parameters:
rootNode root domNode of document's xml file
Definition at line 1049 of file YadaRunner.tcl.

YadaRunnableDocument::_jobConsumer YadaJob  job  )  [protected, inherited]
 

_jobConsumer

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 1378 of file YadaRunnableDocument.tcl.

YadaRunner::_judgeRow TclNumber  row  )  [private]
 

_judgeRow

Definition at line 538 of file YadaRunner.tcl.

YadaRunnableDocument::_registerJob YadaJob  job  )  [protected, inherited]
 

_registerJob

Definition at line 1430 of file YadaRunnableDocument.tcl.

YadaRunner::_resetDataOf TclList  wordgraphs  )  [private]
 

_resetDataOf

Reimplemented from YadaRunnableDocument.

Definition at line 562 of file YadaRunner.tcl.

YadaRunnableDocument::_showContextMenu TclNumber  x,
TclNumber  y,
TclNumber  xroot,
TclNumber  yroot
[protected, inherited]
 

_showContextMenu

Definition at line 1538 of file YadaRunnableDocument.tcl.

YadaRunner::_showStatistics  )  [private]
 

_showStatistics

Definition at line 497 of file YadaRunner.tcl.

YadaRunner::_toHtml  )  [private]
 

toHtml

Definition at line 837 of file YadaRunner.tcl.

YadaRunnableDocument::_traceProcess  )  [protected, inherited]
 

_traceProcess

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 1655 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_unregisterJob YadaJob  job  )  [protected, inherited]
 

_unregisterJob

Definition at line 1438 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_viewLogfile TclList  experiments = ""  )  [protected, inherited]
 

display logfile of a experiment. This method reads the logfiles of one or more experiments given a selected wordgraph in _selectedContextWordgraph.

Parameters:
experiments the optional list of experiments that we want to display. if the list is empty the we fetch the currently selected experiments via _getSelectedExperiment().
Definition at line 1554 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::_viewXmlfile TclList  experiments = ""  )  [protected, inherited]
 

_viewXmlfile

Definition at line 1597 of file YadaRunnableDocument.tcl.

YadaRunner::activationHandle  )  [virtual]
 

activationHandle

Reimplemented from YadaDocument.

Definition at line 306 of file YadaRunner.tcl.

YadaDocument::askNewLoad  )  [protected, inherited]
 

Pops up a yes/no message dialog and returns the result (i.e. which button has been pressed) Definition at line 330 of file YadaDocument.tcl.

YadaRunnableDocument::askRunall  )  [inherited]
 

askRunall

Definition at line 1456 of file YadaRunnableDocument.tcl.

YadaDocument::backward  )  [inherited]
 

backward

Definition at line 236 of file YadaDocument.tcl.

References YadaDocument::forward().

YadaRunnableDocument::breakJob  )  [inherited]
 

breakJob

Definition at line 493 of file YadaRunnableDocument.tcl.

References printMessage().

YadaRunner::clear  ) 
 

clear

Reimplemented from YadaRunnableDocument.

Definition at line 342 of file YadaRunner.tcl.

YadaPlainDocument::deActivationHandle  )  [virtual, inherited]
 

deActivationHandle

Reimplemented in YadaConfig.

Definition at line 91 of file YadaPlainDocument.tcl.

References YadaPlainDocument::init().

Referenced by YadaPlainDocument::activationHandle().

YadaRunner::displayTitle  ) 
 

Update toolbar, menubar and titlebar.

Do not display, if runner document invisible

Reimplemented from YadaPlainDocument.

Definition at line 942 of file YadaRunner.tcl.

YadaDocument::forward  )  [inherited]
 

forward

Definition at line 243 of file YadaDocument.tcl.

References YadaDocument::prevDocument.

Referenced by YadaDocument::backward().

YadaRunner::fromDOM domNode  rootNode  ) 
 

Initialize Object with DOM node (that has saved the object state)

Parameters:
rootNode root DOM-Node (Tag <yada>)

handles case, when no XML file is available

list of wordgraph names that must not be loaded from xml document file

if there is no selection, all wordgraphs are active

if wordgraph is marked and not in the document file, try to load it from separate wordgraph file

list of marked wordgraphs, that are not saved in the DOM node ;

determine wordgraphs that can be loaded from a file

list of wordgraphs, that are not in the DOM node, but there exists some alternative wordgraph XML file to load from;

try to load active wordgraphs from <wordgraph-id>.xml.gz<p>

only load wordgraphs from the document file, if there is no updated wordgraph xml file and if it is also active

Do not load from document file if it is not active

load updated wordgraph xml files instead of corresponding document file's entries

if only a subset of wordgraphs has been loaded from the document file, you need to recompute statistics

use saved statistics from document

Reimplemented from YadaPlainDocument.

Definition at line 658 of file YadaRunner.tcl.

YadaRunner::getPersistanceFileName  ) 
 

Gets unique file name from YadaMain application object to save object state.

may fail, if gui is not fully initialized

Reimplemented from YadaPlainDocument.

Definition at line 929 of file YadaRunner.tcl.

YadaRunner::getTotalLabelRecall  ) 
 

Returns value of private attribute.

Definition at line 1132 of file YadaRunner.tcl.

YadaRunner::getTotalLexRecall  ) 
 

Returns value of private attribute.

Definition at line 1140 of file YadaRunner.tcl.

YadaRunner::getTotalScore  ) 
 

Returns value of private attribute.

Definition at line 1147 of file YadaRunner.tcl.

YadaRunner::getTotalSoftTime  ) 
 

Returns value of private attribute.

Definition at line 1117 of file YadaRunner.tcl.

YadaRunner::getTotalSolTime  ) 
 

Returns value of private attribute.

Definition at line 1110 of file YadaRunner.tcl.

YadaRunner::getTotalStructRecall  ) 
 

Returns value of private attribute.

Definition at line 1124 of file YadaRunner.tcl.

YadaRunner::getTotalTime  ) 
 

accessor methods

Definition at line 1103 of file YadaRunner.tcl.

YadaPlainDocument::hasSavedState  )  [inherited]
 

Predicate returning 1, if file containing persistant state of YadaGrammar exists, otherwise 0 Definition at line 192 of file YadaPlainDocument.tcl.

Referenced by YadaPlainDocument::resetModified().

YadaRunnableDocument::init  )  [virtual, inherited]
 

init

Reimplemented from YadaPlainDocument.

Definition at line 689 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::interruptJobs  )  [inherited]
 

interruptJobs

Definition at line 519 of file YadaRunnableDocument.tcl.

YadaPlainDocument::isModified  )  [inherited]
 

Predicate returning 1, if configuration data has changed, 0 otherwise.

Definition at line 168 of file YadaPlainDocument.tcl.

References YadaPlainDocument::setModified().

YadaRunnableDocument::killJob  )  [inherited]
 

killJob

Definition at line 551 of file YadaRunnableDocument.tcl.

YadaPlainDocument::lastChanged  )  [inherited]
 

Returns time of last update to document XML file or an empty string, if there is no such file Definition at line 219 of file YadaPlainDocument.tcl.

YadaRunner::load  ) 
 

Overridden to handle missing file to load from.

save change date of document file, may be overridden in method fromDOM, if it loads more recent data from other files

Modified state may be changed by overridden fromDOM methods

Reimplemented from YadaPlainDocument.

Definition at line 1154 of file YadaRunner.tcl.

References setBusy().

YadaRunnableDocument::loadUpdatedWordgraphs TclList  args  )  [protected, inherited]
 

loadUpdatedWordgraphs

Reimplemented from YadaDocument.

Definition at line 903 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::markWordgraph TclString  wordgraph  )  [inherited]
 

markWordgraph

Definition at line 863 of file YadaRunnableDocument.tcl.

YadaDocument::newDocument TclString  className,
TclString  name
[static, inherited]
 

newDocument

Definition at line 319 of file YadaDocument.tcl.

YadaRunnableDocument::print TclString  message  )  [inherited]
 

print

Definition at line 895 of file YadaRunnableDocument.tcl.

YadaRunner::reload  ) 
 

Override base class implementation.

Reimplemented from YadaRunnableDocument.

Definition at line 1096 of file YadaRunner.tcl.

YadaPlainDocument::resetModified  )  [inherited]
 

Removes modification mark.

Definition at line 183 of file YadaPlainDocument.tcl.

References YadaPlainDocument::hasSavedState().

Referenced by YadaPlainDocument::setModified().

YadaRunnableDocument::resortRows  )  [inherited]
 

resortRows

Definition at line 999 of file YadaRunnableDocument.tcl.

References YadaRunnableDocument::sortRows().

YadaRunnableDocument::run YadaExperiment  experiment = ""  )  [inherited]
 

run

Definition at line 1206 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::runall  )  [inherited]
 

runall

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 1260 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::save  )  [inherited]
 

Overridden method.

Reimplemented from YadaPlainDocument.

Definition at line 1858 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::selectExperiment TclString  experimentName = ""  )  [inherited]
 

selectExperiment

Set initial modification time to react to concurrent file changes Definition at line 1502 of file YadaRunnableDocument.tcl.

YadaPlainDocument::setModified  )  [inherited]
 

Marks item as modified.

Definition at line 175 of file YadaPlainDocument.tcl.

References YadaPlainDocument::resetModified().

Referenced by YadaPlainDocument::isModified().

YadaRunnableDocument::setToggle TclString  name,
TclRef  value = ""
[inherited]
 

setToggle

Reimplemented from YadaDocument.

Definition at line 1770 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::sortRows TclNumber  colNo,
TclList  args
[inherited]
 

sortRows

Reimplemented in YadaGlsStats.

Definition at line 1008 of file YadaRunnableDocument.tcl.

Referenced by YadaRunnableDocument::resortRows().

YadaRunnableDocument::step TclString  wordgraph = ""  )  [inherited]
 

step

Reimplemented in YadaOneOnOne, and YadaDifference.

Definition at line 1149 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::termJob  )  [inherited]
 

termJob

Definition at line 535 of file YadaRunnableDocument.tcl.

YadaRunner::toDOM  ) 
 

Serializes Object into a DOM-XML-Node

Returns:
root DOM node representing the Grammar-Object (root tag <yada>)

Reimplemented from YadaPlainDocument.

Definition at line 578 of file YadaRunner.tcl.

YadaRunnableDocument::unbreakJob  )  [inherited]
 

unbreakJob

Definition at line 633 of file YadaRunnableDocument.tcl.

YadaRunnableDocument::unmarkWordgraph TclString  wordgraph  )  [inherited]
 

unmarkWordgraph

Definition at line 850 of file YadaRunnableDocument.tcl.

YadaPlainDocument::updateModificationTime  )  [protected, inherited]
 

Synchronizes internal modification attribute with modification time of document's XML file Definition at line 234 of file YadaPlainDocument.tcl.


Member Data Documentation

TclArray YadaRunnableDocument::_analyseResult [protected, inherited]
 

results of _analyseDocument(). This variable is modified by _analyseDocument() in a sideeffect. Outside this method we only read _analyseResult. The filled values are:

  • wordgraph: the name of the wordgraph in the DomDocument
  • noValues: the number of levelvalues in a computed constraintnet
  • score: the score of a found parse
  • totalTime: the total amount of time needed to terminate the solution method
  • solutionTime: the time to find the parse
  • softTime: the time to find the first parse without any hard violations
  • tries: the number of tried items in the solution parse
  • structHits: the number of structural correct items in the solution parse
  • labelledHits: the number of structural correct and correctly labelled items
  • lexicalHits: the number of structural, labelled and lexically correct items
  • strictHits: the number of identical dependency edges
Definition at line 52 of file YadaRunnableDocument.tcl.

TclArray YadaRunnableDocument::_doneWordgraph [protected, inherited]
 

hash mapping wordgraph ids to 0 or 1. This indicates whether a wordgraph has been computed or not. Definition at line 60 of file YadaRunnableDocument.tcl.

TclNumber YadaRunnableDocument::_gotBreak = 0 [protected, inherited]
 

flag to indicate a received break signal

Definition at line 32 of file YadaRunnableDocument.tcl.

TclNumber YadaPlainDocument::_isInitialized = 0 [protected, inherited]
 

flag indicating initialization. Possible falues are 0 and 1. init() sets this to 1 when it is called in the init chain calls of inheriting classes, i.e. YadaConfigDocument::init() or YadaRunnableDocument::init(). Definition at line 36 of file YadaPlainDocument.tcl.

TclNumber YadaRunnableDocument::_isRunning = 0 [protected, inherited]
 

flag to indicate that the document is currently busy

Definition at line 35 of file YadaRunnableDocument.tcl.

TclNumber YadaPlainDocument::_lastModificationTime = 0 [protected, inherited]
 

Denotes time of most recent modification of document's XML file CAUSED by this object. This allows recognizing cases where a second object modifies the same file concurrently, in which case the need may arise to synchronize the object with the new file contents. Definition at line 44 of file YadaPlainDocument.tcl.

TclString YadaRunnableDocument::_selectedContextWordgraph = "" [protected, inherited]
 

the wordgraph selected by a right mouse click on the table.

Definition at line 56 of file YadaRunnableDocument.tcl.

TclString YadaPlainDocument::hasView = "true" [inherited]
 

flag indicating whether this object functions as combined model-view object (value "true"), or as a pure model object (value "false": has to be set explicitly when instantiating object) Definition at line 29 of file YadaPlainDocument.tcl.

TclString YadaPlainDocument::name = "" [inherited]
 

name of the document

Definition at line 25 of file YadaPlainDocument.tcl.

YadaDocument::nextDocument [inherited]
 

link to the next YadaDocument registered to YadaMain

Definition at line 265 of file YadaDocument.tcl.

YadaDocument::prevDocument [inherited]
 

link to the previous YadaDocument registered to YadaMain

Definition at line 250 of file YadaDocument.tcl.

Referenced by YadaDocument::forward().

TclString YadaRunnableDocument::selectedExperiment = "" [inherited]
 

Needed for instantiations without view.

Definition at line 28 of file YadaRunnableDocument.tcl.


The documentation for this class was generated from the following file:
YADA 2.0-alpha (20 Oct 2004)