本文整理汇总了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);
}
}
}
示例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);
}
示例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;
}