package affectors; import main.Node; import main.Cell; import main.Globals; /** This is one half of a pair of Affectors that moves things from a face of one cell to the opposing face of a neighboring cell. This makes an extremely rough approximation to diffusion across a field of cells if combined with the lateral membrane transfer Affectors. This Affector models the efflux from a face from one cell to the opposing face of its neighboring cell. Whenever you add this to a Node, you should also add the MxferIAff as well, which does the influx part. Note that the transfer rate should be the same in both the MxferOutAff and MxferInAff. Also remember that for membrane-bound Nodes, the program keeps track of a separate concentration on each face of a cell, so the formula below is for the concentration on one face.

Formula
dNODEX/dt = -Mxfer_NODEX * NODEX

Parameters
Target [NODEX] The Node that is being diffused.
Transfer rate [Mxfer_NODEX] The rate at which the Node moves from one face to the opposite face.

Usage
&NODEX

&MxferOutAff NODEX Mxfer_NODEX &MxferInAff NODEX Mxfer_NODEX
&endNODEX/code> */ public class MxferOutAff extends Affector { /** "Diffusion" rate. */ int xferRateParam; static final String desc = "Cell-to-cell membrane transfer; version Out for efflux"; static final String [] nodeDescriptions = {"Target"}; static final String [] paramDescriptions = {"Rate of transfer"}; static final int [] whichSides = {1}; /* Note - doing something tricky here. There really should be two nodes (see below) and therefore two sides which should be {-1, 1}. However, to make it easier for the user we only require them to type the node in once (since it is the same node on either membrane). I call this node the opposite side node here so that I get the proper neighbor side. In the fixNodes override, I then put the -1 back in where it belongs. */ public MxferOutAff() {} 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.CONVERSION; } public void setParameterNumbers(int [] param_nums) { xferRateParam = param_nums[0]; } /** Overridden because this affector uses the same node in two places. */ public void fixNodes(Cell cell, String [] node_names) throws Exception { String [] new_node_names = new String[2]; new_node_names[0] = new_node_names[1] = node_names[0]; int opposite_side = sides[0]; // See note above sides = new int[2]; sides[0] = -1; sides[1] = opposite_side; super.fixNodes(cell, new_node_names); } public float getValue(Node which_node) { return -Globals.characteristicTime * params[xferRateParam] * Nodes[0].getIntegrationValue(side); } public float getNCValue(Node which_node) { return -Globals.characteristicTime * params[xferRateParam]; } }