package affectors; import main.Node; /** This affector returns a constant value. Use it when you want a constant input to a Node.

Formula
dNODEX/dt = Constant

Parameters
Input rate [in_nodex] The amount of this Node being produced (or degraded) per timestep.

Usage
&nodex

&ConstantInputAff in_nodex
&endnodex */ public class ConstantInputAff extends Affector { /** The value returned by this affector. */ int inParam; static final String desc = "Constant rate of production"; static final String [] paramDescriptions = {"Input rate"}; public ConstantInputAff() {} protected void setLabelsAndTypes() { setDescriptions(this.desc, null, paramDescriptions); 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) { inParam = param_nums[0]; } public float getValue(Node which_node) { return params[inParam]; } }