Class ModelTopology


  • public class ModelTopology
    extends java.lang.Object
    Define the methods that deal with the model topology here statically for the convenience to build a set of actors to be used for a composite wireless channel.
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Yang Zhao and Edward A. Lee
    Pt.AcceptedRating:
    Red (sanjeev)
    Pt.ProposedRating:
    Red (sanjeev)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double distanceBetween​(WirelessIOPort port1, WirelessIOPort port2)
      Return the distance between two ports.
      static java.util.List listeningInputPorts​(CompositeEntity container, java.lang.String theChannelName)
      Return a list of input ports that can potentially receive data from this channel.
      static java.util.List listeningOutputPorts​(CompositeEntity container, java.lang.String theChannelName)
      Return a list of output ports that can potentially receive data from this channel.
      static double[] locationOf​(IOPort port)
      Return the location of the given port.
      static java.util.List sendingInputPorts​(CompositeEntity container, java.lang.String theChannelName)
      Return a list of input ports that can potentially send data to this channel.
      static java.util.List sendingOutputPorts​(CompositeEntity container, java.lang.String theChannelName)
      Return a list of output ports that can potentially send data to this channel.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • distanceBetween

        public static double distanceBetween​(WirelessIOPort port1,
                                             WirelessIOPort port2)
                                      throws IllegalActionException
        Return the distance between two ports. This is a convenience method provided to make it easier to write subclasses that limit transmission range using position information.
        Parameters:
        port1 - The first port.
        port2 - The second port.
        Returns:
        The distance between the two ports.
        Throws:
        IllegalActionException - If the distance cannot be determined.
      • listeningInputPorts

        public static java.util.List listeningInputPorts​(CompositeEntity container,
                                                         java.lang.String theChannelName)
                                                  throws IllegalActionException
        Return a list of input ports that can potentially receive data from this channel. This includes input ports contained by entities contained by the container of this channel that have their outsideChannel parameter set to the name of this channel. This method gets read access on the workspace. Note: This class doesn't try to deal with read access to the workspace, the caller should be.
        Parameters:
        container - The composite entity that contains the wireless channel.
        theChannelName - The name of the wireless channel.
        Returns:
        A new list of input ports of class WirelessIOPort using this channel.
        Throws:
        IllegalActionException - If a port is encountered whose outsideChannel parameter cannot be evaluated.
      • listeningOutputPorts

        public static java.util.List listeningOutputPorts​(CompositeEntity container,
                                                          java.lang.String theChannelName)
                                                   throws IllegalActionException
        Return a list of output ports that can potentially receive data from this channel. This includes output ports contained by the container of this channel that have their insideChannel parameter set to the name of this channel. This method gets read access on the workspace.
        Parameters:
        container - The composite entity that contains the wireless channel.
        theChannelName - The name of the wireless channel.
        Returns:
        The list of output ports of class WirelessIOPort using this channel.
        Throws:
        IllegalActionException - If a port is encountered whose insideChannel parameter cannot be evaluated.
      • locationOf

        public static double[] locationOf​(IOPort port)
                                   throws IllegalActionException
        Return the location of the given port. If the container of the port is the container of this channel, then use the "_location" attribute of the port. Otherwise, use the "_location" attribute of its container. The calling method is expected to have read access on the workspace. This is a convenience method provided for subclasses.
        Parameters:
        port - A port with a location.
        Returns:
        The location of the port.
        Throws:
        IllegalActionException - If a valid location attribute cannot be found.
      • sendingInputPorts

        public static java.util.List sendingInputPorts​(CompositeEntity container,
                                                       java.lang.String theChannelName)
                                                throws IllegalActionException
        Return a list of input ports that can potentially send data to this channel. This includes input ports contained by the container of this channel that have their insideChannel parameter set to the name of this channel. This method gets read access on the workspace.
        Parameters:
        container - The composite entity that contains the wireless channel.
        theChannelName - The name of the wireless channel.
        Returns:
        The list of output ports of class WirelessIOPort using this channel.
        Throws:
        IllegalActionException - If a port is encountered whose insideChannel parameter cannot be evaluated.
      • sendingOutputPorts

        public static java.util.List sendingOutputPorts​(CompositeEntity container,
                                                        java.lang.String theChannelName)
                                                 throws IllegalActionException
        Return a list of output ports that can potentially send data to this channel. This includes output ports contained by entities contained by the container of this channel that have their outsideChannel parameter set to the name of this channel. This method gets read access on the workspace.
        Parameters:
        container - The composite entity that contains the wireless channel.
        theChannelName - The name of the wireless channel.
        Returns:
        A new list of input ports of class WirelessIOPort using this channel.
        Throws:
        IllegalActionException - If a port is encountered whose outsideChannel parameter cannot be evaluated.