/*! * \brief This reaction build a PromoterReaction reaction from a PromoterProperties class * \param props The PromoterProperties which will serve to create the reaction * \return Return the new reaction or null if it fail. */ public static IReaction buildPromoterFromProps(PromoterProperties props) { if (props == null) { return(null); } PromoterParser parser = new PromoterParser(); PromoterReaction reaction = new PromoterReaction(); reaction.setName(props.name); reaction.setBeta(props.beta); reaction.setTerminatorFactor(props.terminatorFactor); reaction.setEnergyCost(props.energyCost); TreeNode <PromoterNodeData> formula = parser.Parse(props.formula); reaction.setFormula(formula); Product newProd; foreach (Product p in props.products) { newProd = new Product(p); reaction.addProduct(newProd); } return(reaction); }
/*! \brief This reaction build a PromoterReaction reaction from a PromoterProperties class \param props The PromoterProperties which will serve to create the reaction \return Return the new reaction or null if it fail. */ public static IReaction buildPromoterFromProps(PromoterProperties props) { if (props == null) return null; PromoterParser parser = new PromoterParser(); PromoterReaction reaction = new PromoterReaction(); reaction.setName(props.name); reaction.setBeta(props.beta); reaction.setTerminatorFactor(props.terminatorFactor); reaction.setEnergyCost(props.energyCost); TreeNode<PromoterNodeData> formula = parser.Parse(props.formula); reaction.setFormula(formula); Product newProd; foreach (Product p in props.products) { newProd = new Product(p); reaction.addProduct(newProd); } return reaction; }