org.primordion.user.app.WolfSheepGrass
Class WolfSheep

java.lang.Object
  extended byorg.primordion.xholon.base.Xholon
      extended byorg.primordion.xholon.base.XholonWithPorts
          extended byorg.primordion.xholon.base.Turtle
              extended byorg.primordion.user.app.WolfSheepGrass.WolfSheep
All Implemented Interfaces:
CeWolfSheepGrass, ITurtle, IXholon

public class WolfSheep
extends Turtle
implements CeWolfSheepGrass

Wolf Sheep Grass.

Since:
0.5 (Created on March 1, 2007)
Author:
Ken Webb
See Also:
original NetLogo wolf sheep predation model is: Copyright 1998 Uri Wilensky. All rights reserved. See http://ccl.northwestern.edu/netlogo/models/WolfSheepPredation for terms of use.

Field Summary
static int COMMANDID_HATCH
           
 double energy
           
static int initialNumberSheep
           
static int initialNumberWolves
           
 boolean isGrabbed
           
static double sheepGainFromFood
           
static double sheepReproduce
           
static double wolfGainFromFood
           
static double wolfReproduce
           
 
Fields inherited from class org.primordion.xholon.base.Turtle
color, heading, isHidden, penMode, xcor, ycor
 
Fields inherited from class org.primordion.xholon.base.XholonWithPorts
port
 
Fields inherited from class org.primordion.xholon.base.Xholon
DEFAULT_LEVEL, interaction, interactionsEnabled
 
Fields inherited from interface org.primordion.user.app.WolfSheepGrass.CeWolfSheepGrass
AggregatorCE, GrassCE, includeCE, PatchOwnerCE, RowCE, SheepCE, TheSystemCE, TurtleCE, TurtleObserverCE, WolfCE, XholonClassCE
 
Fields inherited from interface org.primordion.xholon.base.ITurtle
COMMANDID_NONE, FILTERID_NONE, PENMODE_DOWN, PENMODE_ERASE, PENMODE_UP, WHENMOVED_INIT
 
Fields inherited from interface org.primordion.xholon.base.IXholon
DEFAULT_SIZE_MSG_Q, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx
 
Constructor Summary
WolfSheep()
           
 
Method Summary
 void act()
          Do some action during this time step.
static int getInitialNumberSheep()
           
static int getInitialNumberWolves()
           
static double getSheepGainFromFood()
           
static double getSheepReproduce()
           
static double getWolfGainFromFood()
           
static double getWolfReproduce()
           
 void initialize()
          Initialize the tree node.
 void performActivity(int commandId)
          Do the activity identified by the activityId.
 void postConfigure()
          Perform some action, typically once at start up; MAY be overridden.
static void setInitialNumberSheep(int InitialNumberSheepArg)
           
static void setInitialNumberWolves(int InitialNumberWolvesArg)
           
static void setSheepGainFromFood(double SheepGainFromFoodArg)
           
static void setSheepReproduce(double SheepReproduceArg)
           
static void setWolfGainFromFood(double WolfGainFromFoodArg)
           
static void setWolfReproduce(double WolfReproduceArg)
           
 
Methods inherited from class org.primordion.xholon.base.Turtle
aggregate, back, beep, bk, canMove, die, distance, distancexy, downhill, downhill4, dx, dy, face, facexy, fd, forward, getBreed, getColor, getHeading, getIsHidden, getLabel, getMaxPxcor, getMaxPycor, getMinPxcor, getMinPycor, getPcolor, getPenMode, getPlabel, getPxcor, getPycor, getWho, getWorldHeight, getWorldWidth, getXcor, getYcor, hasAlreadyMoved, hatch, hideTurtle, home, ht, inCone, initWhenMoved, inRadius, inRadius, jump, jump, jump, left, lineBresenham, lt, neighbors, neighbors4, otherTurtlesHere, patchAhead, patchAt, patchAtHeadingAndDistance, patchHere, patchLeftAndAhead, patchRightAndAhead, pd, pe, penDown, penErase, penUp, pu, right, rt, setBreed, setColor, setHeading, setIsHidden, setLabel, setPcolor, setPenMode, setPlabel, setPxcor, setPycor, setWho, setXcor, setxy, setYcor, showTurtle, st, stamp, stampErase, toString, towards, towardsxy, turtlesAt, turtlesHere, turtlesOn, uphill, uphill4, with
 
