Newer
Older
ecologia / doc / javadoc / model / Animal.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_111) on Mon Dec 19 20:43:55 CET 2016 -->
<title>Animal</title>
<meta name="date" content="2016-12-19">
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
<script type="text/javascript" src="../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="Animal";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Ecologia</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../model/Carnivore.html" title="class in model"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?model/Animal.html" target="_top">Frames</a></li>
<li><a href="Animal.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">model</div>
<h2 title="Class Animal" class="title">Class Animal</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>model.Animal</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../model/Carnivore.html" title="class in model">Carnivore</a>, <a href="../model/Herbivore.html" title="class in model">Herbivore</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">Animal</span>
extends java.lang.Object</pre>
<div class="block">This is the superclass of all animal classes. It holds common methods
 needed by all animals.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#age">age</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#attemptedMovesThisTurn">attemptedMovesThisTurn</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#energy">energy</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#exhaustion">exhaustion</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#generation">generation</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../model/Genome.html" title="class in model">Genome</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#genome">genome</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#gestationPeriod">gestationPeriod</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#IDnumber">IDnumber</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#isAlive">isAlive</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#movesThisTurn">movesThisTurn</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#offspring">offspring</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#parent">parent</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.util.Random</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#random">random</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#type">type</a></span></code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#x">x</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#y">y</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../model/Animal.html#Animal-int-controller.OccupantType-model.Genome-int-int-int-int-int-">Animal</a></span>(int&nbsp;setID,
      <a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;myType,
      <a href="../model/Genome.html" title="class in model">Genome</a>&nbsp;newGenome,
      int&nbsp;myGeneration,
      int&nbsp;setX,
      int&nbsp;setY,
      int&nbsp;setEnergy,
      int&nbsp;parentID)</code>
<div class="block">The constructor.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#changeEnergy-int-">changeEnergy</a></span>(int&nbsp;amount)</code>
<div class="block">Change the energy level of this animal.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#closestSearch-controller.OccupantType-">closestSearch</a></span>(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</code>
<div class="block">Search for the inputed object within the line of sight.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#exhaust-int-">exhaust</a></span>(int&nbsp;e)</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getAge--">getAge</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../model/Direction.html" title="enum in model">Direction</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getDirection-int-int-">getDirection</a></span>(int&nbsp;xpos,
            int&nbsp;ypos)</code>
<div class="block">In which direction are the given coordinates relative to this animal?</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getDistance-int-int-">getDistance</a></span>(int&nbsp;xpos,
           int&nbsp;ypos)</code>
<div class="block">How many steps are needed to get to the specified position?</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getEnergy--">getEnergy</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getGeneration--">getGeneration</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../model/Genome.html" title="class in model">Genome</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getGenome--">getGenome</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getID--">getID</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>java.util.HashMap&lt;java.lang.String,java.lang.Integer&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getInfo--">getInfo</a></span>()</code>
<div class="block">Return a hash map containing all the information about this animal.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getNeighbouringField-model.Direction-">getNeighbouringField</a></span>(<a href="../model/Direction.html" title="enum in model">Direction</a>&nbsp;dir)</code>
<div class="block">Calculate the neighbouring square in the specified direction
 (return null if out of bounds)</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getOffspring--">getOffspring</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getParent--">getParent</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getType--">getType</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getX--">getX</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#getY--">getY</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#isAlive--">isAlive</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#mixedSearch-controller.OccupantType-">mixedSearch</a></span>(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</code>
<div class="block">Search for the inputed object within the line of sight.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#move-model.Direction-">move</a></span>(<a href="../model/Direction.html" title="enum in model">Direction</a>&nbsp;dir)</code>
<div class="block">The animal moves in the specified direction.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#randomizedSearch-controller.OccupantType-">randomizedSearch</a></span>(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</code>
<div class="block">Search for the inputed object within the line of sight.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#reproduce--">reproduce</a></span>()</code>
<div class="block">The animal reproduces, setting down a child on a neighbouring square</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>int[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#search-controller.OccupantType-">search</a></span>(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</code>
<div class="block">Search for the inputed object within the line of sight.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#setAge-int-">setAge</a></span>(int&nbsp;newAge)</code>&nbsp;</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#setEnergy-int-">setEnergy</a></span>(int&nbsp;newEnergy)</code>&nbsp;</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#setPosition-int-int-">setPosition</a></span>(int&nbsp;newX,
           int&nbsp;newY)</code>&nbsp;</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../model/Animal.html#update--">update</a></span>()</code>
