Package se.sics.cooja.interfaces

Examples of se.sics.cooja.interfaces.Position


            logger.fatal("Could not create positioner");
            return;
          }

          for (int i = 0; i < newMotes.size(); i++) {
            Position newPosition = newMotes.get(i).getInterfaces().getPosition();
            if (newPosition != null) {
              double[] newPositionArray = positioner.getNextPosition();
              if (newPositionArray.length >= 3) {
                newPosition.setCoordinates(newPositionArray[0],
                    newPositionArray[1], newPositionArray[2]);
              } else if (newPositionArray.length >= 2) {
                newPosition.setCoordinates(newPositionArray[0],
                    newPositionArray[1], 0);
              } else if (newPositionArray.length >= 1) {
                newPosition.setCoordinates(newPositionArray[0], 0, 0);
              } else {
                newPosition.setCoordinates(0, 0, 0);
              }
            }
          }

          /* Set unique mote id's for all new motes
View Full Code Here


      protected void analyzeEdges() {
        /* Create edges according to distances.
         * XXX May be slow for mobile networks */
        clearEdges();
        for (Radio source: UDGM.this.getRegisteredRadios()) {
          Position sourcePos = source.getPosition();
          for (Radio dest: UDGM.this.getRegisteredRadios()) {
            Position destPos = dest.getPosition();
            /* Ignore ourselves */
            if (source == dest) {
              continue;
            }
            double distance = sourcePos.getDistanceTo(destPos);
View Full Code Here

    if (potentialDestinations == null) {
      return newConnection;
    }

    /* Loop through all potential destinations */
    Position senderPos = sender.getPosition();
    for (DestinationRadio dest: potentialDestinations) {
      Radio recv = dest.radio;

      /* Fail if radios are on different (but configured) channels */
      if (sender.getChannel() >= 0 &&
          recv.getChannel() >= 0 &&
          sender.getChannel() != recv.getChannel()) {
        continue;
      }
      Position recvPos = recv.getPosition();

      /* Fail if radio is turned off */
//      if (!recv.isReceiverOn()) {
//        /* Special case: allow connection if source is Contiki radio,
//         * and destination is something else (byte radio).
View Full Code Here

TOP

Related Classes of se.sics.cooja.interfaces.Position

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.