org.holtz.zoe
Class Bug
java.lang.Object
java.util.Observable
org.holtz.zoe.ZObject
org.holtz.zoe.Bug
- All Implemented Interfaces:
- ZoelVMHost
public class Bug
- extends ZObject
- implements ZoelVMHost
A Zoe organism controlled by Gene
s each executing on its own
ZoelVM
virtual machines.
- Author:
- Brian Holtz
Methods inherited from class org.holtz.zoe.ZObject |
bearing, bearing, evaluate, getContext, isGone, location, move, range, range, repaint, setContext, setXY, x, y |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
mother
public Bug mother
father
public Bug father
lastMate
public Bug lastMate
lastSensed
public ZObject lastSensed
genotype
protected Genotype genotype
age
public int age
diameter
public double diameter
heading
public double heading
gaze
public double gaze
- Gaze in radians relative to heading.
Bug
public Bug(World theWorld)
Bug
public Bug(World theWorld,
Genotype theGenotype)
brownianMotion
public void brownianMotion()
- Overrides:
brownianMotion
in class ZObject
mass
public double mass()
- Specified by:
mass
in class ZObject
strengthRatio
public double strengthRatio()
- The fraction of full strength at current size.
- Returns:
- a double between 0 and 1.0.
strength
public double strength()
genotype
public Genotype genotype()
isDead
public boolean isDead()
disappear
public void disappear()
numLivingDescendents
public int numLivingDescendents()
canSee
public boolean canSee(ZObject obj)
implicitArgOf
public Expression implicitArgOf(Operator op)
- Description copied from interface:
ZoelVMHost
- The implicit argument, if any, of an Operator.
- Specified by:
implicitArgOf
in interface ZoelVMHost
- Parameters:
op
- The Operator.
- Returns:
- A RegisterReference or Literal, or null if op has no implicit argument.
get
public Literal get(RegisterReference arg)
- Specified by:
get
in interface ZoelVMHost
get
public Literal get(Literal key)
- Specified by:
get
in interface ZoelVMHost
put
public Literal put(Literal key,
Literal value)
- Specified by:
put
in interface ZoelVMHost
execute
public ZoelVM.Turn execute(Operator operator,
Literal operand)
- Specified by:
execute
in interface ZoelVMHost
next
public void next()
nextDescendant
public Bug nextDescendant(Bug currentDescendant,
java.util.List<Bug> generation)
nextDescendant
public Bug nextDescendant(Bug currentDescendant)
nextChild
public Bug nextChild(Bug currentChild)
nextSibling
public Bug nextSibling()
youngestChild
public Bug youngestChild()
genealogy
public java.lang.String genealogy(java.lang.String separator)
genealogy
public java.lang.String genealogy(int generations)
descendents
public java.lang.String descendents()
descendents
public java.lang.String descendents(java.lang.String separator)
descendentsCount
public java.lang.String descendentsCount()
descendents
public java.lang.String descendents(int[] descendents,
java.lang.String separator)
toString
public java.lang.String toString(java.lang.String separator,
boolean labels)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getNextId
public int getNextId()
- Specified by:
getNextId
in class ZObject
getNumEverCreated
public int getNumEverCreated()
- Specified by:
getNumEverCreated
in class ZObject
random
public java.util.Random random()
- Specified by:
random
in interface ZoelVMHost
world
public World world()
- Specified by:
world
in interface ZoelVMHost
maxDataSize
public int maxDataSize()
- Specified by:
maxDataSize
in interface ZoelVMHost
maxStepsPerTurn
public int maxStepsPerTurn()
- Specified by:
maxStepsPerTurn
in interface ZoelVMHost
id
public int id()
numEverCreated
public static int numEverCreated()
color
public java.awt.Color color()
- Specified by:
color
in class ZObject
tracePrefix
public java.lang.String tracePrefix()
- Specified by:
tracePrefix
in interface ZoelVMHost