<?php $isip_window_title = "ISIP Homepage"; ?>
<?php include("/data/isip/www/templates/documentation/header/header.html"); ?>

<!--#set var="isip_page_title" value="DecisionTreeBase" -->
<?php include("/data/isip/www/templates/documentation/body/index_class.html"); ?>
<?php include("/data/isip/www/templates/documentation/body/bar.html"); ?>

<a name="name">
<b>name: <a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h"> DecisionTreeBase &lt;TObject&gt; </a>: public <a 
href="../../dstr/BiGraph">BiGraph&lt;TObject&gt; </a></b>

<br><br>

<a name="synopsis">
<b>synopsis:</b>
<br><br>

<blockquote>
<pre>
This class is never used directly. It is inherited by all DecisionTree
classes.  Users will mainly interact with it indirectly by using some of
the enumerations included in the class definition, and its protected
data, which plays an important part in the control structure for all
DecisionTree classes.
</pre>
</blockquote>

<a name="quick_start">
<b>quick start:</b>
<br><br>

<blockquote>
<pre>
PhoneticDecisionTree pdt;
pdt.setStopMode(DecisionTreeBase::DEPTH);
pdt.setDepth(3);
</pre>
</blockquote>

<a name="description"> 
<b>description:</b>
<br><br>

The DecisionTreeBase class is inherited by all DecisionTree classes,
and contains some information (data and methods) expected to be common
to all such classes.  For example, variables that hold debugging
information, stop-mode, run-mode and depth are stored in
DecisionTreeBase.

<br><br>

However, this information is never accessed by instantiating an
DecisionTreeBase object directly. Rather, this information is accessed
via the inherited class. A typical case is shown in the quick start
example above. PhoneticDecisiontree is an DecisionTree class
that inherits DecisionTreeBase. The set methods invoked above
are available through inheritance. The data members that store
this information are contained in DecisionTreeBase.

<br><br>

<a name="dependencies">
<b>dependencies:</b>
<br><br>

<ul>
  <li> <a href="../../dstr/BiGraph/index.html">BiGraph</a>
  <li> <a href="../../shell/Filename/index.html">Filename</a>
  <li> <a href="../../shell/DebugLevel/index.html">DebugLevel</a>
</ul>

<a name="constants">
<b>public constants:</b>

<ul>
  <li> define the class name:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&constant=CLASS_NAME">static const String CLASS_NAME = L"DecisionTreeBase";</a></pre>

  <li> define an enumeration for all possible stopping rules for splitting:
  
       <pre>enum STOPMODE { PURE = 0, THRESH, DEPTH, DEF_STOPMODE = PURE };</pre>

  <li> define an enumeration for run mode
       
       <pre>enum RUNMODE { TRAIN = 0, TEST, DEF_RUNMODE = TRAIN };</pre>

  <li> define static NameMap objects:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&constant=STOPMODE_MAP">static const NameMap STOPMODE_MAP = L"PURE = 0, THRESH, DEPTH, DEF_STOPMODE = PURE";</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&constant=RUNMODE_MAP">static const NameMap RUNMODE_MAP = L"TRAIN = 0, TEST, DEF_RUNMODE = TRAIN";</a></pre>
       
   <li> define i/o related variables:

	<pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&constant=PARAM_DBGL">const String DecisionTreeBase::PARAM_DBGL(L"debug_level");</a></pre>
	<pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&constant=PARAM_STOPMODE">const String DecisionTreeBase::PARAM_STOPMODE(L"stopmode");</a></pre>
	<pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&constant=PARAM_RUNMODE">const String DecisionTreeBase::PARAM_RUNMODE(L"runmode");</a></pre>

  <li> define the default values and arguments: these are some useful
       constants common to all decision-trees

       <pre>static const long DEF_DEPTH = 0;</pre>
       
</ul>
       
<a name="error">       
<b>error codes:</b>
<br><br>

<ul>
  <li> error codes:

       <pre><a href="/perl/ifc_document.pl?err=00100200">static const long ERR = 00100200;</a></pre>
</ul>

<a name="protected">
<b>protected data:</b>
<br><br>

