/*!
* \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;
}
}