Interfaces and Buses / Wireless_Sensor / Block / NodeRandomizer
Block Name: NodeRandomizer
- public class NodeRandomizer
- extends VisualSim.actor.TypedAtomicActor
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.
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 ModelBuilder represents locations.
The range 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 {{x1, x2}, {y1, y2}}, indicating that the X value of the location is uniformly distributed between x1 and x2, and that the Y value is uniformly distributed between y1 and y2.
- Since:
- VisualSim4.0
- See Also:
- Locatable
randomizeInPreinitialize
public VisualSim.data.expr.Parameter randomizeInPreinitialize
- If set to true, randomly distribute nodes in preinitialize(). The default value is false.
range
public VisualSim.data.expr.Parameter 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
public VisualSim.data.expr.Parameter 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.
trigger
public VisualSim.actor.TypedIOPort trigger
- A trigger input to cause this actor to fire in simulators that require a trigger. This has undeclared type.
Created with the Personal Edition of HelpNDoc: Create HTML Help, DOC, PDF and print manuals from 1 single source