package affectors; import main.Node; import main.Cell; import main.Globals; /** This is one half of a pair of Affectors that moves things from one cell to neighboring cells. That is, this is a rough means to have diffusive transport directly from cytoplasm to cytoplasm (e.g. in a syncytium where the "cells" represent unit volumes of cytoplasm rather than real cells. The transfer rate should be the same in both the XferOutAff and XferInAff. Note that all interfaces between adjacent cells are assumed to have the same area and permeability.

Formula
dNODEX/dt = Xfer_NODEX * Sum of NODEX values in all neighbors

Parameters
Target [NODEX] The Node undergoing difusion.
Transfer rate [Mxfer_NODEX] The rate at which the Node transfers across the each boundary.

Usage
&NODEX

&XferOutAff NODEX Xfer_NODEX &XferInAff NODEX Xfer_NODEX
&endNODEX/code> */ public class XferInAff extends Affector { /** "Diffusion" rate. */ int xferRateParam; static final String desc = "Cell-to-cell transfer bypassing membrane; version In for influx"; 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. COMMENT APPLIES TO MxferInAff from which this was copied */ public XferInAff() {} protected void setLabelsAndTypes() { setDescriptions(this.desc, nodeDescriptions, paramDescriptions); this.Type[GUI_CAPABLE] = 1; this.Type[CERTIFICATION] = Affector.RETURNS_DERIV; this.Type[MATHTYPE] = Affector.KK; this.Type[TERMTYPE] = Affector.CONVERSION; } public void setParameterNumbers(int [] param_nums) { xferRateParam = param_nums[0]; } /** Overridden because this affector uses the same node in seven places. */ public void fixNodes(Cell cell, String [] node_names) throws Exception { String [] new_node_names = new String[Globals.cellNumSides]; for(int i = 0; i < new_node_names.length; i++) { new_node_names[i] = node_names[0]; } if(notFixed) { if(new_node_names != null) { Nodes = new Node[new_node_names.length]; for(int i = 0; i < new_node_names.length; i++) { Nodes[i] = cell.getNeighborNode(i, node_names[0]); } } else Nodes = null; sides = null; notFixed = false; } } public float getValue(Node which_node) { float total_pool = 0; for(int i = 1; i <= Nodes.length; i++) { total_pool += Nodes[i+1].getIntegrationValue(); } return Globals.characteristicTime * params[xferRateParam] * total_pool; } }