本文整理汇总了C#中Product.setQuantityFactor方法的典型用法代码示例。如果您正苦于以下问题:C# Product.setQuantityFactor方法的具体用法?C# Product.setQuantityFactor怎么用?C# Product.setQuantityFactor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Product
的用法示例。
在下文中一共展示了Product.setQuantityFactor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getProductsFromBiobricks
public LinkedList<Product> getProductsFromBiobricks(LinkedList<BioBrick> list)
{
LinkedList<Product> products = new LinkedList<Product>();
Product prod;
RBSBrick rbs;
GeneBrick gene;
float RBSf = 0f;
string molName = "Unknown";
int i = 0;
foreach (BioBrick b in list)
{
rbs = b as RBSBrick;
if (rbs != null)
RBSf = rbs.getRBSFactor();
else
{
gene = b as GeneBrick;
if (gene != null)
{
molName = gene.getProteinName();
prod = new Product();
prod.setName(molName);
prod.setQuantityFactor(RBSf);
products.AddLast(prod);
}
else
Debug.Log("This case should never arrive. Bad Biobrick in operon.");
}
i++;
}
while (i > 0)
list.RemoveFirst();
return products;
}
示例2: loadGene
private bool loadGene(Promoter prom, string name, string RBSf)
{
Product gene = new Product();
if (String.IsNullOrEmpty(name) || String.IsNullOrEmpty(RBSf))
{
Debug.Log("Error: Empty Gene name field");
return false;
}
gene.setName(name);
gene.setQuantityFactor(float.Parse(RBSf.Replace(",", ".")));
prom.addProduct(gene);
return true;
}
示例3: loadInstantReactionReactant
private bool loadInstantReactionReactant(XmlNode node, InstantReaction ir)
{
Product prod = new Product();
foreach (XmlNode attr in node)
{
if (attr.Name == "name")
{
if (String.IsNullOrEmpty(attr.InnerText))
Debug.Log("Warning : Empty name field in instant reaction reactant definition");
prod.setName(attr.InnerText);
}
else if (attr.Name == "quantity")
{
if (String.IsNullOrEmpty(attr.InnerText))
Debug.Log("Warning : Empty quantity field in instant reaction reactant definition");
prod.setQuantityFactor(float.Parse(attr.InnerText.Replace(",", ".")));
}
}
ir.addReactant(prod);
return true;
}
示例4: getProductsFromBiobricks
private LinkedList<Product> getProductsFromBiobricks(LinkedList<BioBrick> list)
{
Logger.Log("Device::getProductsFromBioBricks([list: "+Logger.ToString(list)+"])", Logger.Level.DEBUG);
LinkedList<Product> products = new LinkedList<Product>();
Product prod;
RBSBrick rbs;
GeneBrick gene;
float RBSf = 0f;
string molName = "Unknown";
int i = 0;
foreach (BioBrick b in list)
{
Logger.Log("Device::getProductsFromBioBricks: starting treatment of "+b.ToString(), Logger.Level.TRACE);
rbs = b as RBSBrick;
if (rbs != null) {
Logger.Log("Device::getProductsFromBioBricks: rbs spotted", Logger.Level.TRACE);
RBSf = rbs.getRBSFactor();
}
else
{
Logger.Log("Device::getProductsFromBioBricks: not an rbs", Logger.Level.TRACE);
gene = b as GeneBrick;
if (gene != null)
{
molName = gene.getProteinName();
prod = new Product();
prod.setName(molName);
prod.setQuantityFactor(RBSf);
products.AddLast(prod);
}
else
{
if (b as TerminatorBrick == null)
Logger.Log("Device::getProductsFromBioBricks This case should never happen. Bad Biobrick in operon.", Logger.Level.WARN);
else {
break;
}
}
}
i++;
}
while (i > 0) {
list.RemoveFirst();
i--;
}
return products;
}
示例5: loadInstantReactionProduct
/*!
\brief Parse and load products of an InstantReaction
\param node The xml node to parse
\return return always true
*/
private bool loadInstantReactionProduct(XmlNode node)
{
Product prod = new Product();
foreach (XmlNode attr in node)
{
if (attr.Name == "name")
{
if (String.IsNullOrEmpty(attr.InnerText))
{
Logger.Log("InstantReaction::loadInstantReactionProduct Empty name field in instant reaction product definition"
, Logger.Level.ERROR);
return false;
}
prod.setName(attr.InnerText);
}
else if (attr.Name == "quantity")
{
if (String.IsNullOrEmpty(attr.InnerText))
{
Logger.Log("InstantReaction::loadInstantReactionProduct Empty quantity field in instant reaction product definition"
, Logger.Level.ERROR);
return false;
}
prod.setQuantityFactor(float.Parse(attr.InnerText.Replace(",", ".")));
}
}
addProduct(prod);
return true;
}