package affectors; import main.Node; import main.Globals; /** This is the standard affector for decay of a Node. Use this for both intracellular extracellular nodes. Each Node should have one of these unless its concentration is supposed to stay completely fixed over time (for instance, some input that is external to the network you're modeling).

Formula
dnodex/dt = -nodex / H_nodex

Parameters
Target [nodex] The Node which is decaying
Half-life [H_nodex] The half-life of the Node.

Usage
&nodex

&DecayAff nodex H_nodex
&endnodex */ public class DecayAff extends Affector { /** The half-life of the Node in minutes. */ int halfLife; static final String desc = "First-order decay"; static final String [] nodeDescriptions = {"Target"}; static final String [] paramDescriptions = {"Half-life"}; static final int [] whichSides = { -1 }; public DecayAff() {} 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.DEGRADATION; } public void setParameterNumbers(int [] param_nums) { halfLife = param_nums[0]; } public float getValue(Node which_node) { return (Nodes[0].getIntegrationValue(side) * (-Globals.characteristicTime / params[halfLife])); } public float getNCValue(Node which_node) { return (-Globals.characteristicTime / params[halfLife]); } }