当前位置: 首页>>代码示例>>C#>>正文


C# TreeNode.getLeftNode方法代码示例

本文整理汇总了C#中TreeNode.getLeftNode方法的典型用法代码示例。如果您正苦于以下问题:C# TreeNode.getLeftNode方法的具体用法?C# TreeNode.getLeftNode怎么用?C# TreeNode.getLeftNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeNode的用法示例。


在下文中一共展示了TreeNode.getLeftNode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: dot

 /*!
 \brief This function pretty print the tree for debugging.
 \details The synthax of this pretty print function can be given to dot (graphiz)
 \param node The root of the tree
 \param str The string where to append the text
    */
 public void PPRecTree(TreeNode<PromoterNodeData> node, ref string str)
 {
     if (node != null)
       {
     if (node.getLeftNode() != null)
       {
         str += "\"" + node.getData().value + "\"" + "->" + "\"" +node.getLeftNode().getData().value + "\"\n";
         PPRecTree(node.getLeftNode(), ref str);
       }
     if (node.getRightNode() != null)
       {
         str += "\"" + node.getData().value + "\"" + "->" + "\"" + node.getRightNode().getData().value + "\"\n";
         PPRecTree(node.getRightNode(), ref str);
       }
       }
 }
开发者ID:quito,项目名称:DSynBio_reloaded,代码行数:22,代码来源:Parser.cs

示例2: execConstant

    //   FIXME : Check all possible issues like product or molecule not exists;
    /*!
    Execute a Node of type : Constant
    \param node The node of the tree to execute
    \param molecules The list of molecules
    \return The result of the hill function.
      */
    private float execConstant(TreeNode<PromoterNodeData> node, ArrayList molecules)
    {
        if (node == null)
          return 0f;

        if (node.getRightNode().getData().token == PromoterParser.eNodeType.BOOL)
          return execBool(node.getRightNode());
        Molecule mol = execWord(node.getRightNode(), molecules);
        float K = execNum(node.getLeftNode(), molecules);
        float n = 1f;
        if (node.getLeftNode() != null && node.getLeftNode().getLeftNode() != null)
          n = execNum(node.getLeftNode().getLeftNode(), molecules);
        //     Debug.Log("concentration de " + mol.getName() + " = " + mol.getConcentration());
        //     return stepFunc(K, mol.getConcentration());
        //     if (mol.getName() == "Y")
        //       Debug.Log("hill : " + hillFunc(K, mol.getConcentration(), 4));
        //     else
        //       Debug.Log(mol.getName());
        //     return stepFunc(K, mol.getConcentration());
        return hillFunc(K, mol.getConcentration(), n);
    }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:28,代码来源:Promoter.cs

示例3: execNode

 /*!
 Execute a Node.
 \param node The node of the tree to execute
 \param molecules The list of molecules
 \return The result of the function
   */
 private float execNode(TreeNode<PromoterNodeData> node, ArrayList molecules)
 {
     if (node != null)
       {
     if (node.getData().token == PromoterParser.eNodeType.OR)
       return Math.Max(execNode(node.getLeftNode(), molecules), execNode(node.getRightNode(), molecules));
     else if (node.getData().token == PromoterParser.eNodeType.AND)
       return Math.Min(execNode(node.getLeftNode(), molecules), execNode(node.getRightNode(), molecules));
     else if (node.getData().token == PromoterParser.eNodeType.NOT)
       return 1f - execNode(node.getLeftNode(), molecules);
     else if (node.getData().token == PromoterParser.eNodeType.CONSTANT)
       return execConstant(node, molecules);
     else if (node.getData().token == PromoterParser.eNodeType.BOOL)
       return execBool(node);
     else if (node.getData().token == PromoterParser.eNodeType.WORD)
       {
         Molecule mol = ReactionEngine.getMoleculeFromName(node.getData().value, molecules);
         if (mol != null)
           return mol.getConcentration();
       }
     else if (node.getData().token == PromoterParser.eNodeType.NUM)
       return float.Parse(node.getData().value.Replace(",", "."));
       }
     return 1.0f;
 }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:31,代码来源:Promoter.cs


注:本文中的TreeNode.getLeftNode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。