<ul>

  <li> data structure declarations:
  
  <pre>typedef Pair&lt;String, SingleLinkedList&lt;String&gt; &gt; Attribute;</pre>
  <pre>typedef SingleLinkedList&lt;Attribute&gt; Attributes;</pre>

   <li> stopmode type:

	<pre>STOPMODE stopmode_d;</pre>
  
   <li> runmode type:

	<pre>RUNMODE runmode_d;</pre>       
       
  <li> define parameters that are not part of the i/o for the class:

       <pre>long depth_d;</pre>

  <li> debugging parameters:

       <pre>DebugLevel debug_level_d;</pre>
</ul>

<a name="public">
<b>required public methods:</b>
<br><br>

<ul>
  <li> static methods: diagnose method is moved outside the class
       header file and defined in the DecisionTreeBaseDiagnose.h in order 
       to avoid issues related to preprocessing of the diagnose code

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=name">static const SysString& name();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBaseDiagnose.h&method=diagnose">static boolean diagnose(Integral::DEBUG debug_level);</a></pre>
       
  <li> debug methods: note that setDebug method is not virtual since it 
       operates on protected data found in this class. 

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=setDebug">boolean setDebug(Integral::DEBUG level);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=debug">boolean debug(const unichar* message) const;</a></pre>

  <li> destructor/constructor(s):

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=destructor">~DecisionTreeBase();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=default+constructor">DecisionTreeBase();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=copy+constructor">DecisionTreeBase(const DecisionTreeBase& arg);</a></pre>

  <li> assign methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=assign">virtual boolean assign(const DecisionTreeBase& arg);</a></pre>

  <li> i/o methods:

       <pre>virtual long sofSize() const = 0;</pre>
       <pre>virtual boolean read(Sof& sof, long tag, const String& name) = 0;</pre>
       <pre>virtual boolean write(Sof& sof, long tag, const String& name) const = 0;</pre>
       <pre>virtual boolean readData(Sof& sof, const String& pname, long size, boolean param, boolean nested) = 0;</pre>
       <pre>virtual boolean writeData(Sof& sof, const String& pname) const = 0;</pre>

  <li> equality methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=eq&instance=1">virtual boolean eq(const DecisionTreeBase& arg) const;</a></pre>
    
  <li> memory management methods: new and delete methods are omitted
       since only the derived classes will be used

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=clear">virtual boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);</a></pre>
</ul>

<a name="specific">
<b>class-specific public methods:</b>
<br><br>

<ul>
  <li> set methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=setStopMode">virtual boolean setStopMode(STOPMODE stopmode);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=setRunMode">virtual boolean setRunMode(RUNMODE runmode);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=setDepth">virtual boolean setDepth(long& depth);</a></pre>
       
  <li> get methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=getStopMode">STOPMODE getStopMode() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=getRunMode">RUNMODE getRunMode() const;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=getDepth">long getDepth();</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=getLeafNodes&instance=1">boolean getLeafNodes(BiGraphVertex&lt;TObject&gt;& node, SingleLinkedList&lt;BiGraphVertex&lt;TObject&gt; &gt;& leaf_nodes);</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=getAllLeafNodes&instance=1">boolean getAllLeafNodes(BiGraphVertex&lt;TObject&gt;& node, SingleLinkedList&lt;BiGraphVertex&lt;TObject&gt; &gt;& leaf_nodes);</a></pre>

  <li> DecisionTreeBase interface contract methods:

       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=runDecisionTree">virtual boolean runDecisionTree() = 0;</a></pre>
       <pre><a href="/perl/ifc_document.pl?file=$isip/class/pr/DecisionTreeBase/DecisionTreeBase.h&method=setParser">virtual boolean setParser(SofParser* parser);</a></pre>
</ul>

<a name="private">
<b>private methods:</b>

<ul>       
  <li> none.
</ul>

<a name="examples">
<b>examples:</b>
<br><br>

<ul>
  <li> Since this class is never called directly, there are no examples.
</ul>
       
<a name="notes">
<b>notes:</b>

<ul>
  <li> DecisionTreeBase is used by all Decision-Tree classes such as
  PhoneticDecisionTree etc.

       <br><br>       
</ul>

<!--#include virtual="/hse/ies/templates/documentation/footer/footer.html" -->
