<?xml version="1.0" encoding="UTF-8"?>
<metaabm:SContext xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:act="http://metaabm.org/act" xmlns:function="http://metaabm.org/function" xmlns:metaabm="http://metaabm.org/metaabm.org/structure" label="PreyPredator" ID="preyPredator" pluralLabel="PreyPredators">
  <attributes label="Prey Agent Count" ID="preyAgentCount" pluralLabel="Prey Agent Counts" description="The number of prey agents to create." sType="INTEGER" gatherData="true" defaultValue="100"/>
  <attributes label="Predator Agent Count" ID="predatorAgentCount" pluralLabel="Predator Agent Counts" description="The number of predator agents to create." sType="INTEGER" gatherData="true" defaultValue="20"/>
  <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
    <members xsi:type="act:ABuild" label="Build PreyPredator" ID="buildPreyPredator" targets="//@rootActivity/@members[ID='createPreyAgents'] //@rootActivity/@members[ID='createPredatorAgents'] //@rootActivity/@members[ID='buildGrid2D']" selected="//@rootActivity/@members[ID='buildPreyPredator']" agent="/" pluralLabel="Build PreyPredators"/>
    <members xsi:type="act:ACreateAgents" label="Create Prey Agents" ID="createPreyAgents" sources="//@rootActivity/@members[ID='buildPreyPredator']" selected="//@rootActivity/@members[ID='buildPreyPredator']" agent="//@agents[ID='preyAgent']" agentCount="//@attributes[ID='preyAgentCount']"/>
    <members xsi:type="act:ACreateAgents" label="Create Predator Agents" ID="createPredatorAgents" sources="//@rootActivity/@members[ID='buildPreyPredator']" selected="//@rootActivity/@members[ID='buildPreyPredator']" agent="//@agents[ID='predatorAgent']" agentCount="//@attributes[ID='predatorAgentCount']"/>
    <members xsi:type="act:ABuildGrid" label="Build Grid 2D" ID="buildGrid2D" sources="//@rootActivity/@members[ID='buildPreyPredator']" selected="//@rootActivity/@members[ID='buildPreyPredator']" pluralLabel="Build Grid 2Ds" agents="//@agents[ID='predatorAgent'] //@agents[ID='preyAgent']" projection="//@projections[ID='grid2D']" fillAgent="//@agents[ID='habitat']"/>
  </rootActivity>
  <implementation package="preypredator" className="PreyPredator" basePath=""/>
  <agents label="Prey Agent" ID="preyAgent" pluralLabel="Prey Agents">
    <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
      <members xsi:type="act:AInitialize" label="Initialize" ID="initialize" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='preyAgent']" space="//@projections[ID='grid2D']" pluralLabel="Initializes"/>
      <members xsi:type="act:ASelect" label="Random Habitat" ID="randomHabitat" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AEvaluate" label="Random Habitat: Available()" ID="randomHabitatAvailable" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='movePreyAgent']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='available']"/>
      </members>
      <members xsi:type="act:AMove" label="Move Prey Agent" ID="movePreyAgent" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='initialize']" destination="//@agents[ID='preyAgent']/@rootActivity/@members[ID='randomHabitat']"/>
      <members xsi:type="act:ARule" label="Prey Agent Rule" ID="preyAgentRule" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='nearbySpace']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='preyAgentRule']" agent="//@agents[ID='preyAgent']" space="//@projections[ID='grid2D']" pluralLabel="Prey Agent Rules"/>
      <members xsi:type="act:ASelect" label="Nearby Space" ID="nearbySpace" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='preyAgentRule']" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='nearbySpaceAvailable']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='preyAgentRule']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AEvaluate" label="Nearby Space: Available()" ID="nearbySpaceAvailable" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='nearbySpace']" targets="//@agents[ID='preyAgent']/@rootActivity/@members[ID='movePreyAgentCopy']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='nearbySpace']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='available']"/>
      </members>
      <members xsi:type="act:AMove" label="Move Prey Agent Copy" ID="movePreyAgentCopy" sources="//@agents[ID='preyAgent']/@rootActivity/@members[ID='nearbySpaceAvailable']" selected="//@agents[ID='preyAgent']/@rootActivity/@members[ID='preyAgentRule']" destination="//@agents[ID='preyAgent']/@rootActivity/@members[ID='nearbySpace']"/>
    </rootActivity>
    <implementation className="PreyAgent"/>
    <styles xsi:type="metaabm:SStyle2D" label="Prey Agent Style 2D" ID="preyAgentStyle2D" pluralLabel="Prey Agent Style 2Ds">
      <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
        <members xsi:type="act:ARule" label="Prey Agent Rule" ID="preyAgentRule" targets="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleColorBlue']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']" agent="//@agents[ID='preyAgent']" space="//@projections[ID='grid2D']" pluralLabel="Prey Agent Rules"/>
        <members xsi:type="act:AEvaluate" label="Prey Agent Rule: Color Blue()" ID="preyAgentRuleColorBlue" sources="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']" targets="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleShapeOval']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='colorBlue']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Prey Agent Rule: Shape Oval()" ID="preyAgentRuleShapeOval" sources="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleColorBlue']" targets="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleShapeMarker']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeOval']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Prey Agent Rule: Shape Marker()" ID="preyAgentRuleShapeMarker" sources="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRuleShapeOval']" selected="//@agents[ID='preyAgent']/@styles[ID='preyAgentStyle2D']/@rootActivity/@members[ID='preyAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeMarker']"/>
        </members>
      </rootActivity>
      <implementation className="PreyAgentStyle2D"/>
    </styles>
  </agents>
  <agents label="Predator Agent" ID="predatorAgent" pluralLabel="Predator Agents">
    <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
      <members xsi:type="act:AInitialize" label="Initialize" ID="initialize" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']" pluralLabel="Initializes"/>
      <members xsi:type="act:ASelect" label="Random Habitat" ID="randomHabitat" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AEvaluate" label="Random Habitat: Available()" ID="randomHabitatAvailable" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='movePredatorAgent']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='available']"/>
      </members>
      <members xsi:type="act:AMove" label="Move Predator Agent" ID="movePredatorAgent" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitatAvailable']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='initialize']" destination="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='randomHabitat']"/>
      <members xsi:type="act:ARule" label="Predator Agent Rule" ID="predatorAgentRule" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearbySpace']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']" pluralLabel="Predator Agent Rules"/>
      <members xsi:type="act:ASelect" label="Nearby Space" ID="nearbySpace" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearbySpaceAvailable']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']"/>
      <members xsi:type="act:AEvaluate" label="Nearby Space: Available()" ID="nearbySpaceAvailable" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearbySpace']" targets="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='movePredatorAgentCopy']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearbySpace']">
        <function xsi:type="function:FGenericLogical" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='spatial']/@functions[ID='available']"/>
      </members>
      <members xsi:type="act:AMove" label="Move Predator Agent Copy" ID="movePredatorAgentCopy" sources="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearbySpaceAvailable']" selected="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='predatorAgentRule']" destination="//@agents[ID='predatorAgent']/@rootActivity/@members[ID='nearbySpace']"/>
    </rootActivity>
    <implementation className="PredatorAgent"/>
    <styles xsi:type="metaabm:SStyle2D" label="Predator Agent Style 2D" ID="predatorAgentStyle2D" pluralLabel="Predator Agent Style 2Ds">
      <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
        <members xsi:type="act:ARule" label="Predator Agent Rule" ID="predatorAgentRule" targets="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleColorRed']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']" agent="//@agents[ID='predatorAgent']" space="//@projections[ID='grid2D']" pluralLabel="Predator Agent Rules"/>
        <members xsi:type="act:AEvaluate" label="Predator Agent Rule: Color Red()" ID="predatorAgentRuleColorRed" sources="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']" targets="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleShapeOval']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='colorRed']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Predator Agent Rule: Shape Oval()" ID="predatorAgentRuleShapeOval" sources="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleColorRed']" targets="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleGraphicFill']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeOval']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Predator Agent Rule: Graphic Fill()" ID="predatorAgentRuleGraphicFill" sources="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRuleShapeOval']" selected="//@agents[ID='predatorAgent']/@styles[ID='predatorAgentStyle2D']/@rootActivity/@members[ID='predatorAgentRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='graphicFill']"/>
        </members>
      </rootActivity>
      <implementation className="PredatorAgentStyle2D"/>
    </styles>
  </agents>
  <agents label="Habitat" ID="habitat" pluralLabel="Habitats">
    <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups"/>
    <implementation className="Habitat"/>
    <styles xsi:type="metaabm:SStyle2D" label="Habitat Style 2D" ID="habitatStyle2D" pluralLabel="Habitat Style 2Ds">
      <rootActivity xsi:type="act:AGroup" label="Root Act Group" ID="rootActGroup" pluralLabel="Root Act Groups">
        <members xsi:type="act:ARule" label="Habitat Rule" ID="habitatRule" targets="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleColorGreen']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']" agent="//@agents[ID='habitat']" space="//@projections[ID='grid2D']" pluralLabel="Habitat Rules"/>
        <members xsi:type="act:AEvaluate" label="Habitat Rule: Color Green()" ID="habitatRuleColorGreen" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']" targets="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleShapeRectangle']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='colorGreen']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Habitat Rule: Shape Rectangle()" ID="habitatRuleShapeRectangle" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleColorGreen']" targets="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleGraphicFill']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='shapeRectangle']"/>
        </members>
        <members xsi:type="act:AEvaluate" label="Habitat Rule: Graphic Fill()" ID="habitatRuleGraphicFill" sources="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRuleShapeRectangle']" selected="//@agents[ID='habitat']/@styles[ID='habitatStyle2D']/@rootActivity/@members[ID='habitatRule']">
          <function xsi:type="function:FGenericFunction" href="http://metaabm.org/core_library.metaabm#//@library[ID='coreFunctions']/@subs[ID='graphic']/@functions[ID='graphicFill']"/>
        </members>
      </rootActivity>
      <implementation className="HabitatStyle2D"/>
    </styles>
  </agents>
  <projections xsi:type="metaabm:SGrid" label="Grid 2D" ID="grid2D" pluralLabel="Grid 2Ds" dimensionality="2" borderRule="PERIODIC">
    <attributes xsi:type="metaabm:SAttributeArray" label="Dimensions" ID="dimensions" pluralLabel="Dimensionss" description="The size of each dimension." sType="INTEGER" size="2"/>
    <attributes label="Width" ID="width" pluralLabel="Widths" description="The horizontal extent of the space." sType="INTEGER" defaultValue="100"/>
    <attributes label="Height" ID="height" pluralLabel="Heights" description="The vertical extent of the space." sType="INTEGER" defaultValue="100"/>
  </projections>
</metaabm:SContext>