public void outputNodes() { for (Map.Entry<MobileNetID, MobileNetLayer> e : NodeList.entrySet()) { MobileNode n = (MobileNode) e.getValue().getNetPosition(); double x = n.getXPos(); double y = n.getYPos(); if (x == 0.8151173344625606D) log.debug(e.getKey() + ";" + x + ";" + y); } }
/** * Execute the method "moveNode" for all nodes which are present in this network. If the node has * moved out of this quadrant, add it to a list and return it to the manager. * * @param last_changed : Time to calculate the distance for. Current time minus the last update * time * @return LinkedList: List with all the nodes, which have been moved out of the array and were * already deleted. */ public LinkedList<MobileNetLayer> updateMovement() { LinkedList<MobileNetLayer> l = new LinkedList<MobileNetLayer>(); for (Map.Entry<MobileNetID, MobileNetLayer> e : NodeList.entrySet()) { MobileNetLayer elem = e.getValue(); MobileNode n = (MobileNode) e.getValue().getNetPosition(); double x = n.getXPos(); double y = n.getYPos(); n.updateMovement(); // If the node moved out of my quadrant, add it to the returned List // and remove it from my list if ((x != n.getXPos()) || (y != n.getYPos())) { l.add(elem); } } this.deleteNode(l); return l; }