package affectors; import main.Node; import main.Globals; /** This affector returns a constant value to cause the target node to go to * the specified final value (Final) when coupled to constant linear decay. * The rate of decay is needed for scaling with the nondimensionalization. * *

Formula *
dNODEX/dt = Final/H_Nodex * *

Parameters * * * *
Half life [H_Nodex] The half life of the target node.
Final level [Final] The final concentration of the target assuming constant linear degredation.
* *

Usage *
&Nodex *

&ConstantLevelAff H_nodex Final *
* &endnodex * * @author Josselin Milloz * @see ConstantInputAff */ public class ConstantLevelAff extends Affector { /** The value returned by this affector. */ int halflifeparam; int finallevel; static final String desc = "Constant rate of production"; static final String [] paramDescriptions = {"H_Nodex","Final"}; static final String [] nodeDescriptions = {"Target node"}; static final int [] whichSides = { -1, -1 }; public ConstantLevelAff() {} protected void setLabelsAndTypes() { setDescriptions(this.desc, null, paramDescriptions); setSided(true, whichSides); this.Type[GUI_CAPABLE] = 1; this.Type[CERTIFICATION] = Affector.RETURNS_DERIV; this.Type[MATHTYPE] = Affector.CC; this.Type[TERMTYPE] = Affector.PRODUCTION; } public void setParameterNumbers(int [] param_nums) { halflifeparam = param_nums[0]; finallevel = param_nums[1]; } public float getValue(Node which_node) { return Globals.characteristicTime*params[finallevel]/params[halflifeparam]; } }