
NodeRandomizer |
ptolemy.domains.wireless.lib.NodeRandomizer |
This actor, when fired, randomizes the locations of all actors in the
same container that contain an attribute named "randomize" with value
true. It can also optionally perform the randomization in its
preinitialize() method. In both cases, the randomization is
performed in a change request, so it will take effect after the
current iteration.
<p>
This actor assumes that the location is represented in an object
of class Locatable (which is an attribute that implements Settable)
with name "_location". This is how Vergil represents locations.
<p>
The <i>range</i> parameter is an array of arrays giving the range
of possible values for each dimension of the location. For example,
if the location is in two dimensions, then range has the form
{{<i>x1</i>, <i>x2</i>}, {<i>y1</i>, <i>y2</i>}},
indicating that the X value of the location is uniformly
distributed between <i>x1</i> and <i>x2</i>, and that the Y value is
uniformly distributed between <i>y1</i> and <i>y2</i>.
Author(s): Sanjeev Kohli, N. Vinay Krishnan, Cheng Tien Ee, Edward Lee and Xiaojun Liu
Version:$Id: NodeRandomizer.doc.html,v 1.1 2006/02/22 18:41:22 mangal Exp $
Pt.Proposed Rating:Yellow (eal)
Pt.Accepted Rating:Red (sanjeev)
trigger
A trigger input to cause this actor to fire in domains
that require a trigger. This has undeclared type.
randomizeInPreinitialize
If set to true, randomly distribute nodes in preinitialize().
The default value is false.
range
The range of values for locations to be set when randomizing.
This is an array of arrays that defaults to
{{0.0, 500.0}, {0.0, 500.0}},
indicating that the X and Y values are uniformly distributed
between 0.0 and 500.0.
seed
The seed that controls the random number generation to use when
randomizing.
A seed of zero is interpreted to mean that no seed is specified,
which means that each execution of the model could result in
distinct data. For the value 0, the seed is set to
System.currentTimeMillis() + hashCode(), which means that
with extremely high probability, two distinct actors will have
distinct seeds. However, current time may not have enough
resolution to ensure that two subsequent executions of the
same model have distinct seeds.
This parameter contains a LongToken, initially with value 0.