package affectors; import main.Node; import main.Globals; /** Use this for decay of a Node when the decay rate can be raised (half life lowered) by the presence of another node. Use this for both intracellular and extracellular nodes.

Formula
dnodex/dt = -nodex * (1 / [H_nodex - (H_nodex - min_life) * (DECAYER^nu / (K^nu + DECAYER^nu))])

Parameters (tr>
Target [nodex] The Node which is decaying
Inhibitor [DECAYER] The Node that increases decay.
Half-life [H_nodex] The half-life of the Node absent the decayer.
Half-max decayer [K_DECAYERnodex] The decayer concentration at which decay rate is increased by half maximum increase.
Cooperativity decayer [nu_DECAYERnodex] The non-linearity of the decayer function.
Min half-life [min_life] The minimum half life reached when decayer is at max concentration.

Usage
&nodex

&DecayRegUpAff nodex decayer H_nodex K_decayer_nodex nu_decayer_nodex min_life
&endnodex */ public class DecayRegUpAff extends Affector { /** The half-life of the Node in minutes. */ int halfLife, kParam, nuParam, minHalfLifeParam; static final String desc = "First-order decay with up-regulation"; static final String [] nodeDescriptions = {"Target", "Inhibitor"}; static final String [] paramDescriptions = {"Half-life", "Kappa: Half-maximal level of inhibitor", "nu: cooperativity of inhibitor", "min half-life"}; static final int [] whichSides = { -1, -1 }; public DecayRegUpAff() {} 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]; kParam = param_nums[1]; nuParam = param_nums[2]; minHalfLifeParam = param_nums[3]; } public float getValue(Node which_node) { float temp = (params[halfLife] - params[minHalfLifeParam]) * Phi(Nodes[1].getIntegrationValue(), params[kParam], params[nuParam]); float half_life = params[halfLife] - temp; return (Nodes[0].getIntegrationValue(side) * (-Globals.characteristicTime / half_life)); } public float getNCValue(Node which_node) { float temp = (params[halfLife] - params[minHalfLifeParam]) * Phi(Nodes[1].getIntegrationValue(), params[kParam], params[nuParam]); float half_life = params[halfLife] - temp; return (-Globals.characteristicTime / half_life); } }