|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
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.
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.
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.
Locatable,
Serialized Form
| Red (sanjeev) |
| Yellow (eal) |
| Nested Class Summary |
| Nested classes inherited from class ptolemy.kernel.Entity |
ptolemy.kernel.Entity.ContainedObjectsIterator |
| Field Summary | |
ptolemy.data.expr.Parameter |
randomizeInPreinitialize
If set to true, randomly distribute nodes in preinitialize(). |
ptolemy.data.expr.Parameter |
range
The range of values for locations to be set when randomizing. |
ptolemy.data.expr.Parameter |
seed
The seed that controls the random number generation to use when randomizing. |
ptolemy.actor.TypedIOPort |
trigger
A trigger input to cause this actor to fire in domains that require a trigger. |
| Fields inherited from class ptolemy.actor.AtomicActor |
_stopRequested |
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Fields inherited from interface ptolemy.actor.Executable |
COMPLETED, NOT_READY, STOP_ITERATING |
| Constructor Summary | |
NodeRandomizer(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
Construct an actor in the given container with the given name. |
|
| Method Summary | |
protected java.lang.String |
_getLocationSetMoML(ptolemy.kernel.CompositeEntity container,
ptolemy.kernel.Entity node,
double[] location)
Return moml that will set the location of the specified node. |
protected void |
_randomize()
Randomly distribute the nodes in the model that contain a boolean valued parameter named "randomize" with value true. |
void |
fire()
Issue a change request to randomize the locations of the nodes. |
void |
preinitialize()
Override the base class to randomize the positions of the nodes if randomizeInPreinitialize is set to true. |
| Methods inherited from class ptolemy.actor.TypedAtomicActor |
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, initialize, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup |
| Methods inherited from class ptolemy.kernel.ComponentEntity |
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName |
| Methods inherited from class ptolemy.kernel.Entity |
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables |
| Methods inherited from class ptolemy.kernel.InstantiableNamedObj |
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition |
| Methods inherited from class ptolemy.kernel.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface ptolemy.actor.Actor |
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList |
| Methods inherited from interface ptolemy.actor.Executable |
initialize, iterate, postfire, prefire, stop, stopFire, terminate, wrapup |
| Methods inherited from interface ptolemy.kernel.util.Derivable |
getDerivedLevel, getDerivedList, propagateValue |
| Methods inherited from interface ptolemy.kernel.util.Nameable |
description, getFullName, getName, getName |
| Field Detail |
public ptolemy.data.expr.Parameter randomizeInPreinitialize
public ptolemy.data.expr.Parameter range
public ptolemy.data.expr.Parameter seed
public ptolemy.actor.TypedIOPort trigger
| Constructor Detail |
public NodeRandomizer(ptolemy.kernel.CompositeEntity container,
java.lang.String name)
throws ptolemy.kernel.util.IllegalActionException,
ptolemy.kernel.util.NameDuplicationException
container - Container of the actor.name - Name of the actor.
ptolemy.kernel.util.IllegalActionException - If the
actor is not compatible with the specified container.
ptolemy.kernel.util.NameDuplicationException - If the name collides
with an entity in the container.| Method Detail |
public void fire()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the superclass throws it.
public void preinitialize()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the initialize() method of
one of the associated actors throws it, or if the range parameter
is malformed.
protected void _randomize()
throws ptolemy.kernel.util.IllegalActionException
ptolemy.kernel.util.IllegalActionException - If the range parameter is malformed.
protected java.lang.String _getLocationSetMoML(ptolemy.kernel.CompositeEntity container,
ptolemy.kernel.Entity node,
double[] location)
throws ptolemy.kernel.util.IllegalActionException
location - The specified location.node - The node for which to set the location.
ptolemy.kernel.util.IllegalActionException - If the location attribute
cannot be set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||