<div class="block">This method has to be called by every species.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="IDnumber">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>IDnumber</h4>
<pre>protected&nbsp;int IDnumber</pre>
</li>
</ul>
<a name="parent">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parent</h4>
<pre>protected&nbsp;int parent</pre>
</li>
</ul>
<a name="genome">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>genome</h4>
<pre>protected&nbsp;<a href="../model/Genome.html" title="class in model">Genome</a> genome</pre>
</li>
</ul>
<a name="generation">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generation</h4>
<pre>protected&nbsp;int generation</pre>
</li>
</ul>
<a name="offspring">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>offspring</h4>
<pre>protected&nbsp;int offspring</pre>
</li>
</ul>
<a name="type">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>type</h4>
<pre>protected&nbsp;<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a> type</pre>
</li>
</ul>
<a name="x">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>x</h4>
<pre>protected&nbsp;int x</pre>
</li>
</ul>
<a name="y">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>y</h4>
<pre>protected&nbsp;int y</pre>
</li>
</ul>
<a name="age">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>age</h4>
<pre>protected&nbsp;int age</pre>
</li>
</ul>
<a name="energy">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>energy</h4>
<pre>protected&nbsp;int energy</pre>
</li>
</ul>
<a name="movesThisTurn">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>movesThisTurn</h4>
<pre>protected&nbsp;int movesThisTurn</pre>
</li>
</ul>
<a name="attemptedMovesThisTurn">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>attemptedMovesThisTurn</h4>
<pre>protected&nbsp;int attemptedMovesThisTurn</pre>
</li>
</ul>
<a name="exhaustion">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exhaustion</h4>
<pre>protected&nbsp;int exhaustion</pre>
</li>
</ul>
<a name="gestationPeriod">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>gestationPeriod</h4>
<pre>protected&nbsp;int gestationPeriod</pre>
</li>
</ul>
<a name="isAlive">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAlive</h4>
<pre>protected&nbsp;boolean isAlive</pre>
</li>
</ul>
<a name="random">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>random</h4>
<pre>protected&nbsp;java.util.Random random</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="Animal-int-controller.OccupantType-model.Genome-int-int-int-int-int-">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Animal</h4>
<pre>public&nbsp;Animal(int&nbsp;setID,
              <a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;myType,
              <a href="../model/Genome.html" title="class in model">Genome</a>&nbsp;newGenome,
              int&nbsp;myGeneration,
              int&nbsp;setX,
              int&nbsp;setY,
              int&nbsp;setEnergy,
              int&nbsp;parentID)</pre>
