package affectors; import main.Node; import main.Globals; /** Generalized rate-based conversion of one Node to another. Use this version in reactant node, use the "I" version in the product 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
dREACTANT/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
&REACTANT

&ConversionEAff REACTANT PRODUCT r_REACTANT
&endREACTANT

@see ConversionIAff */ public class ConversionEAff extends Affector { /** Rate of conversion, expressed as a first-order rate constant. */ int rateParam; static final String desc = "Generalized conversion; version E for the Node that gets taken away from"; static final String [] nodeDescriptions = {"Reactant", "Product"}; static final String [] paramDescriptions = {"Rate of conversion"}; static final int [] whichSides = { -1, -1 }; public ConversionEAff() {} protected void setLabelsAndTypes() { setDescriptions(this.desc, nodeDescriptions, paramDescriptions); setSided(true, whichSides); setContainsTarget(true); this.Type[GUI_CAPABLE] = 1; this.Type[CERTIFICATION] = Affector.RETURNS_DERIV; this.Type[MATHTYPE] = Affector.HH; 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)); } public float getNCValue(Node which_node) { return -Globals.characteristicTime * (params[rateParam]); } }