package affectors; import main.Node; import main.Globals; /** Generalized rate-based conversion of one Node to another. Use this version in product node, use the "E" version in the reactant Node. These Affectors can be used for either intracellular or membrane-bound nodes as long as both participants reside in the same cell and compartment.
Formula
dPRODUCT/dt = REACTANT * r_REACTANT
Parameters
Reactant [REACTANT] | The Node which is being converted to something else. |
Product [PRODUCT] | The product of the conversion. |
Conversion rate [H_REACTANT_PRODUCT] | The proportion of reactant converted to product per timestep |
Usage
&PRODUCT
&ConversionIAff REACTANT PRODUCT r_REACTANT
&endPRODUCT
@see ConversionEAff */ public class ConversionIAff extends Affector { /** Rate of conversion, expressed as a first-order rate constant. */ int rateParam; static final String desc = "Generalized conversion; version I for the Node that gets added to"; static final String [] nodeDescriptions = {"Reactant", "Product"}; static final String [] paramDescriptions = {"Rate of conversion"}; static final int [] whichSides = { -1, -1 }; public ConversionIAff() {} protected void setLabelsAndTypes() { setDescriptions(this.desc, nodeDescriptions, paramDescriptions); setSided(true, whichSides); this.Type[GUI_CAPABLE] = 1; this.Type[CERTIFICATION] = Affector.RETURNS_DERIV; this.Type[MATHTYPE] = Affector.KK; this.Type[TERMTYPE] = Affector.CONVERSION; } public void setParameterNumbers(int [] param_nums) { rateParam = param_nums[0]; } public float getValue(Node which_node) { return Globals.characteristicTime * (params[rateParam]*Nodes[0].getIntegrationValue(side)); } }