ptolemy.domains.wireless.lib
Class TerrainProperty

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.domains.wireless.lib.TerrainProperty
All Implemented Interfaces:
ptolemy.actor.Actor, ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.actor.Executable, ptolemy.kernel.util.Instantiable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, PropertyTransformer, java.io.Serializable, ptolemy.actor.TypedActor

public class TerrainProperty
extends ptolemy.actor.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:
Red (pjb2e)
Proposed Rating:
Yellow (eal)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
 ptolemy.data.expr.StringParameter channelName
          The name of the channel.
 ptolemy.data.expr.Parameter xyPoints
          The x/y coordinates of ?
 
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
TerrainProperty(ptolemy.kernel.CompositeEntity container, java.lang.String name)
          Construct an actor with the specified container and name.
 
Method Summary
 void attributeChanged(ptolemy.kernel.util.Attribute attribute)
          Override the base class to parse the model specified if the attribute is modelFileOrURL.
 void initialize()
          Initialize the _registeredWithChannel.
 ptolemy.data.RecordToken transformProperties(ptolemy.data.RecordToken properties, WirelessIOPort sender, WirelessIOPort destination)
          Check whether the path between the sender and receiver is intersected with the terrain shape.
 void wrapup()
          Override the base class to call wrap up to unregister this with the channel.
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
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.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, 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
fire, iterate, postfire, prefire, preinitialize, stop, stopFire, terminate
 
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

channelName

public ptolemy.data.expr.StringParameter channelName
The name of the channel. The default name is "TerrainChannel".


xyPoints

public ptolemy.data.expr.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

Constructor Detail

TerrainProperty

public TerrainProperty(ptolemy.kernel.CompositeEntity container,
                       java.lang.String name)
                throws ptolemy.kernel.util.NameDuplicationException,
                       ptolemy.kernel.util.IllegalActionException
Construct an actor with the specified container and name.

Parameters:
container - The container.
name - The name.
Throws:
ptolemy.kernel.util.IllegalActionException - If the entity cannot be contained by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the container already has an actor with this name.
Method Detail

attributeChanged

public void attributeChanged(ptolemy.kernel.util.Attribute attribute)
                      throws ptolemy.kernel.util.IllegalActionException
Override the base class to parse the model specified if the attribute is modelFileOrURL.

Parameters:
attribute - The attribute that changed.
Throws:
ptolemy.kernel.util.IllegalActionException - If the change is not acceptable to this container (not thrown in this base class).

initialize

public void initialize()
                throws ptolemy.kernel.util.IllegalActionException
Initialize the _registeredWithChannel.

Specified by:
initialize in interface ptolemy.actor.Executable
Throws:
ptolemy.kernel.util.IllegalActionException

transformProperties

public ptolemy.data.RecordToken transformProperties(ptolemy.data.RecordToken properties,
                                                    WirelessIOPort sender,
                                                    WirelessIOPort destination)
                                             throws ptolemy.kernel.util.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:
ptolemy.kernel.util.IllegalActionException - If failed to execute the model.

wrapup

public void wrapup()
            throws ptolemy.kernel.util.IllegalActionException
Override the base class to call wrap up to unregister this with the channel.

Specified by:
wrapup in interface ptolemy.actor.Executable
Throws:
ptolemy.kernel.util.IllegalActionException