<?xml version="1.0" encoding="UTF-8"?>
<otrunk id="89cad2ae-23f1-4459-b03f-8748a878fe56">
  <imports>
    <import class="org.concord.data.state.OTDataStore" />
    <import class="org.concord.data.state.OTDataChannelDescription" />
    <import class="org.concord.data.state.OTDataField" />
    <import class="org.concord.data.state.OTDataTable" />
    <import class="org.concord.datagraph.state.OTDataGraph" />
    <import class="org.concord.datagraph.state.OTDataAxis" />
    <import class="org.concord.datagraph.state.OTDataGraphable" />
    <import class="org.concord.datagraph.state.OTDataCollector" />
    <import class="org.concord.datagraph.state.OTMultiDataGraph" />
    <import class="org.concord.datagraph.state.OTPluginView" />
    <import class="org.concord.datagraph.state.OTDataBarGraphable" />
    <import class="org.concord.otrunk.OTIncludeRootObject" />
    <import class="org.concord.otrunk.OTInclude" />
    <import class="org.concord.otrunk.OTSystem" />
    <import class="org.concord.otrunk.biologica.OTOrganismPlacement" />
    <import class="org.concord.otrunk.biologica.OTEnvironment" />
    <import class="org.concord.otrunk.biologica.OTOrganism" />
    <import class="org.concord.otrunk.biologica.OTWorld" />
    <import class="org.concord.otrunk.biologica.agent.OTAgentSpecies" />
    <import class="org.concord.otrunk.biologica.agent.OTAgentTrait" />
    <import class="org.concord.otrunk.biologica.agent.OTAgentPropertyImageMap" />
    <import class="org.concord.otrunk.biologica.environment.OTAddAgentButton" />
    <import class="org.concord.otrunk.biologica.environment.OTEnvironmentHolder" />
    <import class="org.concord.otrunk.biologica.data.OTBiologicaModelDataProducer" />
    <import class="org.concord.otrunk.biologica.rules.OTRule" />
    <import class="org.concord.otrunk.biologica.rules.OTRuleCondition" />
    <import class="org.concord.otrunk.biologica.rules.OTRuleConsequence" />
    <import class="org.concord.otrunk.ui.OTCurriculumUnit" />
    <import class="org.concord.otrunk.ui.OTPlacement" />
    <import class="org.concord.otrunk.ui.snapshot.OTSnapshot" />
    <import class="org.concord.otrunk.ui.snapshot.OTSnapshotButton" />
    <import class="org.concord.otrunk.ui.snapshot.OTSnapshotAlbum" />
    <import class="org.concord.otrunk.ui.snapshot.OTSnapshotChooser" />
    <import class="org.concord.otrunk.view.OTViewEntry" />
    <import class="org.concord.otrunk.view.OTViewBundle" />
    <import class="org.concord.otrunk.view.OTViewMode" />
    <import class="org.concord.otrunk.view.document.OTCompoundDoc" />
    <import class="org.concord.otrunk.script.ui.OTScriptObject" />
    <import class="org.concord.otrunk.script.js.OTJavascript" />
    <import class="org.concord.otrunk.script.OTScriptEngineBundle" />
    <import class="org.concord.otrunk.script.OTScriptEngineEntry" />
    <import class="org.concord.otrunk.script.ui.OTScriptVariable" />
    <import class="org.concord.otrunk.script.ui.OTScriptVariableComponent" />
    <import class="org.concord.otrunk.script.ui.OTScriptVariableRealObject" />
    <import class="org.concord.otrunk.script.ui.OTScriptVariableView" />
    <import class="org.concord.otrunk.script.ui.OTScriptButton" />
    <import class="org.concord.otrunk.ui.OTButton" />
    <import class="org.concord.otrunk.ui.OTProgressBar" />
    <import class="org.concord.otrunk.ui.OTSlider" />
    <import class="org.concord.otrunk.ui.OTSliderLabel" />
    <import class="org.concord.otrunk.ui.OTText" />
    <import class="org.concord.framework.otrunk.view.OTFrame" />
    <import class="org.concord.framework.otrunk.wrapper.OTObjectSet" />
  </imports>
  <idMap>
    <idMapping local_id="rabbit-species" id="8b5a6e28-684f-4673-b1d2-19a0c9b044be" />
    <idMapping local_id="plant-species" id="6904840c-03f6-4f2d-b822-bc85aebe70db" />
  </idMap>
  <objects>
    <OTSystem>
      <bundles>
        <object refid="8d880970-c22a-11dc-95ff-0800200c9a66" />
        <OTViewBundle>
          <frame>
            <OTFrame useScrollPane="false" openMaximized="false" width="900" height="500" />
          </frame>
        </OTViewBundle>
        <OTScriptEngineBundle>
          <engines>
            <OTScriptEngineEntry objectClass="org.concord.otrunk.script.js.OTJavascript" engineClass="org.concord.otrunk.script.js.OTJavascriptEngine" />
          </engines>
        </OTScriptEngineBundle>
      </bundles>
      <includes>
        <OTInclude href="../global-imports/er-view-bundle.otml" />
        <OTInclude href="species/fast-plants-roots.otml" />
        <OTInclude href="species/varied-rabbits.otml" />
      </includes>
      <root>
        <OTCompoundDoc>
          <bodyText>
            <table>
              <tr>
                <td>
                  <object refid="${env-holder}" />
                </td>
                <td>
                  <b>Year: </b><br/><object refid="${year-text}" viewid="c93a7460-e18a-11dc-95ff-0800200c9a66"/>
                  <br/>
                  <br/>
                  <object refid="${dam-button}" />
                  <table>
                    <tr>
                      <td align="center">
                        <b>Water below the dam</b>
                        <br />
                        <br />
                        Lots of water
                        <br/>
                        <object refid="${water-slider}" hello="world" />
                        <br />
                        Little water
                        <br />
                      </td>
                      <td>
                        <table>
                          <tr>
                            <td height="40%">
                              <object refid="${bar-graph-top}" width="600" height="240"/>
                            </td>
                          </tr>
                          <tr>
                            <td>
                              <object refid="${bar-graph-bottom}" width="600" height="240"/>
                            </td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <object refid="${script}" />
                </td>
              </tr>
            </table>
          </bodyText>
          <documentRefs>
            <OTEnvironmentHolder local_id="env-holder" width="590" height="460" toolbar="run,reset,info" useSpeedSlider="false">
              <environment>
                <OTEnvironment local_id="environment" environmentWidth="25" environmentHeight="25" showRunButton="false" winterLength="5" summerLength="50" showWinterImage="false" orgSizeMultiplier="1.8" backgroundImageSrc="images/dam-year10.jpg">
                  <world>
                    <OTWorld local_id="peasimple_world" speciesPath="org/concord/biologica/worlds/peasimple.xml" />
                  </world>
                  <rules>
                    <OTRule description="roots 1 needs lots of water">
                      <conditions>
                        <OTRuleCondition property="species name" equals="Fast Plants" />
                        <OTRuleCondition property="roots" equalsValue="1.0" />
                      </conditions>
                      <consequences>
                        <!-- chance of survival is 1.0 at watdarn.er > 0.9, 0.8 at water < 0.5, and decreases linearly between -->
                        <OTRuleConsequence property="chance of survival" ruleScript="var distFrom90 = Math.max(0.9-water, 0.0); var dryness = Math.min(1.0, distFrom90/0.4);  return 1 - (dryness * 0.2)">
                          <propertyVariables>
                            <string>water</string>
                          </propertyVariables>
                        </OTRuleConsequence>
                        <!-- growth rate is 0.04 at water > 0.9, 0 at water < 0.5, and decreases linearly between  -->
                        <OTRuleConsequence property="growth rate" ruleScript="var distFrom90 = Math.max(0.9-water, 0.0); var dryness = Math.min(1.0, distFrom90/0.4); if (water &lt; 0.8) population_size_modifier = 0; return 0.04 - (dryness * .04) + population_size_modifier">
                          <propertyVariables>
                            <string>water</string>
                            <string>population size modifier</string>
                          </propertyVariables>
                        </OTRuleConsequence>
                      </consequences>
                    </OTRule>
                    <OTRule description="roots 2 needs medium of water">
                      <conditions>
                        <OTRuleCondition property="species name" equals="Fast Plants" />
                        <OTRuleCondition property="roots" equalsValue="2.0" />
                      </conditions>
                      <consequences>
                        <!-- chance of survival is 1.0 at water > 0.7, 0.8 at water < 0.3, and decreases linearly between -->
                        <OTRuleConsequence property="chance of survival" ruleScript="var distFrom70 = Math.max(0.7-water, 0.0); var dryness = Math.min(1.0, distFrom70/0.4); return 1 - (dryness * 0.2)">
                          <propertyVariables>
                            <string>water</string>
                          </propertyVariables>
                        </OTRuleConsequence>
                        <!-- growth rate is 0.04 at water > 0.7, 0 at water < 0.3, and decreases linearly between  -->
                        <OTRuleConsequence property="growth rate" ruleScript="var distFrom70 = Math.max(0.7-water, 0.0); var dryness = Math.min(1.0, distFrom70/0.4); if (water &lt; 0.6) population_size_modifier = 0; return 0.04 - (dryness * .04) + population_size_modifier">
                          <propertyVariables>
                            <string>water</string>
                            <string>population size modifier</string>
                          </propertyVariables>
                        </OTRuleConsequence>
                      </consequences>
                    </OTRule>
                    <OTRule description="roots e doesn't care">
                      <conditions>
                        <OTRuleCondition property="species name" equals="Fast Plants" />
                        <OTRuleCondition property="roots" equalsValue="3.0" />
                      </conditions>
                      <consequences>
                        <!-- growth rate is 0.04  -->
                        <OTRuleConsequence property="growth rate" ruleScript="return 0.04 + population_size_modifier">
                          <propertyVariables>
                            <string>population size modifier</string>
                          </propertyVariables>
                        </OTRuleConsequence>
                      </consequences>
                    </OTRule>
                    <OTRule description="roots 1 are short">
                      <conditions>
                        <OTRuleCondition property="roots" equalsValue="1.0" />
                      </conditions>
                      <consequences>
                        <OTRuleConsequence property="variety" newValueString="Short grass" />
                      </consequences>
                    </OTRule>
                    <OTRule description="roots 2 are medium">
                      <conditions>
                        <OTRuleCondition property="roots" equalsValue="2.0" />
                      </conditions>
                      <consequences>
                        <OTRuleConsequence property="variety" newValueString="Medium grass" />
                      </consequences>
                    </OTRule>
                    <OTRule description="roots 3 are big">
                      <conditions>
                        <OTRuleCondition property="roots" equalsValue="3.0" />
                      </conditions>
                      <consequences>
                        <OTRuleConsequence property="variety" newValueString="Big grass" />
                      </consequences>
                    </OTRule>
                    <OTRule description="small rabbits are small">
                      <conditions>
                        <OTRuleCondition property="prey variety value" equalsValue="1.0" />
                      </conditions>
                      <consequences>
                        <OTRuleConsequence property="variety" newValueString="Small rabbit" />
                      </consequences>
                    </OTRule>
                    <OTRule description="medium rabbits are medium">
                      <conditions>
                        <OTRuleCondition property="prey variety value" equalsValue="2.0" />
                      </conditions>
                      <consequences>
                        <OTRuleConsequence property="variety" newValueString="Medium rabbit" />
                      </consequences>
                    </OTRule>
                    <OTRule description="big rabbits are big">
                      <conditions>
                        <OTRuleCondition property="prey variety value" equalsValue="3.0" />
                      </conditions>
                      <consequences>
                        <OTRuleConsequence property="variety" newValueString="Big rabbit" />
                      </consequences>
                    </OTRule>
                  </rules>
                  <barriers>
                    <OTPlacement x="0" y="115" width="250" height="14" />
                  </barriers>
                </OTEnvironment>
              </environment>
              <traitsToShow>
                <string>variety</string>
              </traitsToShow>
            </OTEnvironmentHolder>
            <OTScriptObject local_id="script" name="Setup script">
              <script>
                <OTJavascript src="scripts/gradated-sunlight-five-blocks/setup.js">
                  <script>importPackage(Packages.java.lang);
                        importPackage(Packages.java.awt);
                        importPackage(Packages.java.awt.geom);
                        importPackage(Packages.java.net);
                        importPackage(Packages.org.concord.biologica.environment);
                        importPackage(Packages.org.concord.framework.otrunk);
                        
                        var damRemoved = false;
                        var startTime
                        var time
                        var previousTime
                        var isRunning = false
                        var recentlyChangedWater = true      // added a rabbit this past second
              
                        var CHANGE_WATER_RATE = 2;     // seconds before drying out environment
                        var currentWater = 0.0;
                        
                        var year;
                        var recentlyChangedYear;
                        
                        var lastBkgdUrl;
                        
                        
                        var baseUrl = otEnvHolder.getOTObjectService().getCodebase(otEnvHolder)

                        function init() {
                          env.removeAllAgents()
                          env.setStepCount(0)
                          envHolder.pauseAction()
                          env.setWrapNorthSouth(false)
                          env.setWrapEastWest(false)
                          
                          
                          var url = new URL(baseUrl, "images/dam-rv-year1.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url)
                          var url2 = new URL(baseUrl, "images/dam-rv-year2.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url2)
                          var url3 = new URL(baseUrl, "images/dam-rv-year3.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url3)
                          var url4 = new URL(baseUrl, "images/dam-rv-year4.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url4)
                          var url5 = new URL(baseUrl, "images/dam-rv-year5.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url5)
                          var url6 = new URL(baseUrl, "images/dam-rv-year6.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url6)
                          var url7 = new URL(baseUrl, "images/dam-rv-year7.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url7)
                          var url8 = new URL(baseUrl, "images/dam-rv-year8.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url8)
                          var url9 = new URL(baseUrl, "images/dam-rv-year9.png")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url9)
                          var url0 = new URL(baseUrl, "images/dam-year0.jpg")
                          envHolder.getEnvironmentView().addBackgroundImageUrl(url0)
                          
                          
                          env.addStepListener(stepListener)
                          env.addChangeListener(resetListener)
                          damButton.addOTChangeListener(damButtonListener)
                          
                          setup();
  
                          return true;
                        }
                        
                        function setup() {
                          var url = new URL(baseUrl, "images/dam-year10.jpg");
                          envHolder.getEnvironmentView().setBackgroundImageUrl(url);
                          lastBkgdUrl = url;
                          damRemoved = false
                          damButton.setEnabled(true);
                          
                          addPlants();
                          addRabbits();
                          
                          year = 1;
                          recentlyChangedYear = true;
                          yearText.setText("1");
                          
                          recentlyChangedWater = true
                          time = 0
                          previousTime = 0
                          
                          env.addBarrier(new Rectangle(0, 120, 250, 9));
                          
                          setPropertyOnEnvironment("water", 1.0, false)
                          setPropertyOnEnvironment("water", 0.0, true)
                          currentWater = 0.0
                          slider.setValue(0)
                          graphRabbits();
                        }
                        
                        function addPlants(){
                          for (var i=0; i &lt; 105; i++){
                            createPlant((i%3)+1, true);
                          }
                          for (var i=0; i &lt; 35; i++){
                            createPlant(3, false);
                          }
                        }
                        
                        function addRabbits(){
                          for (var i=0; i &lt; 60; i++){
                            createRabbit((i%3)+1, true);
                          }
                          for (var i=0; i &lt; 20; i++){
                            createRabbit(3, false);
                          }
                        }
                        
                        function createPlant(size, north) {
                          var newPlant = plantspecies.createAgent();
                          newPlant.setProperty("growth rate", 0.04)
                          newPlant.setProperty("age of maturity", 10)
                          newPlant.setProperty("population size modifier", 0)
                          newPlant.setProperty("roots", size)
                          var loc
                          if (north) {
                            loc = env.getRandomLocation(0, 0, 250, 125);
                          } else {
                            loc = env.getRandomLocation(0, 125, 250, 125);
                          }
                          newPlant.setEnvironment(env)
                          newPlant.setLocation(loc)
                          env.addAgent(newPlant)
                        }
                        
                        function createRabbit(size, north) {
                          var newRabbit = rabbitspecies.createAgent();
                          newRabbit.setAge(100)
                          newRabbit.setProperty("prey variety value", size)
                          var loc
                          if (north) {
                            loc = env.getRandomLocation(0, 0, 250, 125);
                          } else {
                            loc = env.getRandomLocation(0, 125, 250, 125);
                          }
                          newRabbit.setEnvironment(env)
                          newRabbit.setLocation(loc)
                          env.addAgent(newRabbit)
                        }
                        
                        var damButtonHandler =
												{
												    stateChanged: function(evt)
												    {
												      if (damButton.getClicked()){
												        removeDam();
												      }
												    }
												
												}
												var damButtonListener = new OTChangeListener(damButtonHandler)
                        
              function removeDam() {
                if (!damRemoved) {
                  damRemoved = true;
                  startTime = System.currentTimeMillis();
                  damButton.setEnabled(false);
                  makeWetter();
                  env.removeBarriers();
                }
              }
                        
              var stepHandler =
              {
                environmentStepped: function()
                {
                  if (damRemoved) {
                    updateTimer();
                    checkWaterUpdating();
                    checkYear();
                   }
                   setPlantGrowthRate();
                   graphRabbits();
                }
              }
              var stepListener = new EnvironmentStepListener(stepHandler)
              
              var resetRunHandler= {
                  environmentChanged: function(evt){
                   graphRabbits();
                    if (evt.getType() == EnvironmentChangeEvent.RESET){
                      isRunning = false
                      setup()
                    } else if (evt.getType() == EnvironmentChangeEvent.RUN){
                      isRunning = true
                      if (damRemoved) { 
                        startTime = System.currentTimeMillis()
                       }
                    } else if (evt.getType() == EnvironmentChangeEvent.PAUSE){
                      previousTime = time;
                    }
                  }
                }
                      
              var resetListener = new EnvironmentChangeListener(resetRunHandler)
              
              function updateTimer(){
                timeSinceLastStart = System.currentTimeMillis() - startTime;
                time =  previousTime + timeSinceLastStart;
              }
              
              function checkYear(){
                seconds = Math.floor(time / 1000);
                if (seconds % 4 == 0){
                  if (!recentlyChangedYear){
                    year++;
                    yearText.setText(year);
                    recentlyChangedYear = true;
                    if (year == 25) {
                      showMessage("Look at the field and the graphs. Was your prediction correct?\nGo to the next page to explain what happened!", env, envHolder)
                      envHolder.pauseAction();
                    }
                  }
                } else {
                  recentlyChangedYear = false;
                }
              }
              
              function checkWaterUpdating(){
                seconds = Math.floor(time / 1000);
                if (seconds % CHANGE_WATER_RATE == 0){
                  if (!recentlyChangedWater) {
                    recentlyChangedWater = true;
                    makeWetter();
                  }
                } else {
                  recentlyChangedWater = false;
                }
              }
              
              function makeWetter() {
                if (currentWater &lt; 1.0){
                  currentWater += 0.02;
                }
                setPropertyOnEnvironment("water", currentWater, true);
                slider.setValue(currentWater * 100);
                
                if (currentWater &gt; 0.95){
                  var url = new URL(baseUrl, "images/dam-year0.jpg")
                } else if (currentWater &gt; 0.9){
                  var url = new URL(baseUrl, "images/dam-rv-year9.png")
                } else if (currentWater &gt; 0.8){
                  var url = new URL(baseUrl, "images/dam-rv-year9.png")
                } else if (currentWater &gt; 0.7){
                  var url = new URL(baseUrl, "images/dam-rv-year8.png")
                }else if (currentWater &gt; 0.6){
                  var url = new URL(baseUrl, "images/dam-rv-year7.png")
                }else if (currentWater &gt; 0.5){
                  var url = new URL(baseUrl, "images/dam-rv-year6.png")
                }else if (currentWater &gt; 0.4){
                  var url = new URL(baseUrl, "images/dam-rv-year5.png")
                }else if (currentWater &gt; 0.3){
                  var url = new URL(baseUrl, "images/dam-rv-year4.png")
                }else if (currentWater &gt; 0.2){
                  var url = new URL(baseUrl, "images/dam-rv-year3.png")
                }else if (currentWater &gt; 0.1){
                  var url = new URL(baseUrl, "images/dam-rv-year2.png")
                }else if (currentWater &gt; 0.01){
                  var url = new URL(baseUrl, "images/dam-rv-year1.png")
                }else {
                  var url = new URL(baseUrl, "images/dam-year10.jpg")
                }
                
                if (!url.equals(lastBkgdUrl)) {
                  envHolder.getEnvironmentView().setBackgroundImageUrl(url)
                  lastBkgdUrl = url;
                 }
              }
                        
                        function setPropertyOnEnvironment(prop, val, halfOnly){
                            var cols = env.getColumns();
                            var rows = env.getRows();
                            var startRow = halfOnly ? rows/2 : 0;
                            for (var i = 0; i &lt; cols; i++) {
                              for (var j = startRow; j &lt; rows; j++) {
                                env.getEnvironmentUnit(i,j).setProperty(prop, new Float(val))
                              }
                            }
                        }
                        
function graphRabbits(){
  var allRabbits = env.getAgents(rabbitspecies); 
  var varieties = [[], [], [], [], [], []];
  for (var i = 0; i &lt; allRabbits.size(); i++){
    var rabbit = allRabbits.get(i);
    var rootSize = rabbit.getProperty("prey variety value");
    var adder = (rabbit.getLocation().y &gt; 125) ? 3 : 0;
    varieties[((rootSize - 1) + adder)].push(rabbit);
  }
  
 dataStore1.setValues(2, [1, varieties[0].length, 2, varieties[1].length, 3, varieties[2].length]);
 dataStore2.setValues(2, [1, varieties[3].length, 2, varieties[4].length, 3, varieties[5].length]);
}
                        
function setPlantGrowthRate(){
  var allPlants = env.getAgents(plantspecies); 
  var varieties = [[], [], [], [], [], []];
  for (var i = 0; i &lt; allPlants.size(); i++){
    var plant = allPlants.get(i);
    var rootSize = plant.getProperty("roots");
    var adder = (plant.getLocation().y &gt; 125) ? 3 : 0;
    varieties[((rootSize - 1) + adder)].push(plant);
  }
  
  
  //  System.out.println(":" + varieties[0].length + ", " + varieties[1].length + ", " +  varieties[2].length + ":" + varieties[3].length + ", " + varieties[4].length + ", " +  varieties[5].length);
  
  for (var i = 0; i &lt; 6; i++){
    setGrowthRateForVariety(varieties[i]);
  }
}
                        
function setGrowthRateForVariety(plants)
{
  var plantSize = plants.length;
  var populationSizeModifier = 0.0;
  if (plantSize &lt; 10) {
    populationSizeModifier = 0.6;
  } else if (plantSize &lt; 15) {
    populationSizeModifier = 0.3;
  } else if (plantSize &lt; 40) {
    populationSizeModifier = 0.1;
  } else if (plantSize &lt; 60) {
    populationSizeModifier = 0.0;
  } else if (plantSize &lt; 160) {
    populationSizeModifier = -0.02;
  } else if (plantSize &lt; 190) {
    populationSizeModifier = -0.03;
  } else if (plantSize &lt; 230) {
    populationSizeModifier = -0.05;
  }
  
  for (var i = 0; i &lt; plantSize; i++){
    plants[i].setProperty("population size modifier", populationSizeModifier);
  }
}

                        function save() {
                          return true;
                        }</script>
                  <scripts>
                    <OTJavascript src="scripts/common/message.js" />
                  </scripts>
                </OTJavascript>
              </script>
              <variables>
                <OTScriptVariableRealObject name="env">
                  <reference>
                    <object refid="${environment}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariableRealObject name="envHolder">
                  <reference>
                    <object refid="${env-holder}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariable name="otEnvHolder">
                  <reference>
                    <object refid="${env-holder}" />
                  </reference>
                </OTScriptVariable>
                <OTScriptVariableRealObject name="holder">
                  <reference>
                    <object refid="${env-holder}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariable name="slider">
                  <reference>
                    <object refid="${water-slider}" />
                  </reference>
                </OTScriptVariable>
                <OTScriptVariable name="damButton">
                  <reference>
                    <object refid="${dam-button}" />
                  </reference>
                </OTScriptVariable>
                <OTScriptVariableRealObject name="rabbitspecies">
                  <reference>
                    <object refid="${rabbit-species}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariableRealObject name="plantspecies">
                  <reference>
                    <object refid="${plant-species}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariableRealObject name="dataStore1">
                  <reference>
                    <object refid="${datastore1}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariableRealObject name="dataStore2">
                  <reference>
                    <object refid="${datastore2}" />
                  </reference>
                </OTScriptVariableRealObject>
                <OTScriptVariable name="yearText">
                  <reference>
                    <object refid="${year-text}" />
                  </reference>
                </OTScriptVariable>
              </variables>
              <scriptState />
            </OTScriptObject>
            <OTProgressBar local_id="water-slider" minimum="-5" maximum="100" value="0" vertical="true" />
            <OTButton local_id="dam-button" text="Remove the Dam" enabled="true" />
            <OTDataGraph title="Rabbits in top half of field" local_id="bar-graph-top" showToolbar="false">
				      <graphables>
						    <OTDataBarGraphable local_id="graphable1" lineWidth="30" maxBarsToSelect="0">
						          <dataStore>
						            <OTDataStore local_id="datastore1" numberChannels="2">
								          <channelDescriptions>
								            <OTDataChannelDescription name="Rabbit types" precision="0"/>
								            <OTDataChannelDescription name="Number of rabbits" precision="2"/>
								          </channelDescriptions>
								          <valuesString></valuesString>
								        </OTDataStore>
						          </dataStore>
						    </OTDataBarGraphable>
				      </graphables>
		          <xDataAxis>
		            <OTDataAxis min="0" max="3.5" label="Rabbit types" intervalWorld="1">
                  <customGridLabels>
                    <entry key="1.0"><string>Small::http://otrunk.concord.org/examples/EvolutionReadiness/models/species/images/smallbunny.gif</string></entry>
                    <entry key="2.0"><string>Medium::http://otrunk.concord.org/examples/EvolutionReadiness/models/species/images/medbunny.gif</string></entry>
                    <entry key="3.0"><string>Large::http://otrunk.concord.org/examples/EvolutionReadiness/models/species/images/bigbunny.gif</string></entry>
                  </customGridLabels>
                 </OTDataAxis>
		          </xDataAxis>
		          <yDataAxis>
		            <OTDataAxis min="0" max="50" label="Number of rabbits"/>
		          </yDataAxis>
				    </OTDataGraph>
				    <OTDataGraph title="Rabbits in bottom half of field" local_id="bar-graph-bottom" showToolbar="false" aspectRatio="0.2">
              <graphables>
                <OTDataBarGraphable local_id="graphable2" lineWidth="30" maxBarsToSelect="0">
                      <dataStore>
                        <OTDataStore local_id="datastore2" numberChannels="2">
                          <channelDescriptions>
                            <OTDataChannelDescription name="Rabbit types" precision="0"/>
                            <OTDataChannelDescription name="Number of rabbits" precision="2"/>
                          </channelDescriptions>
                          <valuesString></valuesString>
                        </OTDataStore>
                      </dataStore>
                </OTDataBarGraphable>
              </graphables>
              <xDataAxis>
                <OTDataAxis min="0" max="4" label="Rabbit types" intervalWorld="1">
                  <customGridLabels>
                    <entry key="1.0"><string>Small::http://otrunk.concord.org/examples/EvolutionReadiness/models/species/images/smallbunny.gif</string></entry>
                    <entry key="2.0"><string>Medium::http://otrunk.concord.org/examples/EvolutionReadiness/models/species/images/medbunny.gif</string></entry>
                    <entry key="3.0"><string>Large::http://otrunk.concord.org/examples/EvolutionReadiness/models/species/images/bigbunny.gif</string></entry>
                  </customGridLabels>
                 </OTDataAxis>
              </xDataAxis>
              <yDataAxis>
                <OTDataAxis min="0" max="50" label="Number of rabbits"/>
              </yDataAxis>
            </OTDataGraph>
            <OTText local_id="year-text" text="2010"/>
          </documentRefs>
        </OTCompoundDoc>
      </root>
    </OTSystem>
  </objects>
</otrunk>

