|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simbrain.world.odorworld.AbstractEntity
org.simbrain.world.odorworld.OdorWorldEntity
public class OdorWorldEntity
WorldEntity represents an entity in the world. These objects represent distal stimuli relative to the creature. The functions in this class convert the properties of that distal stimulus into a proximal stimulus, that is, into a pattern of activity across the input nodes of the network.
| Field Summary | |
|---|---|
static String[] |
IMAGENAMES
for combo boxes. |
| Constructor Summary | |
|---|---|
OdorWorldEntity()
Default constructor. |
|
OdorWorldEntity(OdorWorld wr,
String imageName,
int x,
int y)
Construct a world entity with a random smell signature. |
|
| Method Summary | |
|---|---|
int |
getBites()
|
int |
getBitesToDie()
|
boolean |
getEdible()
|
int |
getHeight()
|
String |
getImageName()
|
int |
getImageNameIndex(String in)
Helper function for combo boxes. |
static String[] |
getImageNames()
Names of images. |
Point |
getLocation()
|
String |
getName()
|
OdorWorld |
getParent()
|
Rectangle |
getRectangle()
Returns a Rectangle describing the location of the Entity (For Calculating Collisions). |
Rectangle |
getRectangle(Point p)
|
double |
getResurrectionProb()
|
Stimulus |
getStimulus()
|
ImageIcon |
getTheImage()
|
int |
getWidth()
|
int |
getX()
|
int |
getY()
|
static ImageIcon[] |
imagesRenderer()
To display images in combo boxes. |
void |
moveTo(int x,
int y)
Move world object to a specified location. |
void |
paintThis(Graphics g)
Paint the entity. |
void |
reset()
When an entity is resurrected, reset its bite counter. |
void |
setBites(int bites)
Number of times bitten. |
void |
setBitesToDie(int bitesToDie)
|
void |
setEdible(boolean edible)
|
void |
setImageName(String string)
|
void |
setLocation(Point newPosition)
Sets new location of entity. |
void |
setName(String name)
|
void |
setParent(OdorWorld parentWorld)
|
void |
setResurrectionProb(double resurrectionProb)
|
void |
setStimulus(Stimulus theStimulus)
|
void |
setTheImage(ImageIcon theImage)
|
void |
setX(int x)
Sets x position. |
void |
setY(int y)
Sets y position. |
void |
terminate()
Removes the entity that was eaten. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String[] IMAGENAMES
| Constructor Detail |
|---|
public OdorWorldEntity()
public OdorWorldEntity(OdorWorld wr,
String imageName,
int x,
int y)
imageName - kind of entity (flower, cheese, etc)x - x location of new entityy - y location of new entitywr - the world to which this belongs| Method Detail |
|---|
public int getBites()
getBites in class AbstractEntitypublic void setBites(int bites)
setBites in class AbstractEntitybites - Number of bites.public void reset()
public void setLocation(Point newPosition)
newPosition - New position of entity.public Point getLocation()
getLocation in class AbstractEntitypublic int getX()
getX in class AbstractEntitypublic int getY()
getY in class AbstractEntitypublic void setX(int x)
setX in class AbstractEntityx - Locationpublic void setY(int y)
setY in class AbstractEntityy - Locationpublic String getImageName()
public void setImageName(String string)
string - Sets name of image.public static ImageIcon[] imagesRenderer()
public int getImageNameIndex(String in)
in - the string to compare
public void moveTo(int x,
int y)
x - x coordinate of target locationy - y coordintae of target locationpublic static String[] getImageNames()
public OdorWorld getParent()
getParent in class AbstractEntitypublic void setParent(OdorWorld parentWorld)
setParent in class AbstractEntityparentWorld - The parentWorld to set.public Stimulus getStimulus()
getStimulus in class AbstractEntitypublic void setStimulus(Stimulus theStimulus)
theStimulus - The theStimulus to set.public String getName()
public void setName(String name)
name - The name to set.public ImageIcon getTheImage()
public void setTheImage(ImageIcon theImage)
theImage - The image to be set.public int getWidth()
getWidth in class AbstractEntitypublic int getHeight()
getHeight in class AbstractEntitypublic Rectangle getRectangle()
AbstractEntity
getRectangle in class AbstractEntitypublic Rectangle getRectangle(Point p)
getRectangle in class AbstractEntityp - Point at which rectangle is to be created.
public void paintThis(Graphics g)
paintThis in class AbstractEntityg - reference to the World's graphics objectpublic int getBitesToDie()
getBitesToDie in class AbstractEntitypublic void setBitesToDie(int bitesToDie)
bitesToDie - Bites to eat an item.public boolean getEdible()
getEdible in class AbstractEntitypublic void setEdible(boolean edible)
setEdible in class AbstractEntityedible - Sets whether an item is edible.public void terminate()
terminate in class AbstractEntitypublic double getResurrectionProb()
getResurrectionProb in class AbstractEntitypublic void setResurrectionProb(double resurrectionProb)
setResurrectionProb in class AbstractEntityresurrectionProb - Likelyhood entity will reappear.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||