|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.anji.floatingeye.FloatingEye
public class FloatingEye
TODO - non square surface & non square eyes
Implements a floating eye that integrates with an AnjiNet
ANN. Foating eye
manages a 2-d matrix of short values known as a "surface" (this could be a graphical image or
a game board), the loaction of the eye in x,y,z coordinates. x,y are the location on the
surface, z is the location above or below the surface. An "eye image" is managed - a 2-d
matrix of short values corresponding to pixels in the eye. The zoom factor of the eye is
determined by the z value. At z=0, each pixel of the eye corresponds to a single space on the
surface. At z=1 each eye pixel can see a maxBlurFactor by maxBlurFactor square. The eye image
is centered on the x,y coordinates (off center by 1/2 pixel if the eye is at a zoom factor
where the visual field spans an even number spaces).
Constructor Summary | |
---|---|
FloatingEye(java.lang.String aName,
java.util.List controlNeurons,
Surface aSurface,
int anEyeDim,
EyeMovementParms someMovementParms)
A floating eye is a 2-d window of inputs to a neural net that can zoom in and out relative to a 2-d surface. |
Method Summary | |
---|---|
double |
getEyeDirectionRadians()
|
java.awt.Image |
getEyeImage()
|
FloatingLocation |
getEyeLocation()
|
int |
getEyePixel(int x,
int y)
|
int |
getHeight()
|
int |
getStepNum()
|
IntLocation2D |
getSurfaceLocation()
translates eye location values from representation range (-1.0 ... |
int |
getWidth()
|
java.lang.String |
getXmld()
|
java.lang.String |
getXmlRootTag()
|
double |
getZoom()
|
void |
reset()
reset neural net and state of eye |
void |
step()
load eye, step network, and update position from network output |
void |
step(int count)
|
java.lang.String |
toString()
|
java.lang.String |
toXml()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FloatingEye(java.lang.String aName, java.util.List controlNeurons, Surface aSurface, int anEyeDim, EyeMovementParms someMovementParms)
AnjiNet
is not thread safe, so the
caller should not access AnjiNet after passing it to FloatingEye
.
aName
- identifying stringcontrolNeurons
- list of neurons, must be at least 4 (x, y, z, rotate) in general, but
any of them for which the corresponding maxMovePerStep parameter is 0 are not requiredaSurface
- 2-d matrix of intsanEyeDim
- someMovementParms
- paramaters controlling movement of eyeMethod Detail |
---|
public java.lang.String toXml()
toXml
in interface XmlPersistable
String
XML representation of objectpublic java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public void reset()
public double getZoom()
public int getWidth()
public int getHeight()
public IntLocation2D getSurfaceLocation()
public void step(int count)
count
- number of times to stepstep()
public void step()
public FloatingLocation getEyeLocation()
public double getEyeDirectionRadians()
public java.awt.Image getEyeImage()
public int getStepNum()
public int getEyePixel(int x, int y)
x
- y
-
public java.lang.String getXmlRootTag()
getXmlRootTag
in interface XmlPersistable
XmlPersistable.getXmlRootTag()
public java.lang.String getXmld()
getXmld
in interface XmlPersistable
XmlPersistable.getXmld()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |