package affectors; import main.Node; import main.Globals; import main.Cell; /** This is for use by Experiments to simulate a heat shock pulse of some Node. Don't use this independently. Don't use in a network file. */ public class HeatShockAff extends Affector { static int numAffectingNodes = 0; float startTime, length; String [] hsNodeNames = new String[1]; static final String desc = "Simulates a heat shock - don't use directly in models."; public HeatShockAff(String Node1, float start, float length) { super(); hsNodeNames[0] = Node1; startTime = start; this.length = length; } public HeatShockAff(String [] params) { super(); hsNodeNames[0] = params[0]; startTime = (Float.valueOf(params[1])).floatValue(); length = (Float.valueOf(params[2])).floatValue(); } protected void setLabelsAndTypes() { setDescriptions(desc, null, null); } public void setParameterNumbers(int [] param_nums) { // Dummy function to keep compiler happy } public void fixNodes(Cell cell, String [] node_names) throws Exception { super.fixNodes(cell, hsNodeNames); // Use this classes node-names rather than super classes } public float getValue(Node which_node) { if(Globals.time >= startTime && Globals.time < startTime + length) return 1.0f; else return 0.0f; } }