<?xml version="1.0" encoding="UTF-8"?> 
<java version="1.4.1-rc" class="java.beans.XMLDecoder"> 
 <object class="eclpss.model.ModelSpecification"> 
  <void property="author"> 
   <string>ts</string> 
  </void> 
  <void property="componentsVector"> 
   <void method="add"> 
    <object id="ComponentSpecification0" class="eclpss.component.ComponentSpecification"> 
     <void property="author"> 
      <string>ew</string> 
     </void> 
     <void property="date"> 
      <object class="java.util.Date"> 
       <long>1014872400000</long> 
      </object> 
     </void> 
     <void property="documentation"> 
      <array class="java.lang.String" length="18"> 
       <void index="0"> 
        <string>ew</string> 
       </void> 
       <void index="1"> 
        <string>2/28/02</string> 
       </void> 
       <void index="2"> 
        <string>9/17/03</string> 
       </void> 
       <void index="3"> 
        <string>v.2</string> 
       </void> 
       <void index="4"> 
        <string>Initialize 3D grid to contain hot cells in the upper left and lower right of the grid.
During the simulation, heat the cells in the grid.</string> 
       </void> 
       <void index="5"> 
        <string></string> 
       </void> 
       <void index="6"> 
        <string></string> 
       </void> 
       <void index="7"> 
        <string></string> 
       </void> 
       <void index="8"> 
        <string></string> 
       </void> 
       <void index="9"> 
        <string></string> 
       </void> 
       <void index="10"> 
        <string></string> 
       </void> 
       <void index="11"> 
        <string></string> 
       </void> 
       <void index="12"> 
        <string></string> 
       </void> 
       <void index="13"> 
        <string></string> 
       </void> 
       <void index="14"> 
        <string></string> 
       </void> 
       <void index="15"> 
        <string></string> 
       </void> 
       <void index="16"> 
        <string></string> 
       </void> 
       <void index="17"> 
        <string></string> 
       </void> 
      </array> 
     </void> 
     <void property="eclpssVersion"> 
      <string>version 1.2.b0</string> 
     </void> 
     <void property="esvs"> 
      <array class="eclpss.esv.ESVSpecification" length="1"> 
       <void index="0"> 
        <object id="ESVSpecification0" class="eclpss.esv.ESVSpecification"> 
         <void property="attributeConstants"> 
          <void method="add"> 
           <object class="eclpss.esv.Constant"> 
            <void property="index"> 
             <int>0</int> 
            </void> 
            <void property="name"> 
             <string>Value_MIN</string> 
            </void> 
            <void property="type"> 
             <string>double</string> 
            </void> 
            <void property="unit"> 
             <string>Temperature_FAHRENHEIT</string> 
            </void> 
            <void property="value"> 
             <string>0.0</string> 
            </void> 
           </object> 
          </void> 
          <void method="add"> 
           <object class="eclpss.esv.Constant"> 
            <void property="index"> 
             <int>0</int> 
            </void> 
            <void property="name"> 
             <string>Value_MAX</string> 
            </void> 
            <void property="type"> 
             <string>double</string> 
            </void> 
            <void property="unit"> 
             <string>Temperature_FAHRENHEIT</string> 
            </void> 
            <void property="value"> 
             <string>102400.0</string> 
            </void> 
           </object> 
          </void> 
         </void> 
         <void property="attributes"> 
          <void method="add"> 
           <object class="eclpss.esv.Attribute"> 
            <void property="index"> 
             <int>0</int> 
            </void> 
            <void property="name"> 
             <string>Value</string> 
            </void> 
            <void property="type"> 
             <string>double</string> 
            </void> 
            <void property="unit"> 
             <string>Temperature_FAHRENHEIT</string> 
            </void> 
           </object> 
          </void> 
         </void> 
         <void property="author"> 
          <string>re</string> 
         </void> 
         <void property="comments"> 
          <string>MIN:  temperature of cold cells.
MAX:  temperature of hot cells.</string> 
         </void> 
         <void property="constants"> 
          <void method="add"> 
           <object class="eclpss.esv.Constant"> 
            <void property="index"> 
             <int>0</int> 
            </void> 
            <void property="name"> 
             <string>MULTIPLIER</string> 
            </void> 
            <void property="type"> 
             <string>double</string> 
            </void> 
            <void property="unit"> 
             <string>NONE</string> 
            </void> 
            <void property="value"> 
             <string>100.0</string> 
            </void> 
           </object> 
          </void> 
         </void> 
         <void property="date"> 
          <object class="java.util.Date"> 
           <long>1014872400000</long> 
          </object> 
         </void> 
         <void property="eclpssVersion"> 
          <string>version 1.2.b0</string> 
         </void> 
         <void property="externalLocation"> 
          <string>/home/strempel/tmpeclpss/Temp3D.esv</string> 
         </void> 
         <void property="name"> 
          <string>Temp3D</string> 
         </void> 
         <void property="staticDeclarations"> 
          <string></string> 
         </void> 
         <void property="timeStamp"> 
          <object class="java.util.Date"> 
           <long>1063827315421</long> 
          </object> 
         </void> 
        </object> 
       </void> 
      </array> 
     </void> 
     <void property="externalLocation"> 
      <string>/home/strempel/tmpeclpss/CoolDown3D.cpt</string> 
     </void> 
     <void property="frameTitle"> 
      <string>Time Graph</string> 
     </void> 
     <void property="height"> 
      <string>1300</string> 
     </void> 
     <void property="javadoc"> 
      <string>/**
 *&lt;UL&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;BIG&gt;This is an &lt;font color = &quot;mediumblue&quot;&gt;&lt;i&gt; ECLPSS Component&lt;/i&gt;&lt;/font&gt;&lt;/BIG&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Author: &lt;/b&gt;ew&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Created: &lt;/b&gt;2/28/02&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Saved: &lt;/b&gt;9/17/03&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Version: &lt;/b&gt;v.2&lt;/LI&gt;&lt;BR&gt;&lt;br&gt;
 *&lt;LI&gt;&lt;b&gt;Purpose: &lt;/b&gt;Initialize 3D grid to contain hot cells in the upper left and lower right of the grid.
During the simulation, heat the cells in the grid.&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Algorithm Citation: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Modification History: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Assumptions: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Limitations: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Known Problems: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Suggested Improvements: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Testing Statistics: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Models used in: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;General Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Pre-Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Post-Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Local Method Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
*/
</string> 
     </void> 
     <void property="localMethodCode"> 
      <string>// make an array of hot cell Points (for current and previous time
// frames.

Point [] hotCellsCurrent = new Point [2];
Point [] hotCellsPrevious = new Point [2];

// relative offsets from current
static final Point F = new Point( 0, 0, 1, BACK1 );
static final Point B = new Point( 0, 0, -1, BACK1 );
static final Point N = new Point( 0, -1, 0, BACK1 );
static final Point S = new Point( 0, 1, 0, BACK1 );
static final Point E = new Point( 1, 0, 0, BACK1 );
static final Point W = new Point( -1, 0, 0, BACK1 );


</string> 
     </void> 
     <void property="modelName"> 
      <string>HeatDiffusion3D</string> 
     </void> 
     <void property="name"> 
      <string>CoolDown3D</string> 
     </void> 
     <void property="numTimeFrames"> 
      <int>2</int> 
     </void> 
     <void property="postRecords"> 
      <object class="java.util.Vector"/> 
     </void> 
     <void property="preRecords"> 
      <object class="java.util.Vector"> 
       <void method="add"> 
        <object class="eclpss.component.ESVReadsAndWritesRecord"> 
         <void property="name"> 
          <string>Temp3D</string> 
         </void> 
         <void property="read"> 
          <boolean>true</boolean> 
         </void> 
         <void property="written"> 
          <boolean>true</boolean> 
         </void> 
        </object> 
       </void> 
      </object> 
     </void> 
     <void property="preSimCode"> 
      <string>/** Initialize the cells in the grid.  The cells in the upper left and
   * lower right of the grid.
   */

int xlbindex = grid.getAbsXLB()-1;
int ylbindex = grid.getAbsYLB()-1; 
int zlbindex = grid.getAbsZLB()-1;
int xub= grid.getAbsXUB();
int yub= grid.getAbsYUB();
int zub= grid.getAbsZUB();



// iterate over the entire grid