<div class="block">The constructor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>setID</code> - </dd>
<dd><code>myType</code> - </dd>
<dd><code>newGenome</code> - </dd>
<dd><code>myGeneration</code> - </dd>
<dd><code>setX</code> - </dd>
<dd><code>setY</code> - </dd>
<dd><code>setEnergy</code> - </dd>
<dd><code>parentID</code> - </dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="update--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>public&nbsp;void&nbsp;update()</pre>
<div class="block">This method has to be called by every species.</div>
</li>
</ul>
<a name="reproduce--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reproduce</h4>
<pre>public&nbsp;void&nbsp;reproduce()</pre>
<div class="block">The animal reproduces, setting down a child on a neighbouring square</div>
</li>
</ul>
<a name="move-model.Direction-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>move</h4>
<pre>public&nbsp;boolean&nbsp;move(<a href="../model/Direction.html" title="enum in model">Direction</a>&nbsp;dir)</pre>
<div class="block">The animal moves in the specified direction.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>success</dd>
</dl>
</li>
</ul>
<a name="search-controller.OccupantType-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>search</h4>
<pre>public&nbsp;int[]&nbsp;search(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</pre>
<div class="block">Search for the inputed object within the line of sight.</div>
</li>
</ul>
<a name="randomizedSearch-controller.OccupantType-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>randomizedSearch</h4>
<pre>public&nbsp;int[]&nbsp;randomizedSearch(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</pre>
<div class="block">Search for the inputed object within the line of sight.
 The returned coordinates are chosen at random from a list of eligible ones.</div>
</li>
</ul>
<a name="closestSearch-controller.OccupantType-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>closestSearch</h4>
<pre>public&nbsp;int[]&nbsp;closestSearch(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</pre>
<div class="block">Search for the inputed object within the line of sight.
 Finds the object closest to the individual.</div>
</li>
</ul>
<a name="mixedSearch-controller.OccupantType-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mixedSearch</h4>
<pre>public&nbsp;int[]&nbsp;mixedSearch(<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;type)</pre>
<div class="block">Search for the inputed object within the line of sight.
 A random target is chosen out of a list of targets closest to the individual.</div>
</li>
</ul>
<a name="getNeighbouringField-model.Direction-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNeighbouringField</h4>
<pre>public&nbsp;int[]&nbsp;getNeighbouringField(<a href="../model/Direction.html" title="enum in model">Direction</a>&nbsp;dir)</pre>
<div class="block">Calculate the neighbouring square in the specified direction
 (return null if out of bounds)</div>
</li>
</ul>
<a name="getDirection-int-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDirection</h4>
<pre>public&nbsp;<a href="../model/Direction.html" title="enum in model">Direction</a>&nbsp;getDirection(int&nbsp;xpos,
                              int&nbsp;ypos)</pre>
<div class="block">In which direction are the given coordinates relative to this animal?</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>xpos</code> - </dd>
<dd><code>ypos</code> - </dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Direction</dd>
</dl>
</li>
</ul>
<a name="getDistance-int-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDistance</h4>
<pre>public&nbsp;int&nbsp;getDistance(int&nbsp;xpos,
                       int&nbsp;ypos)</pre>
<div class="block">How many steps are needed to get to the specified position?</div>
</li>
</ul>
<a name="getInfo--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInfo</h4>
<pre>public&nbsp;java.util.HashMap&lt;java.lang.String,java.lang.Integer&gt;&nbsp;getInfo()</pre>
<div class="block">Return a hash map containing all the information about this animal.</div>
</li>
</ul>
<a name="isAlive--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAlive</h4>
<pre>public&nbsp;boolean&nbsp;isAlive()</pre>
</li>
</ul>
<a name="getID--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getID</h4>
<pre>public&nbsp;long&nbsp;getID()</pre>
</li>
</ul>
<a name="getGenome--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGenome</h4>
<pre>public&nbsp;<a href="../model/Genome.html" title="class in model">Genome</a>&nbsp;getGenome()</pre>
</li>
</ul>
<a name="getGeneration--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getGeneration</h4>
<pre>public&nbsp;int&nbsp;getGeneration()</pre>
</li>
</ul>
<a name="getParent--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getParent</h4>
<pre>public&nbsp;int&nbsp;getParent()</pre>
</li>
</ul>
<a name="getOffspring--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getOffspring</h4>
<pre>public&nbsp;int&nbsp;getOffspring()</pre>
</li>
</ul>
<a name="getType--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getType</h4>
<pre>public&nbsp;<a href="../controller/OccupantType.html" title="enum in controller">OccupantType</a>&nbsp;getType()</pre>
</li>
</ul>
<a name="getX--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getX</h4>
<pre>public&nbsp;int&nbsp;getX()</pre>
</li>
</ul>
<a name="getY--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getY</h4>
<pre>public&nbsp;int&nbsp;getY()</pre>
</li>
</ul>
<a name="getAge--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAge</h4>
<pre>public&nbsp;int&nbsp;getAge()</pre>
</li>
</ul>
<a name="getEnergy--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnergy</h4>
<pre>public&nbsp;int&nbsp;getEnergy()</pre>
</li>
</ul>
<a name="changeEnergy-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>changeEnergy</h4>
<pre>public&nbsp;void&nbsp;changeEnergy(int&nbsp;amount)</pre>
<div class="block">Change the energy level of this animal. If it dips to <= 0, the animal
 dies and is removed. This is a convenience wrapper method around
 setEnergy().</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>amount</code> - </dd>
</dl>
</li>
</ul>
<a name="setEnergy-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setEnergy</h4>
<pre>public&nbsp;void&nbsp;setEnergy(int&nbsp;newEnergy)</pre>
</li>
</ul>
<a name="setAge-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAge</h4>
<pre>public&nbsp;void&nbsp;setAge(int&nbsp;newAge)</pre>
</li>
</ul>
<a name="setPosition-int-int-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setPosition</h4>
<pre>public&nbsp;void&nbsp;setPosition(int&nbsp;newX,
                        int&nbsp;newY)</pre>
</li>
</ul>
<a name="exhaust-int-">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>exhaust</h4>
<pre>public&nbsp;void&nbsp;exhaust(int&nbsp;e)</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../deprecated-list.html">Deprecated</a></li>
<li><a href="../index-all.html">Index</a></li>
<li><a href="../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">Ecologia</div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev&nbsp;Class</li>
<li><a href="../model/Carnivore.html" title="class in model"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../index.html?model/Animal.html" target="_top">Frames</a></li>
<li><a href="Animal.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>