Example #1
0
 public ParameterCommand(Parameter parameter, Reaction parentReaction, Model.SBML.Model model)
 {
     this.parameter = parameter;
     this.parentReaction = parentReaction;
     this.model = model;
 }
Example #2
0
        public void ParameterElement(Hashtable attrs)
        {
            Parameter parameter = new Parameter(attrs);
            if (parameter.ID != null)
            {
                this.model.AddId(parameter.ID, parameter);
            }

            double value = 1d;
            String units = null;
            Boolean constant = true;

            if (attrs.ContainsKey("value"))
                value = Double.Parse((String)attrs["value"]);
            if (attrs.ContainsKey("units"))
                units = (String)attrs["units"];
            if (attrs.ContainsKey("constant"))
                constant = Boolean.Parse((String)attrs["constant"]);

            parameter.AddProperties(value, units, constant);

            if (elementStack.Count == 0)
            // from top-level element <listOfParameters> under <model>
            {
                this.model.listOfParameters.Add(parameter);
            }
            else
            // from <listOfParameters> under <kineticLaw> under <reaction>
            {
                KineticLaw kineticLaw = (KineticLaw)elementStack.Peek();
                kineticLaw.listOfParameters.Add(parameter);
            }
        }