|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.brook.ascape.model.AscapeObject
The cannonical class for most ascape model objects, including rules. Used to manage basic features, such as access to random stream. Every ascape object should 'belong' to some scape, but is not neccesarily a member of that scape.
| Field Summary | |
static int |
ARBITRARY_SEED
Symbol for random seed to be arbitrary (current time in milliseconds.) |
static int |
count
|
protected java.lang.String |
name
The name of this object |
protected Scape |
scape
The agent that this object belongs to. |
| Constructor Summary | |
AscapeObject()
Constructs an ascape object. |
|
AscapeObject(java.lang.String name)
Constructs an ascape object. |
|
| Method Summary | |
java.lang.Object |
clone()
Clones this object. |
java.lang.String |
getName()
A name this object may be referred to by. |
java.util.Random |
getRandom()
Gets the random number stream used by this object. |
long |
getRandomSeed()
Returns the seed for the default random number seed. |
Scape |
getScape()
Returns the scape that this object is primarily related to. |
static double |
randomInRange(double low,
double high)
Returns an integer distributed across some range as the supplied integer is uniformally distributed across the full range of integers. |
static int |
randomInRange(int low,
int high)
Returns an integer distributed across some range as the supplied integer is uniformally distributed across the full range of integers. |
static boolean |
randomIs()
Returns a random boolean value. |
static int |
randomToLimit(int limit)
Returns an integer distributed across 0...high - 1 as the supplied integer is distributed across the full range of integers. |
void |
reseed()
Resets the random number generator. |
void |
setName(java.lang.String name)
Sets a name this object may be referred to by. |
void |
setRandom(java.util.Random newRandom)
Sets the random number stream to be used by this object. |
void |
setRandomSeed(long seed)
Sets the seed for the default random number seed. |
void |
setScape(Scape scape)
Sets the scape that this object is primarily related to. |
java.lang.String |
toString()
A string representing this object. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
public static final int ARBITRARY_SEED
protected Scape scape
protected java.lang.String name
public static int count
| Constructor Detail |
public AscapeObject()
public AscapeObject(java.lang.String name)
name - the name of this object| Method Detail |
public void setScape(Scape scape)
scape - the scape this agent is belongs topublic Scape getScape()
public java.lang.String getName()
public void setName(java.lang.String name)
public void setRandom(java.util.Random newRandom)
random that
is available to all objects. May be overriden to set an instance
random stream instead.the - new random number stream to use#findRandompublic java.util.Random getRandom()
random available to all objects.
If you want to provide scapes or agents with their own
randoms, override this method and be sure to use it instead of simply
accessing the random variable.public long getRandomSeed()
public void setRandomSeed(long seed)
seed - the random number seed to usepublic void reseed()
public static final int randomInRange(int low,
int high)
low - the lowest number (inclusive) that the resulting int might behigh - the hignest number (inclusive) that the resulting int might be
public static final double randomInRange(double low,
double high)
low - the lowest number (inclusive) that the resulting int might behigh - the hignest number (inclusive) that the resulting int might bepublic static final int randomToLimit(int limit)
limit - the maximum limit (exclusize) of the rusulting intpublic static final boolean randomIs()
public java.lang.Object clone()
public java.lang.String toString()
|
(c) 1998-2000 The Brookings Insitution Webpage |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||