Methods inherited from class org.primordion.xholon.base.XholonWithPorts
configure, getMaxPorts, getPort, isActiveObject, isBound, isContainer, isPassiveObject, setMaxPorts, setPorts, terminate
 
Methods inherited from class org.primordion.xholon.base.Xholon
appendChild, appendChild, appendChild, cleanup, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextId, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPreviousSibling, getRoleName, getRootNode, getSiblings, getSizeMessageQ, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isExternal, isInternal, isLeaf, isRootNode, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, resetNextId, sendMessage, sendMessage, sendMessage, setAttributeVal, setFactory, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setRoleName, setSizeMessageQ, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, treeSize, writeXml
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.primordion.xholon.base.IXholon
appendChild, appendChild, appendChild, cleanup, configure, configure, createStructure, decVal, decVal, depth, draw, getChildNodes, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumSiblings, getParentNode, getPort, getPreviousSibling, getRoleName, getRootNode, getSiblings, getUid, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXhType, handleNodeSelection, hasAncestor, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, height, incVal, incVal, initStatics, inOrderPrint, insertAfter, insertBefore, insertFirstChild, isActiveObject, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, reconfigure, remove, removeChild, sendMessage, sendMessage, sendMessage, setAttributeVal, setFirstChild, setId, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPorts, setRoleName, setUid, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVariableValue, setXhc, swapNode, terminate, treeSize, writeXml
 

Field Detail

initialNumberSheep

public static int initialNumberSheep

sheepGainFromFood

public static double sheepGainFromFood

sheepReproduce

public static double sheepReproduce

initialNumberWolves

public static int initialNumberWolves

wolfGainFromFood

public static double wolfGainFromFood

wolfReproduce

public static double wolfReproduce

COMMANDID_HATCH

public static final int COMMANDID_HATCH
See Also:
Constant Field Values

energy

public double energy

isGrabbed

public boolean isGrabbed
Constructor Detail

WolfSheep

public WolfSheep()
Method Detail

setInitialNumberSheep

public static void setInitialNumberSheep(int InitialNumberSheepArg)

getInitialNumberSheep

public static int getInitialNumberSheep()

setSheepGainFromFood

public static void setSheepGainFromFood(double SheepGainFromFoodArg)

getSheepGainFromFood

public static double getSheepGainFromFood()

setSheepReproduce

public static void setSheepReproduce(double SheepReproduceArg)

getSheepReproduce

public static double getSheepReproduce()

setInitialNumberWolves

public static void setInitialNumberWolves(int InitialNumberWolvesArg)

getInitialNumberWolves

public static int getInitialNumberWolves()

setWolfGainFromFood

public static void setWolfGainFromFood(double WolfGainFromFoodArg)

getWolfGainFromFood

public static double getWolfGainFromFood()

setWolfReproduce

public static void setWolfReproduce(double WolfReproduceArg)

getWolfReproduce

public static double getWolfReproduce()

initialize

public void initialize()
Description copied from interface: IXholon
Initialize the tree node. Typically this is only used to re-initialize a node, such as when it is reused through the TreeNodeFactoryStatic.

Specified by:
initialize in interface IXholon
Overrides:
initialize in class XholonWithPorts

postConfigure

public void postConfigure()
Description copied from interface: IXholon
Perform some action, typically once at start up; MAY be overridden. Recursive; application should call this only for root.

Specified by:
postConfigure in interface IXholon
Overrides:
postConfigure in class XholonWithPorts

act

public void act()
Description copied from interface: IXholon
Do some action during this time step. Typically all nodes in the tree will do their pre-actions (optional), then all will do their actions, and then all will do their post-actions (optional).

Specified by:
act in interface IXholon
Overrides:
act in class Xholon

performActivity

public void performActivity(int commandId)
Description copied from interface: IXholon
Do the activity identified by the activityId. This is code called on certain Turtle functions that include a set of commands. ex: ask turtles [set color yellow] This method can also be used in other situations as a general call-back mechanism.

Specified by:
performActivity in interface IXholon
Overrides:
performActivity in class Xholon