for (int i=xlbindex; i&lt; xub; i++) {
   for (int j = ylbindex; j&lt;yub; j++) {
      for(int k = zlbindex; k&lt;zub;k++){
        
// the designated cells hot 
// and make the rest of the grid cold
        if (i == xlbindex &amp;&amp; j == ylbindex &amp;&amp; k==zlbindex) {
            // initialize grid
                 grid.writeAbsTemp3D(current,new Point(i,j,k,NOW)).add(new Temp3D(Temp3D.Value_MAX));
            // initialize arrays
            hotCellsCurrent[0] = new Point(i,j,k,NOW);
            hotCellsPrevious[0] = new Point(i,j,k,BACK1);
         }

         if (i == xub-1 &amp;&amp; j == yub-1 &amp;&amp; k==zub-1) {
            // initialize grid
                 grid.writeAbsTemp3D(current,new Point(i,j,k,NOW)).add(new Temp3D(Temp3D.Value_MAX));

            // initialize arrays

            hotCellsCurrent[1] = new Point(i,j,k,NOW);
            hotCellsPrevious[1] = new Point(i,j,k,BACK1);
         }
         else {
            // just a regular cell - initialize grid
            grid.writeAbsTemp3D(current,new Point(i,j,k,NOW)).add(new Temp3D(Temp3D.Value_MIN));
         }
      }//end z loop
   }//end y loop
}//end x loop
//write out the hot cell addresses
try{
     System.out.println(&quot;Upper Left should be &quot;+(int)grid.readAbsTemp3D(current,new Point(1,1,1,NOW)).getValue());
}catch(Exception e){}
for (int i=0; i&lt; hotCellsCurrent.length; i++) {
   System.out.println(&quot;hotCellsCurrent[&quot;+i+&quot;] = &quot;+hotCellsCurrent[i]);
   System.out.println(&quot;hotCellsPrevious[&quot;+i+&quot;] = &quot;+hotCellsPrevious[i]);
}

</string> 
     </void> 
     <void property="simCode"> 
      <string>/** Make cells of the grid hot.
   */
int x = current.getX();
int y = current.getY();
int z = current.getZ();

int it = model.getTimeIteration();

// print the iteration number to the console modulo displayRate
//if (x==0 &amp;&amp; y==0 &amp;&amp; z==0 &amp;&amp; ((it-1) % model.displayRate == 0) )
// System.out.println(&quot;Iteration &quot;+it);

double temp = 0.0;
double front = 0.0;
double back = 0.0;
double north = 0.0;
double south = 0.0;
double east = 0.0;
double west = 0.0;

int readCount = 0;

try{
   front = grid.readTemp3D(current,F).getValue();
   readCount++;
}
catch (Exception e) {}

try{
   back = grid.readTemp3D(current,B).getValue();
   readCount++;
}
catch (Exception e) {}

try {
   south = grid.readTemp3D(current,S).getValue();
   readCount++;
}
catch (Exception e) {}

try {
   north = grid.readTemp3D(current,N).getValue();
   readCount++;
}
catch (Exception e) {}

try {
   east = grid.readTemp3D(current,E).getValue();
   readCount++;
}
catch (Exception e) {}

try {
   west = grid.readTemp3D(current,W).getValue();
   readCount++;
}
catch (Exception e) {}

// since all points are either correct (within the grid boundaries)
// or 0.0 (all points are initialized to 0, and any out-of-bound gets
// are caught)
//we can add them all up, and then just divide by the appropriate amount.

grid.writeTemp3D(current,CURRENT).add(new Temp3D((front+back+north+south+east+west)/readCount));

for (int i=0; i&lt; hotCellsCurrent.length; i++) {
   if (x==hotCellsCurrent[i].getX() &amp;&amp; y == hotCellsCurrent[i].getY() &amp;&amp; z==hotCellsCurrent[i].getZ()) {
      
      // get previous temperature
      temp = grid.readAbsTemp3D(hotCellsPrevious[i]).getValue();
      
      // write it here and now
      grid.writeAbsTemp3D(hotCellsCurrent[i]).setValue(temp);
      }
}
                                                        
</string> 
     </void> 
     <void property="simRecords"> 
      <object class="java.util.Vector"> 
       <void method="add"> 
        <object class="eclpss.component.ESVReadsAndWritesRecord"> 
         <void property="name"> 
          <string>Temp3D</string> 
         </void> 
         <void property="read"> 
          <boolean>true</boolean> 
         </void> 
         <void property="written"> 
          <boolean>true</boolean> 
         </void> 
        </object> 
       </void> 
      </object> 
     </void> 
     <void property="staticDeclarations"> 
      <string></string> 
     </void> 
     <void property="timeStamp"> 
      <object class="java.util.Date"> 
       <long>1063828119467</long> 
      </object> 
     </void> 
     <void property="width"> 
      <string>1000</string> 
     </void> 
    </object> 
   </void> 
   <void method="add"> 
    <object class="eclpss.component.GraphicalComponentSpecification"> 
     <void property="attribute"> 
      <object id="Attribute0" class="eclpss.esv.Attribute"> 
       <void property="index"> 
        <int>0</int> 
       </void> 
       <void property="name"> 
        <string>Value</string> 
       </void> 
       <void property="type"> 
        <string>double</string> 
       </void> 
      </object> 
     </void> 
     <void property="author"> 
      <string>Generated Graphical Component</string> 
     </void> 
     <void property="date"> 
      <object class="java.util.Date"> 
       <long>1056513600000</long> 
      </object> 
     </void> 
     <void property="documentation"> 
      <array class="java.lang.String" length="18"> 
       <void index="0"> 
        <string>Generated Graphical Component</string> 
       </void> 
       <void index="1"> 
        <string>6/25/03</string> 
       </void> 
       <void index="2"> 
        <string>9/17/03</string> 
       </void> 
       <void index="3"> 
        <string>v.2</string> 
       </void> 
       <void index="4"> 
        <string>Display the cells heating up on the 3D grid.</string> 
       </void> 
       <void index="5"> 
        <string></string> 
       </void> 
       <void index="6"> 
        <string></string> 
       </void> 
       <void index="7"> 
        <string></string> 
       </void> 
       <void index="8"> 
        <string></string> 
       </void> 
       <void index="9"> 
        <string></string> 
       </void> 
       <void index="10"> 
        <string></string> 
       </void> 
       <void index="11"> 
        <string></string> 
       </void> 
       <void index="12"> 
        <string></string> 
       </void> 
       <void index="13"> 
        <string></string> 
       </void> 
       <void index="14"> 
        <string></string> 
       </void> 
       <void index="15"> 
        <string></string> 
       </void> 
       <void index="16"> 
        <string></string> 
       </void> 
       <void index="17"> 
        <string></string> 
       </void> 
      </array> 
     </void> 
     <void property="eclpssVersion"> 
      <string>version 1.2.b0</string> 
     </void> 
     <void property="esvs"> 
      <array class="eclpss.esv.ESVSpecification" length="1"> 
       <void index="0"> 
        <object idref="ESVSpecification0"/> 
       </void> 
      </array> 
     </void> 
     <void property="externalLocation"> 
      <string>/home/strempel/tmpeclpss/GeneratedWithLegend.cpt</string> 
     </void> 
     <void property="frameTitle"> 
      <string>GeneratedWithLegend</string> 
     </void> 
     <void property="graphical"> 
      <boolean>true</boolean> 
     </void> 
     <void property="javadoc"> 
      <string>/**
 *&lt;UL&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;BIG&gt;This is an &lt;font color = &quot;mediumblue&quot;&gt;&lt;i&gt; ECLPSS Component&lt;/i&gt;&lt;/font&gt;&lt;/BIG&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Author: &lt;/b&gt;Generated Graphical Component&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Created: &lt;/b&gt;6/25/03&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Saved: &lt;/b&gt;9/17/03&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Version: &lt;/b&gt;v.2&lt;/LI&gt;&lt;BR&gt;&lt;br&gt;
 *&lt;LI&gt;&lt;b&gt;Purpose: &lt;/b&gt;Display the cells heating up on the 3D grid.&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Algorithm Citation: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Modification History: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Assumptions: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Limitations: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Known Problems: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Suggested Improvements: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Testing Statistics: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Models used in: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;General Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Pre-Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Post-Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Local Method Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
*/
</string> 
     </void> 
     <void property="localMethodCode"> 
      <string>public void paint(Graphics g) {
  g.drawImage(image,15,30,Color.blue,this);

  float[] slope = new float[3];
  float[] startHSB = new float[3];
  Color.RGBtoHSB(0, 0, 255, startHSB);
  float[] endHSB = new float[3];
  Color.RGBtoHSB(255, 0, 0, endHSB);

  slope[0] = (endHSB[0] - startHSB[0])/frameWidth;
  slope[1] = (endHSB[1] - startHSB[1])/frameWidth;
  slope[2] = (endHSB[2] - startHSB[2])/frameWidth;

  for(int i = 0; i &lt; frameWidth; i++){
    g.setColor(Color.getHSBColor(startHSB[0] + (slope[0]*i),
      startHSB[1] + (slope[1]*i),
      startHSB[2] + (slope[2]*i)));
    g.drawLine(i+15, frameHeight+35, i+15, frameHeight+55);
  }

  g.setColor(Color.black);
  g.drawString(&quot;&quot;+model.MIN, 15, frameHeight+70);
  g.drawString(&quot;&quot;+model.MAX, frameWidth-10, frameHeight+70);
}

