ReactionEngine.getMoleculeSetFromId C# (CSharp) Method

getMoleculeSetFromId() public static method

public static getMoleculeSetFromId ( string id, LinkedList list ) : MoleculeSet
id string
list LinkedList
return MoleculeSet
  public static MoleculeSet    getMoleculeSetFromId(string id, LinkedList<MoleculeSet> list)
  {
    foreach (MoleculeSet molSet in list)
      if (molSet.getStringId() == id)
        return molSet;
    return null;
  }
	

Usage Example

コード例 #1
0
ファイル: Medium.cs プロジェクト: afaucher17/Hero.Coli
    /*!
     * \brief Initialize the Medium
     * \param reactionsSets The list of all the reactions sets
     * \param moleculesSets The list of all the molecules sets
     */
    public void Init(LinkedList <ReactionSet> reactionsSets, LinkedList <MoleculeSet> moleculesSets)
    {
        //Receive a linkedlist of Sets
        _reactions       = new LinkedList <IReaction>();
        _numberGenerator = new NumberGenerator(NumberGenerator.normale, -10f, 10f, 0.01f);

        //Try to find the good set in the LinkedList
        ReactionSet reactSet = ReactionEngine.getReactionSetFromId(_reactionsSet, reactionsSets);
        MoleculeSet molSet   = ReactionEngine.getMoleculeSetFromId(_moleculesSet, moleculesSets);

        //Put all the different molecules from the linkedList in an arrayList
        ArrayList allMolecules = ReactionEngine.getAllMoleculesFromMoleculeSets(moleculesSets);

        if (reactSet == null)
        {
            Logger.Log("Medium::Init Cannot find group of reactions named " + _reactionsSet, Logger.Level.WARN);
        }
        if (molSet == null)
        {
            Logger.Log("Medium::Init Cannot find group of molecules named" + _moleculesSet, Logger.Level.WARN);
        }

        initATPProduction();
        initReactionsFromReactionSet(reactSet);
        initMoleculesFromMoleculeSets(molSet, allMolecules);
        initDegradationReactions(allMolecules);
        foreach (IReaction r in _reactions)
        {
            r.enableSequential = _enableSequential;
        }
    }