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


Java ASTNode.getChildren方法代码示例

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


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

示例1: alterNode

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
/**
 * replaces ROWX_COLY with ROWA_COLB in a kinetic law this has to be done
 * without re-parsing the formula string because the row/col values can be
 * negative, which gets parsed incorrectly
 * 
 * @param node
 * @param oldString
 * @param newString
 */
private void alterNode(ASTNode node, String oldString, String newString)
{

	if (node.isName() && node.getName().contains(oldString))
	{
		node.setVariable(model.getSpecies(newString + "__" + node.getName().split("__")[1]));
	}
	else
	{
		for (ASTNode childNode : node.getChildren())
		{
			alterNode(childNode, oldString, newString);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:25,代码来源:Simulator.java

示例2: alterLocalParameter

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
/**
 * replaceArgument() doesn't work when you're replacing a localParameter, so
 * this does that -- finds the oldString within node and replaces it with
 * the local parameter specified by newString
 * 
 * @param node
 * @param reactionID
 * @param oldString
 * @param newString
 */
private void alterLocalParameter(ASTNode node, Reaction reaction, String oldString, String newString)
{

	// String reactionID = reaction.getId();
	if (node.isName() && node.getName().equals(oldString))
	{
		node.setVariable(reaction.getKineticLaw().getLocalParameter(newString));
	}
	else
	{
		for (ASTNode childNode : node.getChildren())
		{
			alterLocalParameter(childNode, reaction, oldString, newString);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:27,代码来源:Simulator.java

示例3: getAllASTNodeChildren

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
/**
 * recursively puts every astnode child into the arraylist passed in
 * 
 * @param node
 * @param nodeChildrenList
 */
protected void getAllASTNodeChildren(ASTNode node, ArrayList<ASTNode> nodeChildrenList)
{

	for (ASTNode child : node.getChildren())
	{

		if (child.getChildCount() == 0)
		{
			nodeChildrenList.add(child);
		}
		else
		{
			nodeChildrenList.add(child);
			getAllASTNodeChildren(child, nodeChildrenList);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:24,代码来源:Simulator.java

示例4: getSatisfyingNodes

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
/**
 * recursively puts the nodes that have the same name as the quarry string
 * passed in into the arraylist passed in so, the entire tree is searched
 * through, which i don't think is possible with the jsbml methods
 * 
 * @param node
 *            node to search through
 * @param quarry
 *            string to search for
 * @param satisfyingNodes
 *            list of nodes that satisfy the condition
 */
static void getSatisfyingNodes(ASTNode node, String quarry, ArrayList<ASTNode> satisfyingNodes)
{

	if (node.isName() && node.getName().equals(quarry))
	{
		satisfyingNodes.add(node);
	}
	else if (node.isFunction() && node.getName().equals(quarry))
	{
		satisfyingNodes.add(node);
	}
	else
	{
		for (ASTNode childNode : node.getChildren())
		{
			getSatisfyingNodes(childNode, quarry, satisfyingNodes);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:32,代码来源:Simulator.java

示例5: getSatisfyingNodesLax

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
/**
 * recursively puts the nodes that have the same name as the quarry string
 * passed in into the arraylist passed in so, the entire tree is searched
 * through, which i don't think is possible with the jsbml methods the lax
 * version uses contains instead of equals
 * 
 * @param node
 *            node to search through
 * @param quarry
 *            string to search for
 * @param satisfyingNodes
 *            list of nodes that satisfy the condition
 */
void getSatisfyingNodesLax(ASTNode node, String quarry, ArrayList<ASTNode> satisfyingNodes)
{

	if (node.isName() && node.getName().contains(quarry))
	{
		satisfyingNodes.add(node);
	}
	else if (node.isFunction() && node.getName().contains(quarry))
	{
		satisfyingNodes.add(node);
	}
	else
	{
		for (ASTNode childNode : node.getChildren())
		{
			getSatisfyingNodesLax(childNode, quarry, satisfyingNodes);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:33,代码来源:Simulator.java

示例6: prependToVariableNodes

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
/**
 * recursively finds all variable nodes and prepends a string to the
 * variable static version
 * 
 * @param node
 * @param toPrepend
 */
private static void prependToVariableNodes(ASTNode node, String toPrepend, Model model)
{

	if (node.isName())
	{

		// only prepend to species and parameters
		if (model.getSpecies(toPrepend + node.getName()) != null)
		{
			node.setVariable(model.getSpecies(toPrepend + node.getName()));
		}
		else if (model.getParameter(toPrepend + node.getName()) != null)
		{
			node.setVariable(model.getParameter(toPrepend + node.getName()));
		}
	}
	else
	{
		for (ASTNode childNode : node.getChildren())
		{
			prependToVariableNodes(childNode, toPrepend, model);
		}
	}
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:32,代码来源:Simulator.java

示例7: needsRefiniment

import org.sbml.jsbml.ASTNode; //导入方法依赖的package包/类
private static boolean needsRefiniment(ASTNode node)
{

	for (ASTNode child : node.getChildren())
	{
		if (!child.isLeaf())
		{
			return true;
		}
	}
	return false;
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:13,代码来源:RateSplitterInterpreter.java


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