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


C# Product.setQuantityFactor方法代码示例

本文整理汇总了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;
    }
开发者ID:quito,项目名称:DSynBio_reloaded,代码行数:35,代码来源:Device.cs

示例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;
    }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:14,代码来源:PromoterLoader.cs

示例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;
 }
开发者ID:CyberCRI,项目名称:DsynBio,代码行数:21,代码来源:InstantReactionLoader.cs

示例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;
  }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:48,代码来源:Device.cs

示例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;
   }
开发者ID:CyberCRI,项目名称:Hero.Coli,代码行数:34,代码来源:InstantReaction.cs


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