Package ptolemy.domains.wireless.kernel

Examples of ptolemy.domains.wireless.kernel.WirelessIOPort


            // an approximation, and needs to be fully characterized.
            // Also, the receiver needs to be in range at the
            // conclusion of the propagation, whereas this method is
            // called only if the receiver is in range at the
            // initiation of the transmission.
            WirelessIOPort destination = (WirelessIOPort) receiver
                    .getContainer();
            double distance = _distanceBetween(sender, destination);
            Time time = director.getModelTime().add(distance / speed);

            if (_receptions == null) {
View Full Code Here


        // Create and configure the parameters.
        outputChannelName = new StringParameter(this, "outputChannelName");
        outputChannelName.setExpression("AtomicWirelessChannel");

        // Create and configure the ports.
        output = new WirelessIOPort(this, "output", false, true);
        output.outsideChannel.setExpression("$outputChannelName");
        output.setTypeSameAs(payload);

        _attachText("_iconDescription", "<svg>\n"
                + "<polygon points=\"-15,-15 15,15 15,-15 -15,15\" "
View Full Code Here

        range = new Parameter(this, "range");
        range.setToken("50.0");
        range.setTypeEquals(BaseType.DOUBLE);

        // Create and configure the ports.
        input = new WirelessIOPort(this, "input", true, false);
        input.outsideChannel.setExpression("$messageChannelName");

        signal = new WirelessIOPort(this, "signal", true, false);
        signal.outsideChannel.setExpression("$signalChannelName");
        signal.setTypeEquals(BaseType.STRING);

        output = new WirelessIOPort(this, "output", false, true);
        output.outsideChannel.setExpression("$outputChannelName");

        // Since this actor sources the data at this port, we have to
        // declare the type.
        TypeAttribute portType = new TypeAttribute(output, "type");
View Full Code Here

        testChannelName = new StringParameter(this, "testChannelName");
        testChannelName.setExpression("testChannel");

        // Create and configure the ports.
        input = new WirelessIOPort(this, "input", true, false);
        input.outsideChannel.setExpression("$inputChannelName");

        //FIXME: this type configuration doesn't work.
        //TypeAttribute inputPortType = new TypeAttribute(input, "type");
        //inputPortType.setExpression
        //    ("{data=double, destination=String, routeTo=String, hops=int}");
        output = new WirelessIOPort(this, "output", false, true);
        output.outsideChannel.setExpression("$outputChannelName");

        //TypeAttribute outputPortType = new TypeAttribute(output, "type");
        //outputPortType.setExpression
        //    ("{data=double, destination=String, routeTo=String, hops=int}");
        test = new WirelessIOPort(this, "test", false, true);
        test.outsideChannel.setExpression("$testChannelName");
        test.setTypeEquals(BaseType.INT);

        lossProbability = new Parameter(this, "lossProbability");
        lossProbability.setTypeEquals(BaseType.DOUBLE);
View Full Code Here

        CompositeEntity container = (CompositeEntity) getContainer();
        Iterator ports = ModelTopology.listeningInputPorts(container,
                outputChannelName.stringValue()).iterator();

        while (ports.hasNext()) {
            WirelessIOPort port = (WirelessIOPort) ports.next();

            // Skip ports contained by the same container as the source.
            if (port.getContainer() == sourcePort.getContainer()) {
                continue;
            }

            double distance = ModelTopology.distanceBetween(sourcePort, port);
            _distance.setToken(new DoubleToken(distance));

            double experiment = _random.nextDouble();
            double probability = ((DoubleToken) lossProbability.getToken())
                    .doubleValue();

            if (_debugging) {
                _debug(" **** loss probability is: " + probability);
            }

            // Make sure a probability of 1.0 is truly a sure loss.
            if ((probability < 1.0) && (experiment >= probability)) {
                nodesInRangeList.add(port.getContainer());
            }
        }

        return nodesInRangeList;
    }
View Full Code Here

            while (ports.hasNext()) {
                Port port = (Port) ports.next();

                if (port instanceof WirelessIOPort) {
                    WirelessIOPort castPort = (WirelessIOPort) port;

                    if (castPort.isInput()) {
                        String channelName = castPort.outsideChannel
                                .stringValue();

                        if (channelName.equals(theChannelName)) {
                            result.add(port);
View Full Code Here

        while (ports.hasNext()) {
            Port port = (Port) ports.next();

            if (port instanceof WirelessIOPort) {
                WirelessIOPort castPort = (WirelessIOPort) port;

                if (castPort.isOutput()) {
                    String channelName = castPort.insideChannel.stringValue();

                    if (channelName.equals(theChannelName)) {
                        result.add(port);
                    }
View Full Code Here

        while (ports.hasNext()) {
            Port port = (Port) ports.next();

            if (port instanceof WirelessIOPort) {
                WirelessIOPort castPort = (WirelessIOPort) port;

                if (castPort.isInput()) {
                    String channelName = castPort.insideChannel.stringValue();

                    if (channelName.equals(theChannelName)) {
                        result.add(port);
                    }
View Full Code Here

            while (ports.hasNext()) {
                Port port = (Port) ports.next();

                if (port instanceof WirelessIOPort) {
                    WirelessIOPort castPort = (WirelessIOPort) port;

                    if (castPort.isOutput()) {
                        String channelName = castPort.outsideChannel
                                .stringValue();

                        if (channelName.equals(theChannelName)) {
                            result.add(port);
View Full Code Here

    public CollisionDetector(CompositeEntity container, String name)
            throws IllegalActionException, NameDuplicationException {
        super(container, name);

        // Create and configure the ports.
        message = new WirelessIOPort(this, "message", true, false);
        (new SingletonParameter(message, "_showName"))
                .setToken(BooleanToken.TRUE);

        power = new TypedIOPort(this, "power", true, false);
        power.setTypeEquals(BaseType.DOUBLE);
View Full Code Here

TOP

Related Classes of ptolemy.domains.wireless.kernel.WirelessIOPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.