public FormulaParser(Reader.SBMLReader reader, String formula, Model model) { this.formula = formula; this.reader = reader; this.model = model; model.InterrogateModelForMissingIDs(); // Init the collection list this.formulaSpecies = new List<Species>(); this.formulaParameters = new List<Parameter>(); this.formulaUnknownEntities = new List<UnknownEntity>(); // Init the operators this.init(); this.formulaTree = this.makeFormulaTree(formula, false); }
public FormulaParser(Reader.SBMLReader reader, String formula) { this.formula = formula; this.reader = reader; // Init the collection list this.formulaSpecies = new List<Species>(); this.formulaParameters = new List<Parameter>(); this.formulaUnknownEntities = new List<UnknownEntity>(); // Init the operators this.init(); // Make the formula tree this.formulaTree = this.makeFormulaTree(formula, false); // no Model, so can't look up ID references // (mainly for testing purposes) }
/// <summary> /// Adds an SBML model from a file /// </summary> /// <param name="filePath"> /// A <see cref="System.String"/> /// </param> /// <returns> /// A <see cref="System.Boolean"/> /// </returns> public bool addSBMLModel(string filePath) { SBML.Reader.SBMLReader reader = new SBML.Reader.SBMLReader(); if (reader.Parse(filePath)) { // Add the model // sbmlModels.Add(read.model); this.sbmlModel = reader.model; return true; } else { // Else fail return false; } }
/// <summary> /// Constructor that includes an experiment and simulation reference which is used for formulas with aggregate functions /// that use references to cell definitions, groups and species /// </summary> /// <param name="reader"> /// A <see cref="Reader.SBMLReader"/> /// </param> /// <param name="formula"> /// A <see cref="String"/> /// </param> /// <param name="model"> /// A <see cref="Model"/> /// </param> /// <param name="experiment"> /// A <see cref="Experiment"/> /// </param> /// <param name="simulation"> /// A <see cref="Simulation"/> /// </param> public FormulaParser(Reader.SBMLReader reader, String formula, Model model, Experiment experiment, Simulation simulation) { this.formula = formula; this.reader = reader; model.InterrogateModelForMissingIDs(); //create model list this.models = new List<Model>(); models.Add(model); // Init the collection list this.formulaSpecies = new List<Species>(); this.formulaParameters = new List<Parameter>(); this.formulaUnknownEntities = new List<UnknownEntity>(); // Init the operators this.init(); this.experiment = experiment; this.simulation = simulation; this.formulaTree = this.makeFormulaTree(formula, true); }
/// <summary> /// Constructor that includes an experiment and simulation reference which is used for formulas with aggregate functions /// that use references to cell definitions, groups and species and also a list of all models used /// </summary> /// <param name="reader"> /// A <see cref="Reader.SBMLReader"/> /// </param> /// <param name="formula"> /// A <see cref="String"/> /// </param> /// <param name="models"> /// A <see cref="List`1"/> /// </param> /// <param name="experiment"> /// A <see cref="Experiment"/> /// </param> /// <param name="simulation"> /// A <see cref="Simulation"/> /// </param> public FormulaParser(Reader.SBMLReader reader, String formula, List<Model> models, Experiment experiment, Simulation simulation) { this.formula = formula; this.reader = reader; this.models = models; foreach (Model model in models) { model.InterrogateModelForMissingIDs(); } // Init the operators this.init(); this.experiment = experiment; this.simulation = simulation; this.formulaTree = this.makeFormulaTree(formula, true); }