Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5468 for trunk


Ignore:
Timestamp:
02/15/11 14:31:44 (14 years ago)
Author:
gkronber
Message:

#1315 Added support for variable condition symbol to LaTeX exporter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Formatters/SymbolicExpressionTreeLatexFormatter.cs

    r5445 r5468  
    170170        var laggedTreeNode = node as ILaggedTreeNode;
    171171        strBuilder.Append(@"\sum_{t=" + (laggedTreeNode.Lag + currentLag) + @"}^0 \left(");
     172      } else if (node.Symbol is VariableCondition) {
     173        var conditionTreeNode = node as VariableConditionTreeNode;
     174        string p = @"1 / \left( 1 + \exp \left( - c_{" + constants.Count + "} ";
     175        constants.Add(conditionTreeNode.Slope);
     176        p += @" \cdot \left(" + conditionTreeNode.VariableName + LagToString(currentLag) + " - c_{" + constants.Count + "} \right) \right) \right)";
     177        constants.Add(conditionTreeNode.Threshold);
     178        strBuilder.Append(@"\left( " + p + @"\cdot ");
    172179      } else {
    173180        throw new NotImplementedException("Export of " + node.Symbol + " is not implemented.");
     
    219226      } else if (node.Symbol is Root) {
    220227        strBuilder.Append(@"\right) ^ { \left( \cfrac{1}{ \operatorname{round} \left(");
     228      } else if (node.Symbol is VariableCondition) {
     229        var conditionTreeNode = node as VariableConditionTreeNode;
     230        string p = @"1 / \left( 1 + \exp \left( - c_{" + constants.Count + "} ";
     231        constants.Add(conditionTreeNode.Slope);
     232        p += @" \cdot \left(" + conditionTreeNode.VariableName + LagToString(currentLag) + " - c_{" + constants.Count + "} \right) \right) \right)";
     233        constants.Add(conditionTreeNode.Threshold);
     234        strBuilder.Append(@" + \left( 1 - " + p + @" \right) \cdot ");
    221235      } else {
    222236        throw new NotImplementedException("Export of " + node.Symbol + " is not implemented.");
     
    291305        var laggedTreeNode = node as ILaggedTreeNode;
    292306        strBuilder.Append(@"\right) ");
     307      } else if (node.Symbol is VariableCondition) {
     308        strBuilder.Append(@"\left) ");
    293309      } else {
    294310        throw new NotImplementedException("Export of " + node.Symbol + " is not implemented.");
Note: See TracChangeset for help on using the changeset viewer.