Graphics2D offScreen = null;
int frameWidth = 420;
int frameHeight = 420;
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(frameWidth, frameHeight, java.awt.image.BufferedImage.TYPE_INT_RGB);
</string> 
     </void> 
     <void property="maxValue"> 
      <string>model.MAX</string> 
     </void> 
     <void property="minValue"> 
      <string>model.MIN</string> 
     </void> 
     <void property="name"> 
      <string>GeneratedWithLegend</string> 
     </void> 
     <void property="postRecords"> 
      <object class="java.util.Vector"> 
       <void method="add"> 
        <object class="eclpss.component.ESVReadsAndWritesRecord"> 
         <void property="name"> 
          <string>Temp3D</string> 
         </void> 
         <void property="read"> 
          <boolean>true</boolean> 
         </void> 
        </object> 
       </void> 
      </object> 
     </void> 
     <void property="postSimCode"> 
      <string>boolean threeDimensions = !(grid.getZBoundryType()==ComputationalGrid.NO_Z); if(offScreen == null) {
  offScreen = image.createGraphics();
}
int xLB = grid.getXLB();
int yLB = grid.getYLB();
int zLB = grid.getZLB();
int xUB = grid.getXUB();
int yUB = grid.getYUB();
int zUB = grid.getZUB();

int blockWidth = 0;
int blockHeight = 0;
if(threeDimensions){
  if((2*xUB + 2*zUB) &gt; (2*yUB+2*zUB)){
    blockWidth = frameWidth / ((2*xUB)+(2*zUB));
    blockHeight = blockWidth;
  }
  else{
    blockWidth = frameHeight / ((2*yUB)+(2*zUB));
    blockHeight = blockWidth;
  }
}//end if(threeDimensions){
else{
  blockWidth = frameWidth / xUB;
  blockHeight = frameHeight/ yUB;
}
float value = (float)0;


float[] hsbStartColors = new float[3];
Color.RGBtoHSB(0, 0, 255, hsbStartColors);
float[] hsbEndColors = new float[3];
Color.RGBtoHSB(255, 0, 0, hsbEndColors);


