ptolemy.domains.wireless.lib
Class TerrainProperty
java.lang.Object
ptolemy.kernel.util.NamedObj
ptolemy.kernel.InstantiableNamedObj
ptolemy.kernel.Entity
ptolemy.kernel.ComponentEntity
ptolemy.actor.AtomicActor
ptolemy.actor.TypedAtomicActor
ptolemy.domains.wireless.lib.TerrainProperty
- All Implemented Interfaces:
- Actor, Changeable, java.lang.Cloneable, Debuggable, DebugListener, Derivable, Executable, Instantiable, ModelErrorHandler, MoMLExportable, Nameable, PropertyTransformer, java.io.Serializable, TypedActor
- public class TerrainProperty
- extends TypedAtomicActor
- implements PropertyTransformer
This actor implements the PropertyTransformer interface.
It register itself with the wireless channel specified by
the channelName parameter. The channel may call it
getProperty() method to get the property.
- Since:
- Ptolemy II 4.0
- Version:
- $Id: TerrainProperty.java,v 1.16 2004/04/29 23:24:20 ellen_zh Exp $
- Author:
- Yang Zhao
- See Also:
- Serialized Form
- Accepted Rating:
- Proposed Rating:
| Fields inherited from class ptolemy.kernel.util.NamedObj |
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS |
| Methods inherited from class ptolemy.actor.AtomicActor |
_createReceivers, clone, connectionsChanged, fire, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate |
| 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.util.NamedObj |
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, 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 |
channelName
public StringParameter channelName
- The name of the channel. The default name is "TerrainChannel".
xyPoints
public Parameter xyPoints
- The x/y coordinates of ? (FIXME)
The default value is an array of integer pairs:
{{0, 0}, {0, 5}, {20, 5}, {20, 0}}
FIXME: need more info
TerrainProperty
public TerrainProperty(CompositeEntity container,
java.lang.String name)
throws NameDuplicationException,
IllegalActionException
- Construct an actor with the specified container and name.
- Parameters:
container - The container.name - The name.
- Throws:
IllegalActionException - If the entity cannot be contained
by the proposed container.
NameDuplicationException - If the container already has an
actor with this name.
attributeChanged
public void attributeChanged(Attribute attribute)
throws IllegalActionException
- Override the base class to parse the model specified if the
attribute is modelFileOrURL.
- Overrides:
attributeChanged in class NamedObj
- Parameters:
attribute - The attribute that changed.
- Throws:
IllegalActionException - If the change is not acceptable
to this container (not thrown in this base class).
initialize
public void initialize()
throws IllegalActionException
- Initialize the _registeredWithChannel.
- Specified by:
initialize in interface Executable- Overrides:
initialize in class AtomicActor
- Throws:
IllegalActionException - If a derived class throws it.
transformProperties
public RecordToken transformProperties(RecordToken properties,
WirelessIOPort sender,
WirelessIOPort destination)
throws IllegalActionException
- Check whether the path between the sender and receiver is
intersected with the terrain shape. If yes, set the "power" field
in the property to be zero, otherwise, do nothing.
FIXME: should the terrain property affect the power value
or should it affect the receivers in range?
FIXME: check java.util to see if there is standard method to
do this check...
- Specified by:
transformProperties in interface PropertyTransformer
- Parameters:
properties - The transform properties.sender - The sending port.destination - The receiving port.
- Returns:
- The modified transform properties.
- Throws:
IllegalActionException - If failed to execute the model.
wrapup
public void wrapup()
throws IllegalActionException
- Override the base class to call wrap up to unregister this with the
channel.
- Specified by:
wrapup in interface Executable- Overrides:
wrapup in class AtomicActor
- Throws:
IllegalActionException - Not thrown in this base class.