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

Formula
dnodex/dt = -nodex * (1 / H_nodex) * (1 - (INHIBITOR^nu / (K^nu + INHIBITOR^nu)))

Parameters
Target [nodex] The Node which is decaying
Inhibitor [INHIBITOR] The Node that inhibits decay.
Half-life [H_nodex] The half-life of the Node.
Half-max inhibitor [K_INHIBITORnodex] The inhibitor concentration at which degradation rate is reduced to half.
Cooperativity inhibitor [nu_INHIBITORnodex] The non-linearity of the inhibiting function.

Usage
&nodex

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