ChangeablePoint p = new ChangeablePoint(xLB,yLB,zLB,-1);
for(int xx=0; xx&lt;xUB; xx++){
  p.setX(xx);
  for(int yy=0; yy&lt;yUB; yy++){
    p.setY(yy);
    if(threeDimensions){
      for(int zz=0;zz&lt;zUB;zz++){
        p.setZ(zz);
        try{
          value = (float)grid.readAbsTemp3D(current,p).getValue();
        }catch(Exception e){}

        float hue = 0f;
        if(hsbStartColors[0] == hsbEndColors[0]){
          hue = hsbStartColors[0];
        }
        else if(hsbStartColors[0]&gt;hsbEndColors[0]){
          hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
        }
        else{
          hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
        }

        float sat = 0f;
        if(hsbStartColors[1] == hsbEndColors[1]){
          sat = hsbStartColors[1];
        }
        else if(hsbStartColors[1] &gt; hsbEndColors[1]){
          sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
        }
        else{
          sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
        }

        float bri = 0f;
        if(hsbStartColors[2] == hsbEndColors[2]){
          bri = hsbStartColors[2];
        }
        else if(hsbStartColors[2] &gt; hsbEndColors[2]){
          bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
        }
        else{
          bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
        }

        Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

        if(value &gt; model.MAX){
          hsbColor = new Color(255,255,255);
        }
        else if(value &lt; model.MIN){
          hsbColor = new Color(0,0,0);
        }

        offScreen.setColor(hsbColor);

        if(zz == zUB-1){
          offScreen.fill3DRect((xUB-xx-1)*blockWidth,(zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(xx==0){
          offScreen.fill3DRect((zUB-zz+xUB-1)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(zz==0){
          offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(xx == xUB-1){
          offScreen.fill3DRect((xUB+xUB+zUB+zz)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(yy == 0){
          offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB-zz-1)*blockHeight, blockWidth, blockHeight, true);
        }
        if(yy==yUB-1){
          offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yUB+zz)*blockHeight, blockWidth, blockHeight, true);
        }
      }//end z loop
    }//end if(threeDimensions)
    else{
      try{
        value = (float)grid.readAbsTemp3D(current,p).getValue();
      }catch(Exception e){}

      float hue = 0f;
      if(hsbStartColors[0] == hsbEndColors[0]){
        hue = hsbStartColors[0];
      }
      else if(hsbStartColors[0]&gt;hsbEndColors[0]){
        hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
      }
    else{
      hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
    }

    float sat = 0f;
      if(hsbStartColors[1] == hsbEndColors[1]){
        sat = hsbStartColors[1];
      }
      else if(hsbStartColors[1] &gt; hsbEndColors[1]){
        sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
      }
      else{
        sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
      }

      float bri = 0f;
      if(hsbStartColors[2] == hsbEndColors[2]){
        bri = hsbStartColors[2];
      }
      else if(hsbStartColors[2] &gt; hsbEndColors[2]){
        bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
      }
      else{
        bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
      }

      Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

      if(value &gt; model.MAX){
        hsbColor = new Color(255,255,255);
      }
      else if(value &lt; model.MIN){
        hsbColor = new Color(0,0,0);
      }

      offScreen.setColor(hsbColor);

      offScreen.fill3DRect(xx*blockWidth,yy*blockHeight, blockWidth, blockHeight, true);
    }//end else
  }//end y loop
}// end x loop
repaint();
</string> 
     </void> 
     <void property="preRecords"> 
      <object class="java.util.Vector"> 
       <void method="add"> 
        <object class="eclpss.component.ESVReadsAndWritesRecord"> 
         <void property="name"> 
          <string>Temp3D</string> 
         </void> 
         <void property="read"> 
          <boolean>true</boolean> 
         </void> 
        </object> 
       </void> 
      </object> 
     </void> 
     <void property="preSimCode"> 
      <string>    if(offScreen == null) {
      offScreen = image.createGraphics();
    }
int xLB = grid.getXLB();
int yLB = grid.getYLB();
int zLB = grid.getZLB();
int xUB = grid.getXUB();
int yUB = grid.getYUB();
int zUB = grid.getZUB();

    int blockWidth = 0;
    int blockHeight = 0;
    if((2*xUB + 2*zUB) &gt; (2*yUB+2*zUB)){
      blockWidth = frameWidth / ((2*xUB)+(2*zUB));
      blockHeight = blockWidth;
    }
    else{
      blockWidth = frameHeight / ((2*yUB)+(2*zUB));
      blockHeight = blockWidth;
    }
    float temp = (float)0;


    float[] hsbStartColors = new float[3];
    Color.RGBtoHSB(0, 0, 255, hsbStartColors);
    float[] hsbEndColors = new float[3];
    Color.RGBtoHSB(255, 0, 0, hsbEndColors);


    ChangeablePoint p = new ChangeablePoint(xLB,yLB,zLB,0);
    for(int xx=0; xx&lt;xUB; xx++){
      p.setX(xx);
      for(int yy=0; yy&lt;yUB; yy++){
        p.setY(yy);
        for(int zz=0;zz&lt;zUB;zz++){
          p.setZ(zz);
          try{
            temp = (float)grid.readAbsTemp3D(current,p).getValue();
          }catch(Exception e){}

          float hue = 0f;
          if(hsbStartColors[0] == hsbEndColors[0]){
            hue = hsbStartColors[0];
          }
          else if(hsbStartColors[0]&gt;hsbEndColors[0]){
            hue = ((float)model.MAX-temp)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
          }
         else{
            hue = (temp-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
          }

          float sat = 0f;
          if(hsbStartColors[1] == hsbEndColors[1]){
            sat = hsbStartColors[1];
          }
          else if(hsbStartColors[1] &gt; hsbEndColors[1]){
            sat = ((float)model.MAX-temp)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
          }
          else{
            sat = (temp-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
          }

          float bri = 0f;
          if(hsbStartColors[2] == hsbEndColors[2]){
            bri = hsbStartColors[2];
          }
          else if(hsbStartColors[2] &gt; hsbEndColors[2]){
            bri = ((float)model.MAX-temp)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
          }
          else{
            bri = (temp-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
          }

          Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

          if(temp &gt; model.MAX){            hsbColor = new Color(255,255,255);          }          else if(temp &lt; model.MIN){            hsbColor = new Color(0,0,0);          }
          offScreen.setColor(hsbColor);

          if(zz == zUB-1){
            offScreen.fill3DRect((xUB-xx-1)*blockWidth,(zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(xx==0){
            offScreen.fill3DRect((zUB-zz+xUB-1)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(zz==0){
            offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(xx == xUB-1){
            offScreen.fill3DRect((xUB+xUB+zUB+zz)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(yy == 0){
            offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB-zz-1)*blockHeight, blockWidth, blockHeight, true);
          }
          if(yy==yUB-1){
            offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yUB+zz)*blockHeight, blockWidth, blockHeight, true);
          }
        }//end z loop
      }//end y loop
    }// end x loop
    repaint();
</string> 
     </void> 
     <void property="simCode"> 
      <string>int modulo = 1;
boolean threeDimensions = !(grid.getZBoundryType()==ComputationalGrid.NO_Z); 
if( ((model.getTimeIteration()-1) % modulo) == 0 ){int xLB = grid.getXLB();
int yLB = grid.getYLB();
int zLB = grid.getZLB();
int xUB = grid.getXUB();
int yUB = grid.getYUB();
int zUB = grid.getZUB();
    if(offScreen == null) {
      offScreen = image.createGraphics();
    }

    int blockWidth = 0;
    int blockHeight = 0;
    if(threeDimensions){
      if((2*xUB + 2*zUB) &gt; (2*yUB+2*zUB)){
        blockWidth = frameWidth / ((2*xUB)+(2*zUB));
        blockHeight = blockWidth;
      }
      else{
        blockWidth = frameHeight / ((2*yUB)+(2*zUB));
        blockHeight = blockWidth;
      }
    }//end if(threeDimensions){
    else{
      blockWidth = frameWidth / xUB;
      blockHeight = frameHeight/ yUB;
    }
    float value = (float)0;


    float[] hsbStartColors = new float[3];
    Color.RGBtoHSB(0, 0, 255, hsbStartColors);
    float[] hsbEndColors = new float[3];
    Color.RGBtoHSB(255, 0, 0, hsbEndColors);


    ChangeablePoint p = new ChangeablePoint(xLB,yLB,zLB,-1);
    for(int xx=xLB-1; xx&lt;xUB; xx++){
      p.setX(xx);
      for(int yy=yLB-1; yy&lt;yUB; yy++){
        p.setY(yy);
        if(threeDimensions){
          for(int zz=zLB-1;zz&lt;zUB;zz++){
            p.setZ(zz);
            try{
              value = (float)grid.readAbsTemp3D(current,p).getValue();
            }catch(Exception e){}

            float hue = 0f;
            if(hsbStartColors[0] == hsbEndColors[0]){
              hue = hsbStartColors[0];
            }
            else if(hsbStartColors[0]&gt;hsbEndColors[0]){
              hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
            }
           else{
              hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
            }

            float sat = 0f;
            if(hsbStartColors[1] == hsbEndColors[1]){
              sat = hsbStartColors[1];
            }
            else if(hsbStartColors[1] &gt; hsbEndColors[1]){
              sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
            }
            else{
              sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
            }

            float bri = 0f;
            if(hsbStartColors[2] == hsbEndColors[2]){
              bri = hsbStartColors[2];
            }
            else if(hsbStartColors[2] &gt; hsbEndColors[2]){
              bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
            }
            else{
              bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
            }

            Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

            if(value &gt; model.MAX){
              hsbColor = new Color(255,255,255);
            }
            else if(value &lt; model.MIN){
              hsbColor = new Color(0,0,0);
            }

            offScreen.setColor(hsbColor);

            if(zz == zUB-1){
              offScreen.fill3DRect((xUB-xx-1)*blockWidth,(zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(xx==0){
              offScreen.fill3DRect((zUB-zz+xUB-1)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(zz==0){
              offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(xx == xUB-1){
              offScreen.fill3DRect((xUB+xUB+zUB+zz)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(yy == 0){
              offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB-zz-1)*blockHeight, blockWidth, blockHeight, true);
            }
            if(yy==yUB-1){
              offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yUB+zz)*blockHeight, blockWidth, blockHeight, true);
            }
          }//end z loop
        }//end if(threeDimensions)
        else{
          try{
            value = (float)grid.readAbsTemp3D(current,p).getValue();
          }catch(Exception e){}

          float hue = 0f;
          if(hsbStartColors[0] == hsbEndColors[0]){
            hue = hsbStartColors[0];
          }
          else if(hsbStartColors[0]&gt;hsbEndColors[0]){
            hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
          }
         else{
            hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
          }

          float sat = 0f;
          if(hsbStartColors[1] == hsbEndColors[1]){
            sat = hsbStartColors[1];
          }
          else if(hsbStartColors[1] &gt; hsbEndColors[1]){
            sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
          }
          else{
            sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
          }

          float bri = 0f;
          if(hsbStartColors[2] == hsbEndColors[2]){
            bri = hsbStartColors[2];
          }
          else if(hsbStartColors[2] &gt; hsbEndColors[2]){
            bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
          }
          else{
            bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
          }

          Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

          if(value &gt; model.MAX){
            hsbColor = new Color(255,255,255);
          }
          else if(value &lt; model.MIN){
            hsbColor = new Color(0,0,0);
          }

          offScreen.setColor(hsbColor);

          offScreen.fill3DRect(xx*blockWidth,yy*blockHeight, blockWidth, blockHeight, true);
        }//end else
      }//end y loop
    }// end x loop
  }
repaint();
</string> 
     </void> 
     <void property="simRecords"> 
      <object class="java.util.Vector"> 
       <void method="add"> 
        <object class="eclpss.component.ESVReadsAndWritesRecord"> 
         <void property="name"> 
          <string>Temp3D</string> 
         </void> 
         <void property="read"> 
          <boolean>true</boolean> 
         </void> 
        </object> 
       </void> 
      </object> 
     </void> 
     <void property="stateVariable"> 
      <object idref="ESVSpecification0"/> 
     </void> 
     <void property="staticDeclarations"> 
      <string></string> 
     </void> 
     <void property="timeStamp"> 
      <object class="java.util.Date"> 
       <long>1063828154494</long> 
      </object> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="date"> 
   <object class="java.util.Date"> 
    <long>1036645200000</long> 
   </object> 
  </void> 
  <void property="documentation"> 
   <array class="java.lang.String" length="9"> 
    <void index="0"> 
     <string>ts</string> 
    </void> 
    <void index="1"> 
     <string>11/7/02</string> 
    </void> 
    <void index="2"> 
     <string>9/17/03</string> 
    </void> 
    <void index="3"> 
     <string>v.2</string> 
    </void> 
    <void index="4"> 
     <string>Heat a 3D grid with initial hot cells in the upper left and lower right
of the grid.</string> 
    </void> 
    <void index="5"> 
     <string>A simple 3D 10x10x10 grid.</string> 
    </void> 
    <void index="6"> 
     <string>Time step is 2.</string> 
    </void> 
    <void index="7"> 
     <string></string> 
    </void> 
    <void index="8"> 
     <string>Revised to reflect current version of Eclpss.</string> 
    </void> 
   </array> 
  </void> 
  <void property="eclpssVersion"> 
   <string>version 1.2.b0</string> 
  </void> 
  <void property="endTime"> 
   <int>500</int> 
  </void> 
  <void property="esvs"> 
   <array class="eclpss.esv.ESVSpecification" length="1"> 
    <void index="0"> 
     <object idref="ESVSpecification0"/> 
    </void> 
   </array> 
  </void> 
  <void property="externalLocation"> 
   <string>/home/strempel/HeatDiffusion3D.mdl</string> 
  </void> 
  <void property="grid"> 
   <object class="eclpss.grid.GridSpecification"> 
    <void property="author"> 
     <string>ts</string> 
    </void> 
    <void property="comments"> 
     <string>A 10x10x10 3D grid</string> 
    </void> 
    <void property="date"> 
     <object class="java.util.Date"> 
      <long>1002427200000</long> 
     </object> 
    </void> 
    <void property="eclpssVersion"> 
     <string>version 1.2.b0</string> 
    </void> 
    <void property="externalLocation"> 
     <string>/home/strempel/SimGrid3D.grd</string> 
    </void> 
    <void property="name"> 
     <string>SimGrid3D</string> 
    </void> 
    <void property="nrDimensions"> 
     <int>3</int> 
    </void> 
    <void property="nrTimeFrames"> 
     <int>2</int> 
    </void> 
    <void property="staticDeclarations"> 
     <string></string> 
    </void> 
    <void property="timeStamp"> 
     <object class="java.util.Date"> 
      <long>1063826043476</long> 
     </object> 
    </void> 
    <void property="x"> 
     <object class="eclpss.grid.GridDimension"> 
      <void property="boundryType"> 
       <int>4</int> 
      </void> 
      <void property="cellWidth"> 
       <double>1.0</double> 
      </void> 
      <void property="numberOfCells"> 
       <int>10</int> 
      </void> 
      <void property="unit"> 
       <string>Dimensionless_ONE</string> 
      </void> 
     </object> 
    </void> 
    <void property="y"> 
     <object class="eclpss.grid.GridDimension"> 
      <void property="boundryType"> 
       <int>4</int> 
      </void> 
      <void property="cellWidth"> 
       <double>1.0</double> 
      </void> 
      <void property="numberOfCells"> 
       <int>10</int> 
      </void> 
      <void property="unit"> 
       <string>Dimensionless_ONE</string> 
      </void> 
     </object> 
    </void> 
    <void property="z"> 
     <object class="eclpss.grid.GridDimension"> 
      <void property="boundryType"> 
       <int>4</int> 
      </void> 
      <void property="cellWidth"> 
       <double>1.0</double> 
      </void> 
      <void property="numberOfCells"> 
       <int>10</int> 
      </void> 
      <void property="unit"> 
       <string>Dimensionless_ONE</string> 
      </void> 
     </object> 
    </void> 
   </object> 
  </void> 
  <void property="intBased"> 
   <boolean>true</boolean> 
  </void> 
  <void property="intStep"> 
   <int>1</int> 
  </void> 
  <void property="javadoc"> 
   <string>/**
 *&lt;UL&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Author: &lt;/b&gt;ts&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Created: &lt;/b&gt;11/7/02&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Saved: &lt;/b&gt;9/17/03&lt;/LI&gt;&lt;BR&gt;&lt;br&gt;
 *&lt;LI&gt;&lt;b&gt;Version: &lt;/b&gt;v.2&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Purpose: &lt;/b&gt;Heat a 3D grid with initial hot cells in the upper left and lower right
of the grid.&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Type of Grid: &lt;/b&gt;A simple 3D 10x10x10 grid.&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Time step, time scale: &lt;/b&gt;Time step is 2.&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Usage Notes: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Miscellaneous Notes: &lt;/b&gt;Revised to reflect current version of Eclpss.&lt;/LI&gt;&lt;BR&gt;
*/
</string> 
  </void> 
  <void property="name"> 
   <string>HeatDiffusion3D</string> 
  </void> 
  <void property="numberOfExecutions"> 
   <int>499</int> 
  </void> 
  <void property="preExecutionGroups"> 
   <void method="add"> 
    <object class="eclpss.component.ExecutionGroup"> 
     <void property="name"> 
      <string>Initialize cells</string> 
     </void> 
     <void property="nonspacial"> 
      <boolean>true</boolean> 
     </void> 
     <void property="sim"> 
      <boolean>false</boolean> 
     </void> 
     <void property="specNames"> 
      <void method="add"> 
       <string>CoolDown3D</string> 
      </void> 
     </void> 
     <void property="specs"> 
      <void method="add"> 
       <object idref="ComponentSpecification0"/> 
      </void> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="simExecutionGroups"> 
   <void method="add"> 
    <object class="eclpss.component.ExecutionGroup"> 
     <void property="memoryModel"> 
      <int>2</int> 
     </void> 
     <void property="name"> 
      <string>Heat grid</string> 
     </void> 
     <void property="specNames"> 
      <void method="add"> 
       <string>CoolDown3D</string> 
      </void> 
     </void> 
     <void property="specs"> 
      <void method="add"> 
       <object class="eclpss.component.ComponentSpecification"> 
        <void property="author"> 
         <string>ts</string> 
        </void> 
        <void property="date"> 
         <object class="java.util.Date"> 
          <long>1041570000000</long> 
         </object> 
        </void> 
        <void property="documentation"> 
         <array class="java.lang.String" length="18"> 
          <void index="0"> 
           <string>ts</string> 
          </void> 
          <void index="1"> 
           <string>1/3/03</string> 
          </void> 
          <void index="2"> 
           <string>6/3/03</string> 
          </void> 
          <void index="3"> 
           <string></string> 
          </void> 
          <void index="4"> 
           <string></string> 
          </void> 
          <void index="5"> 
           <string></string> 
          </void> 
          <void index="6"> 
           <string></string> 
          </void> 
          <void index="7"> 
           <string></string> 
          </void> 
          <void index="8"> 
           <string></string> 
          </void> 
          <void index="9"> 
           <string></string> 
          </void> 
          <void index="10"> 
           <string></string> 
          </void> 
          <void index="11"> 
           <string></string> 
          </void> 
          <void index="12"> 
           <string></string> 
          </void> 
          <void index="13"> 
           <string></string> 
          </void> 
          <void index="14"> 
           <string></string> 
          </void> 
          <void index="15"> 
           <string></string> 
          </void> 
          <void index="16"> 
           <string></string> 
          </void> 
          <void index="17"> 
           <string></string> 
          </void> 
         </array> 
        </void> 
        <void property="eclpssVersion"> 
         <string>version 1.1.b0</string> 
        </void> 
        <void property="esvs"> 
         <array class="eclpss.esv.ESVSpecification" length="1"> 
          <void index="0"> 
           <object class="eclpss.esv.ESVSpecification"> 
            <void property="attributeConstants"> 
             <void method="add"> 
              <object class="eclpss.esv.Constant"> 
               <void property="index"> 
                <int>0</int> 
               </void> 
               <void property="name"> 
                <string>Value_MIN</string> 
               </void> 
               <void property="type"> 
                <string>double</string> 
               </void> 
               <void property="value"> 
                <string>0.0</string> 
               </void> 
              </object> 
             </void> 
             <void method="add"> 
              <object class="eclpss.esv.Constant"> 
               <void property="index"> 
                <int>0</int> 
               </void> 
               <void property="name"> 
                <string>Value_MAX</string> 
               </void> 
               <void property="type"> 
                <string>double</string> 
               </void> 
               <void property="value"> 
                <string>102400.0</string> 
               </void> 
              </object> 
             </void> 
            </void> 
            <void property="attributes"> 
             <void method="add"> 
              <object class="eclpss.esv.Attribute"> 
               <void property="index"> 
                <int>0</int> 
               </void> 
               <void property="name"> 
                <string>Value</string> 
               </void> 
               <void property="type"> 
                <string>double</string> 
               </void> 
              </object> 
             </void> 
            </void> 
            <void property="author"> 
             <string>re</string> 
            </void> 
            <void property="comments"> 
             <string></string> 
            </void> 
            <void property="constants"> 
             <void method="add"> 
              <object class="eclpss.esv.Constant"> 
               <void property="index"> 
                <int>0</int> 
               </void> 
               <void property="name"> 
                <string>MULTIPLIER</string> 
               </void> 
               <void property="type"> 
                <string>double</string> 
               </void> 
               <void property="unit"> 
                <string>NONE</string> 
               </void> 
               <void property="value"> 
                <string>100.0</string> 
               </void> 
              </object> 
             </void> 
            </void> 
            <void property="date"> 
             <object class="java.util.Date"> 
              <long>1014872400000</long> 
             </object> 
            </void> 
            <void property="eclpssVersion"> 
             <string>version 1.0.b0</string> 
            </void> 
            <void property="externalLocation"> 
             <string>/home/tsmart/public_html/classes/eclpssSaves/NewModels/Temp3D.esv</string> 
            </void> 
            <void property="name"> 
             <string>Temp3D</string> 
            </void> 
            <void property="staticDeclarations"> 
             <string></string> 
            </void> 
            <void property="timeStamp"> 
             <object class="java.util.Date"> 
              <long>1041616781640</long> 
             </object> 
            </void> 
           </object> 
          </void> 
         </array> 
        </void> 
        <void property="executionType"> 
         <int>2</int> 
        </void> 
        <void property="externalLocation"> 
         <string>/home/tsmart/public_html/classes/eclpssSaves/NewModels/GraphTest.cpt</string> 
        </void> 
        <void property="frameTitle"> 
         <string>Graph</string> 
        </void> 
        <void property="graphical"> 
         <boolean>true</boolean> 
        </void> 
        <void property="height"> 
         <string>500</string> 
        </void> 
        <void property="javadoc"> 
         <string>/**
 *&lt;UL&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;BIG&gt;This is an &lt;font color = &quot;mediumblue&quot;&gt;&lt;i&gt; ECLPSS Component&lt;/i&gt;&lt;/font&gt;&lt;/BIG&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Author: &lt;/b&gt;ts&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Created: &lt;/b&gt;1/3/03&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Date Saved: &lt;/b&gt;6/3/03&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Version: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;&lt;br&gt;
 *&lt;LI&gt;&lt;b&gt;Purpose: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Algorithm Citation: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Modification History: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Assumptions: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Limitations: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Known Problems: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Suggested Improvements: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Testing Statistics: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Models used in: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;General Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Pre-Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Post-Sim Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
 *&lt;LI&gt;&lt;b&gt;Local Method Comments: &lt;/b&gt;&lt;/LI&gt;&lt;BR&gt;
*/
</string> 
        </void> 
        <void property="localMethodCode"> 
         <string>public void paint(Graphics g) {
   redrawImage(g);
}

private void redrawImage(Graphics g){
   g.drawImage(graph, 15, 30, graphPanel);
}</string> 
        </void> 
        <void property="name"> 
         <string>GraphTest</string> 
        </void> 
        <void property="postRecords"> 
         <object class="java.util.Vector"/> 
        </void> 
        <void property="preRecords"> 
         <object class="java.util.Vector"> 
          <void method="add"> 
           <object class="eclpss.component.ESVReadsAndWritesRecord"> 
            <void property="name"> 
             <string>Temp3D</string> 
            </void> 
           </object> 
          </void> 
         </object> 
        </void> 
        <void property="preSimCode"> 
         <string>
</string> 
        </void> 
        <void property="simCode"> 
         <string>int x = current.getX();
int y = current.getY();
int z = current.getZ();
int it = model.getTimeIteration();

if(it == 1 &amp;&amp; x == 0 &amp;&amp; y == 0 &amp;&amp; z == 0){
   graphPanel = new JPanel();
   scroller = new JScrollPane(graphPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
   graphPanel.setPreferredSize(new java.awt.Dimension(1000, 13000));
   scroller.setPreferredSize(new java.awt.Dimension(500, 500));
   this.getContentPane().add(scroller);
   pack();
   graph.setDrawLine(true);
   Color[] lineColors = {Color.red, Color.blue, Color.green};
   graph.setLineColors(lineColors);
}

//if(it%10 == 0 &amp;&amp; x == 0 &amp;&amp; y == 0 &amp;&amp; z==0){
//   graph.clearAll();
//}

if(x == 9 &amp;&amp; y == 9 &amp;&amp; z == 0){
   graph.graph(new ECLPSSGraphPoint(grid.readAbsTemp3D(new Point(x, y, z, -1)).getValue(), it, 0,
         ECLPSSGraphPoint.ONLY_LINE));
}

if(x==2 &amp;&amp; y == 2 &amp;&amp; z == 2){
   graph.graph(new ECLPSSGraphPoint(grid.readAbsTemp3D(new Point(x, y, z, -1)).getValue(), it, 2,
         ECLPSSGraphPoint.SQUARE));
}

if(grid.getXUB()/2 == x &amp;&amp; grid.getYUB()/2 == y &amp;&amp; grid.getZUB()/2 == z){
   //graph.graph(grid.readAbsTemp3D(new Point(x, y, z, -1)).getValue(), it);
   graph.graph(new ECLPSSGraphPoint(grid.readAbsTemp3D(new Point(x, y, z, -1)).getValue(), it, 1,
         ECLPSSGraphPoint.CIRCLE));
}
if(x == grid.getXUB()-1 &amp;&amp; y==grid.getYUB()-1 &amp;&amp; z==grid.getZUB()-1){ 
   repaint();
   //graph.outputData();
}

if(it == 9999 &amp;&amp;x == grid.getXUB() - 1 &amp;&amp; y == grid.getYUB() - 1 &amp;&amp; z == grid.getZUB() - 1){
   graph.outputImage(&quot;/home/tsmart/test.jpg&quot;);
   //graph.outputData();
}</string> 
        </void> 
        <void property="simRecords"> 
         <object class="java.util.Vector"> 
          <void method="add"> 
           <object class="eclpss.component.ESVReadsAndWritesRecord"> 
            <void property="name"> 
             <string>Temp3D</string> 
            </void> 
            <void property="read"> 
             <boolean>true</boolean> 
            </void> 
           </object> 
          </void> 
         </object> 
        </void> 
        <void property="staticDeclarations"> 
         <string>public static JPanel graphPanel;
public static JScrollPane scroller;
public static ECLPSSGraph graph = new ECLPSSGraph(900, 1000, 0, 102400, 0, 110);
</string> 
        </void> 
        <void property="timeStamp"> 
         <object class="java.util.Date"> 
          <long>1054658817348</long> 
         </object> 
        </void> 
        <void property="width"> 
         <string>500</string> 
        </void> 
       </object> 
      </void> 
     </void> 
    </object> 
   </void> 
   <void method="add"> 
    <object class="eclpss.component.ExecutionGroup"> 
     <void property="memoryModel"> 
      <int>2</int> 
     </void> 
     <void property="name"> 
      <string>Display grid</string> 
     </void> 
     <void property="nonspacial"> 
      <boolean>true</boolean> 
     </void> 
     <void property="specNames"> 
      <void method="add"> 
       <string>GeneratedWithLegend</string> 
      </void> 
     </void> 
     <void property="specs"> 
      <void method="add"> 
       <object class="eclpss.component.GraphicalComponentSpecification"> 
        <void property="attribute"> 
         <object idref="Attribute0"/> 
        </void> 
        <void property="author"> 
         <string>Generated Graphical Component</string> 
        </void> 
        <void property="date"> 
         <object class="java.util.Date"> 
          <long>1056558056198</long> 
         </object> 
        </void> 
        <void property="documentation"> 
         <array class="java.lang.String" length="18"/> 
        </void> 
        <void property="esvs"> 
         <array class="eclpss.esv.ESVSpecification" length="1"> 
          <void index="0"> 
           <object idref="ESVSpecification0"/> 
          </void> 
         </array> 
        </void> 
        <void property="frameTitle"> 
         <string>GeneratedWithLegend</string> 
        </void> 
        <void property="graphical"> 
         <boolean>true</boolean> 
        </void> 
        <void property="localMethodCode"> 
         <string>public void paint(Graphics g) {
  g.drawImage(image,15,30,Color.blue,this);

  float[] slope = new float[3];
  float[] startHSB = new float[3];
  Color.RGBtoHSB(0, 0, 255, startHSB);
  float[] endHSB = new float[3];
  Color.RGBtoHSB(255, 0, 0, endHSB);

  slope[0] = (endHSB[0] - startHSB[0])/frameHeight;
  slope[1] = (endHSB[1] - startHSB[1])/frameHeight;
  slope[2] = (endHSB[2] - startHSB[2])/frameHeight;

  for(int i = 0; i &lt; frameWidth; i++){
    g.setColor(Color.getHSBColor(startHSB[0] + (slope[0]*i),
      startHSB[1] + (slope[1]*i),
      startHSB[2] + (slope[2]*i)));
    g.drawLine(i+15, frameHeight+35, i+15, frameHeight+55);
  }

  g.setColor(Color.black);
  g.drawString(&quot;&quot;+model.MIN, 15, frameHeight+70);
  g.drawString(&quot;&quot;+model.MAX, frameWidth-10, frameHeight+70);
}

Graphics2D offScreen = null;
int frameWidth = 420;
int frameHeight = 420;
java.awt.image.BufferedImage image = new java.awt.image.BufferedImage(frameWidth, frameHeight, java.awt.image.BufferedImage.TYPE_INT_RGB);
</string> 
        </void> 
        <void property="maxValue"> 
         <string>model.MAX</string> 
        </void> 
        <void property="minValue"> 
         <string>model.MIN</string> 
        </void> 
        <void property="name"> 
         <string>GeneratedWithLegend</string> 
        </void> 
        <void property="postRecords"> 
         <object class="java.util.Vector"> 
          <void method="add"> 
           <object class="eclpss.component.ESVReadsAndWritesRecord"> 
            <void property="name"> 
             <string>Temp3D</string> 
            </void> 
            <void property="read"> 
             <boolean>true</boolean> 
            </void> 
           </object> 
          </void> 
         </object> 
        </void> 
        <void property="postSimCode"> 
         <string>boolean threeDimensions = !(grid.getZBoundryType()==ComputationalGrid.NO_Z); if(offScreen == null) {
  offScreen = image.createGraphics();
}
int xLB = grid.getXLB();
int yLB = grid.getYLB();
int zLB = grid.getZLB();
int xUB = grid.getXUB();
int yUB = grid.getYUB();
int zUB = grid.getZUB();

int blockWidth = 0;
int blockHeight = 0;
if(threeDimensions){
  if((2*xUB + 2*zUB) &gt; (2*yUB+2*zUB)){
    blockWidth = frameWidth / ((2*xUB)+(2*zUB));
    blockHeight = blockWidth;
  }
  else{
    blockWidth = frameHeight / ((2*yUB)+(2*zUB));
    blockHeight = blockWidth;
  }
}//end if(threeDimensions){
else{
  blockWidth = frameWidth / xUB;
  blockHeight = frameHeight/ yUB;
}
float value = (float)0;


float[] hsbStartColors = new float[3];
Color.RGBtoHSB(0, 0, 255, hsbStartColors);
float[] hsbEndColors = new float[3];
Color.RGBtoHSB(255, 0, 0, hsbEndColors);


ChangeablePoint p = new ChangeablePoint(xLB,yLB,zLB,-1);
for(int xx=0; xx&lt;xUB; xx++){
  p.setX(xx);
  for(int yy=0; yy&lt;yUB; yy++){
    p.setY(yy);
    if(threeDimensions){
      for(int zz=0;zz&lt;zUB;zz++){
        p.setZ(zz);
        try{
          value = (float)grid.readAbsTemp3D(current,p).getValue();
        }catch(Exception e){}

        float hue = 0f;
        if(hsbStartColors[0] == hsbEndColors[0]){
          hue = hsbStartColors[0];
        }
        else if(hsbStartColors[0]&gt;hsbEndColors[0]){
          hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
        }
        else{
          hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
        }

        float sat = 0f;
        if(hsbStartColors[1] == hsbEndColors[1]){
          sat = hsbStartColors[1];
        }
        else if(hsbStartColors[1] &gt; hsbEndColors[1]){
          sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
        }
        else{
          sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
        }

        float bri = 0f;
        if(hsbStartColors[2] == hsbEndColors[2]){
          bri = hsbStartColors[2];
        }
        else if(hsbStartColors[2] &gt; hsbEndColors[2]){
          bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
        }
        else{
          bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
        }

        Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

        if(value &gt; model.MAX){
          hsbColor = new Color(255,255,255);
        }
        else if(value &lt; model.MIN){
          hsbColor = new Color(0,0,0);
        }

        offScreen.setColor(hsbColor);

        if(zz == zUB-1){
          offScreen.fill3DRect((xUB-xx-1)*blockWidth,(zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(xx==0){
          offScreen.fill3DRect((zUB-zz+xUB-1)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(zz==0){
          offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(xx == xUB-1){
          offScreen.fill3DRect((xUB+xUB+zUB+zz)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
        }
        if(yy == 0){
          offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB-zz-1)*blockHeight, blockWidth, blockHeight, true);
        }
        if(yy==yUB-1){
          offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yUB+zz)*blockHeight, blockWidth, blockHeight, true);
        }
      }//end z loop
    }//end if(threeDimensions)
    else{
      try{
        value = (float)grid.readAbsTemp3D(current,p).getValue();
      }catch(Exception e){}

      float hue = 0f;
      if(hsbStartColors[0] == hsbEndColors[0]){
        hue = hsbStartColors[0];
      }
      else if(hsbStartColors[0]&gt;hsbEndColors[0]){
        hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
      }
    else{
      hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
    }

    float sat = 0f;
      if(hsbStartColors[1] == hsbEndColors[1]){
        sat = hsbStartColors[1];
      }
      else if(hsbStartColors[1] &gt; hsbEndColors[1]){
        sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
      }
      else{
        sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
      }

      float bri = 0f;
      if(hsbStartColors[2] == hsbEndColors[2]){
        bri = hsbStartColors[2];
      }
      else if(hsbStartColors[2] &gt; hsbEndColors[2]){
        bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
      }
      else{
        bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
      }

      Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

      if(value &gt; model.MAX){
        hsbColor = new Color(255,255,255);
      }
      else if(value &lt; model.MIN){
        hsbColor = new Color(0,0,0);
      }

      offScreen.setColor(hsbColor);

      offScreen.fill3DRect(xx*blockWidth,yy*blockHeight, blockWidth, blockHeight, true);
    }//end else
  }//end y loop
}// end x loop
repaint();
</string> 
        </void> 
        <void property="preRecords"> 
         <object class="java.util.Vector"> 
          <void method="add"> 
           <object class="eclpss.component.ESVReadsAndWritesRecord"> 
            <void property="name"> 
             <string>Temp3D</string> 
            </void> 
            <void property="read"> 
             <boolean>true</boolean> 
            </void> 
           </object> 
          </void> 
         </object> 
        </void> 
        <void property="preSimCode"> 
         <string>    if(offScreen == null) {
      offScreen = image.createGraphics();
    }
int xLB = grid.getXLB();
int yLB = grid.getYLB();
int zLB = grid.getZLB();
int xUB = grid.getXUB();
int yUB = grid.getYUB();
int zUB = grid.getZUB();

    int blockWidth = 0;
    int blockHeight = 0;
    if((2*xUB + 2*zUB) &gt; (2*yUB+2*zUB)){
      blockWidth = frameWidth / ((2*xUB)+(2*zUB));
      blockHeight = blockWidth;
    }
    else{
      blockWidth = frameHeight / ((2*yUB)+(2*zUB));
      blockHeight = blockWidth;
    }
    float temp = (float)0;


    float[] hsbStartColors = new float[3];
    Color.RGBtoHSB(0, 0, 255, hsbStartColors);
    float[] hsbEndColors = new float[3];
    Color.RGBtoHSB(255, 0, 0, hsbEndColors);


    ChangeablePoint p = new ChangeablePoint(xLB,yLB,zLB,0);
    for(int xx=0; xx&lt;xUB; xx++){
      p.setX(xx);
      for(int yy=0; yy&lt;yUB; yy++){
        p.setY(yy);
        for(int zz=0;zz&lt;zUB;zz++){
          p.setZ(zz);
          try{
            temp = (float)grid.readAbsTemp3D(current,p).getValue();
          }catch(Exception e){}

          float hue = 0f;
          if(hsbStartColors[0] == hsbEndColors[0]){
            hue = hsbStartColors[0];
          }
          else if(hsbStartColors[0]&gt;hsbEndColors[0]){
            hue = ((float)model.MAX-temp)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
          }
         else{
            hue = (temp-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
          }

          float sat = 0f;
          if(hsbStartColors[1] == hsbEndColors[1]){
            sat = hsbStartColors[1];
          }
          else if(hsbStartColors[1] &gt; hsbEndColors[1]){
            sat = ((float)model.MAX-temp)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
          }
          else{
            sat = (temp-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
          }

          float bri = 0f;
          if(hsbStartColors[2] == hsbEndColors[2]){
            bri = hsbStartColors[2];
          }
          else if(hsbStartColors[2] &gt; hsbEndColors[2]){
            bri = ((float)model.MAX-temp)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
          }
          else{
            bri = (temp-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
          }

          Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

          if(temp &gt; model.MAX){            hsbColor = new Color(255,255,255);          }          else if(temp &lt; model.MIN){            hsbColor = new Color(0,0,0);          }
          offScreen.setColor(hsbColor);

          if(zz == zUB-1){
            offScreen.fill3DRect((xUB-xx-1)*blockWidth,(zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(xx==0){
            offScreen.fill3DRect((zUB-zz+xUB-1)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(zz==0){
            offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(xx == xUB-1){
            offScreen.fill3DRect((xUB+xUB+zUB+zz)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
          }
          if(yy == 0){
            offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB-zz-1)*blockHeight, blockWidth, blockHeight, true);
          }
          if(yy==yUB-1){
            offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yUB+zz)*blockHeight, blockWidth, blockHeight, true);
          }
        }//end z loop
      }//end y loop
    }// end x loop
    repaint();
</string> 
        </void> 
        <void property="simCode"> 
         <string>int modulo = 1;
boolean threeDimensions = !(grid.getZBoundryType()==ComputationalGrid.NO_Z); 
if( ((model.getTimeIteration()-1) % modulo) == 0 ){int xLB = grid.getXLB();
int yLB = grid.getYLB();
int zLB = grid.getZLB();
int xUB = grid.getXUB();
int yUB = grid.getYUB();
int zUB = grid.getZUB();
    if(offScreen == null) {
      offScreen = image.createGraphics();
    }

    int blockWidth = 0;
    int blockHeight = 0;
    if(threeDimensions){
      if((2*xUB + 2*zUB) &gt; (2*yUB+2*zUB)){
        blockWidth = frameWidth / ((2*xUB)+(2*zUB));
        blockHeight = blockWidth;
      }
      else{
        blockWidth = frameHeight / ((2*yUB)+(2*zUB));
        blockHeight = blockWidth;
      }
    }//end if(threeDimensions){
    else{
      blockWidth = frameWidth / xUB;
      blockHeight = frameHeight/ yUB;
    }
    float value = (float)0;


    float[] hsbStartColors = new float[3];
    Color.RGBtoHSB(0, 0, 255, hsbStartColors);
    float[] hsbEndColors = new float[3];
    Color.RGBtoHSB(255, 0, 0, hsbEndColors);


    ChangeablePoint p = new ChangeablePoint(xLB,yLB,zLB,-1);
    for(int xx=xLB-1; xx&lt;xUB; xx++){
      p.setX(xx);
      for(int yy=yLB-1; yy&lt;yUB; yy++){
        p.setY(yy);
        if(threeDimensions){
          for(int zz=zLB-1;zz&lt;zUB;zz++){
            p.setZ(zz);
            try{
              value = (float)grid.readAbsTemp3D(current,p).getValue();
            }catch(Exception e){}

            float hue = 0f;
            if(hsbStartColors[0] == hsbEndColors[0]){
              hue = hsbStartColors[0];
            }
            else if(hsbStartColors[0]&gt;hsbEndColors[0]){
              hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
            }
           else{
              hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
            }

            float sat = 0f;
            if(hsbStartColors[1] == hsbEndColors[1]){
              sat = hsbStartColors[1];
            }
            else if(hsbStartColors[1] &gt; hsbEndColors[1]){
              sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
            }
            else{
              sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
            }

            float bri = 0f;
            if(hsbStartColors[2] == hsbEndColors[2]){
              bri = hsbStartColors[2];
            }
            else if(hsbStartColors[2] &gt; hsbEndColors[2]){
              bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
            }
            else{
              bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
            }

            Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

            if(value &gt; model.MAX){
              hsbColor = new Color(255,255,255);
            }
            else if(value &lt; model.MIN){
              hsbColor = new Color(0,0,0);
            }

            offScreen.setColor(hsbColor);

            if(zz == zUB-1){
              offScreen.fill3DRect((xUB-xx-1)*blockWidth,(zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(xx==0){
              offScreen.fill3DRect((zUB-zz+xUB-1)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(zz==0){
              offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(xx == xUB-1){
              offScreen.fill3DRect((xUB+xUB+zUB+zz)*blockWidth, (zUB+yy)*blockHeight, blockWidth, blockHeight, true);
            }
            if(yy == 0){
              offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB-zz-1)*blockHeight, blockWidth, blockHeight, true);
            }
            if(yy==yUB-1){
              offScreen.fill3DRect((xUB+zUB+xx)*blockWidth, (zUB+yUB+zz)*blockHeight, blockWidth, blockHeight, true);
            }
          }//end z loop
        }//end if(threeDimensions)
        else{
          try{
            value = (float)grid.readAbsTemp3D(current,p).getValue();
          }catch(Exception e){}

          float hue = 0f;
          if(hsbStartColors[0] == hsbEndColors[0]){
            hue = hsbStartColors[0];
          }
          else if(hsbStartColors[0]&gt;hsbEndColors[0]){
            hue = ((float)model.MAX-value)*((hsbStartColors[0]-hsbEndColors[0])/((float)model.MAX-(float)model.MIN))+hsbEndColors[0];
          }
         else{
            hue = (value-(float)model.MIN)*((hsbEndColors[0]-hsbStartColors[0])/((float)model.MAX-(float)model.MIN))+hsbStartColors[0];
          }

          float sat = 0f;
          if(hsbStartColors[1] == hsbEndColors[1]){
            sat = hsbStartColors[1];
          }
          else if(hsbStartColors[1] &gt; hsbEndColors[1]){
            sat = ((float)model.MAX-value)*((hsbStartColors[1]-hsbEndColors[1])/((float)model.MAX-(float)model.MIN))+hsbEndColors[1];
          }
          else{
            sat = (value-(float)model.MIN)*((hsbEndColors[1]-hsbStartColors[1])/((float)model.MAX-(float)model.MIN))+hsbStartColors[1];
          }

          float bri = 0f;
          if(hsbStartColors[2] == hsbEndColors[2]){
            bri = hsbStartColors[2];
          }
          else if(hsbStartColors[2] &gt; hsbEndColors[2]){
            bri = ((float)model.MAX-value)*((hsbStartColors[2]-hsbEndColors[2])/((float)model.MAX-(float)model.MIN))+hsbEndColors[2];
          }
          else{
            bri = (value-(float)model.MIN)*((hsbEndColors[2]-hsbStartColors[2])/((float)model.MAX-(float)model.MIN))+hsbStartColors[2];
          }

          Color hsbColor = Color.getHSBColor((float)hue,(float)sat,(float)bri);

          if(value &gt; model.MAX){
            hsbColor = new Color(255,255,255);
          }
          else if(value &lt; model.MIN){
            hsbColor = new Color(0,0,0);
          }

          offScreen.setColor(hsbColor);

          offScreen.fill3DRect(xx*blockWidth,yy*blockHeight, blockWidth, blockHeight, true);
        }//end else
      }//end y loop
    }// end x loop
  }
repaint();
</string> 
        </void> 
        <void property="simRecords"> 
         <object class="java.util.Vector"> 
          <void method="add"> 
           <object class="eclpss.component.ESVReadsAndWritesRecord"> 
            <void property="name"> 
             <string>Temp3D</string> 
            </void> 
            <void property="read"> 
             <boolean>true</boolean> 
            </void> 
           </object> 
          </void> 
         </object> 
        </void> 
        <void property="stateVariable"> 
         <object idref="ESVSpecification0"/> 
        </void> 
       </object> 
      </void> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="startTime"> 
   <int>1</int> 
  </void> 
  <void property="statics"> 
   <void method="add"> 
    <object class="eclpss.model.StaticVariable"> 
     <void property="comments"> 
      <string>MIN:  temperature of cold cells.</string> 
     </void> 
     <void property="name"> 
      <string>MIN</string> 
     </void> 
     <void property="string"> 
      <string>
/**
* MIN:  temperature of cold cells.
*/
public static int MIN = 0;</string> 
     </void> 
     <void property="type"> 
      <string>int</string> 
     </void> 
     <void property="value"> 
      <string>0</string> 
     </void> 
    </object> 
   </void> 
   <void method="add"> 
    <object class="eclpss.model.StaticVariable"> 
     <void property="name"> 
      <string>MAX</string> 
     </void> 
     <void property="string"> 
      <string>public static int MAX = 102400;</string> 
     </void> 
     <void property="type"> 
      <string>int</string> 
     </void> 
     <void property="value"> 
      <string>102400</string> 
     </void> 
    </object> 
   </void> 
  </void> 
  <void property="timeStamp"> 
   <object class="java.util.Date"> 
    <long>1063828296634</long> 
   </object> 
  </void> 
 </object> 
</java> 
