main
Class CalculatorNode

java.lang.Object
  extended bymain.Node
      extended bymain.CalculatorNode
All Implemented Interfaces:
java.lang.Cloneable

public class CalculatorNode
extends Node
implements java.lang.Cloneable

a CalculatorNode is a wrapper useful for doing arithmetic on a group of Nodes, like treating a group of similar Nodes as if it were a single pool. For instance, one might have several phosphoisoforms of a protein that all participate in some transcriptional regulatory process which is insensitive to the phosphorylation state. Or, one might find this handy for merely displaying the sum total of some protein in all its various forms. BE CAREFUL because one shouldn't use something like this to enter into reversible conversion reactions (e.g. ligand binding) of any kind. At present this thing only knows how to do a few things: sum a list of Nodes, make a ratio of two Nodes, and compute a weighted sum of several nodes. Which it does is based on the Node Type flag. If it is type RATIO and it has more than two Nodes to handle it will ignore all but the first two. The WEIGHTEDSUM type uses parameters, as many as twice the number of Nodes, to compute a sum over each node times a ratio of two parameters. If there are n Nodes, parameters 1 to n are the numerators, and parameters n+1 to 2n are the denominators, if they exist. BE CAREFUL because the order of the input Node references must match the order of input parameter references, and if not all terms are to be multiplied by parameters, but some terms have denominators, the input to this object needs to include references to a dummy parameter with value 1 to fill the empty numerator slots. Sorry, sort of kludgey, but it's easier to program that way. In the SUM and RATIO types, the parameters can also be used to make a ratio that multiplies the whole term; in this case the list is interpreted as numerator-denominator-numerator-denominator-etc..., and can be padded with dummy references to a value of 1 as needed. The CalculatorNode can also be set up with a "Normalized" option, either "Max" or "Min" that works like so: the RATIO type ignores it, the SUM type will divide the whole term by the value of either the maximum or minimum term, and the WEIGHTEDSUM by the maximum or mimimum *coefficient* that appears in the sum.


Field Summary
 
Fields inherited from class main.Node
affectors, numSides, this_debug_num
 
Method Summary
 float ckGetErrorEstimate()
           
 void ckIntegrate()
           
 void ckUpdateToNewTimestep()
           
 Node copy()
           
 void fixAllAffectors(Cell cell)
           
 float getIntegrationValue()
           
 float getIntegrationValue(int side)
           
 float getSum()
           
 float getValue(int side)
           
protected  void init(int node_num)
           
protected  boolean loadParameter(java.lang.String info, BetterTokenizer tokenizer)
           
 void setFromFinalValues()
           
 void setNumSides(int num_sides)
           
 void setType(int its_type)
           
 void setValue(float val)
           
 void storeFinalValues()
           
 void takeFPStep()
           
 void updateFPStep()
           
 
Methods inherited from class main.Node
addExpAffector, getAffectorsValue, getAffectorsValue, getNodeNum, getNoise, getNumAffectors, getSeparatedDeriv, getValue, removeExpAffectors, setAffectors, setFinalValues, setIntegrationValues, setNoise, setValue, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setType

public void setType(int its_type)

init

protected void init(int node_num)
Overrides:
init in class Node

setNumSides

public void setNumSides(int num_sides)
Overrides:
setNumSides in class Node

fixAllAffectors

public void fixAllAffectors(Cell cell)
                     throws java.lang.Exception
Throws:
java.lang.Exception

takeFPStep

public void takeFPStep()

updateFPStep

public void updateFPStep()

storeFinalValues

public void storeFinalValues()

setFromFinalValues

public void setFromFinalValues()

ckIntegrate

public void ckIntegrate()

ckUpdateToNewTimestep

public void ckUpdateToNewTimestep()

ckGetErrorEstimate

public float ckGetErrorEstimate()

getIntegrationValue

public float getIntegrationValue(int side)
Overrides:
getIntegrationValue in class Node

getIntegrationValue

public float getIntegrationValue()
Overrides:
getIntegrationValue in class Node

getValue

public float getValue(int side)
Overrides:
getValue in class Node

getSum

public float getSum()
Overrides:
getSum in class Node

setValue

public void setValue(float val)
Overrides:
setValue in class Node

loadParameter

protected boolean loadParameter(java.lang.String info,
                                BetterTokenizer tokenizer)
                         throws java.lang.Exception
Throws:
java.lang.Exception

copy

public Node copy()
Overrides:
copy in class Node