Class BluetoothNode

    • Field Detail

      • input

        public WirelessIOPort input
        Port that receives update message for the spanning tree.
      • signal

        public WirelessIOPort signal
        Port that receives a signal from the envader or pursuer.
      • messageChannelName

        public StringParameter messageChannelName
        Name of the channel for messaging between sensors. This is a string that defaults to "messageChannel".
      • signalChannelName

        public StringParameter signalChannelName
        Name of the channel for sensors to detect envader or pursuer. This is a string that defaults to "signalChannel".
      • output

        public WirelessIOPort output
        Port that transmits the update message for the spanning tree. This has type {location={double}, time=double, depth =int}, a record token.
      • outputChannelName

        public StringParameter outputChannelName
        Name of the output channel. This is a string that defaults to "OutputChannel".
      • range

        public Parameter range
        The transmission range of the sensor. The icon for this sensor node includes a circle with this as its radius. This is a double and default to 50.0.
    • Method Detail

      • fire

        public void fire()
                  throws IllegalActionException
        When it receives token from the signal port, which is used to receive signal from the pursuer or the evader. it tells what the signal is from by checking the signal header. If it is from the evader, it set itself to be the root node and broadcast a message for updating the tree. Otherwise, it output a message to the pursuer to tell it the location of its parent node, and the pursuer will move closer to the evader using this information. When it receives token from the input port, which is used to receive message from other sensors, it check whether the rootnode has been changed or whether there is a shorter path. If so, it performs update and broadcast a message. Otherwise, simply consumes the messge.
        Specified by:
        fire in interface Executable
        Overrides:
        fire in class AtomicActor<TypedIOPort>
        Throws:
        IllegalActionException - Not thrown in this base class.
      • _getLocation

        protected double[] _getLocation()
                                 throws IllegalActionException
        Return the location of this sensor. In this base class, this is determined by looking for an attribute with name "_location" and class Location. Normally, a visual editor such as Vergil will create this icon, so the location will be determined by the visual editor. Derived classes can override this method to specify the location in some other way.
        Returns:
        An array identifying the location.
        Throws:
        IllegalActionException - If the location attribute does not exist or cannot be evaluated.