The collect view functions now take the node's routing metric, not the parent's routing metric.

This commit is contained in:
nifi 2010-10-24 21:40:54 +00:00
parent 098fc8d698
commit 7309767d06
3 changed files with 14 additions and 14 deletions

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: CollectServer.java,v 1.30 2010/10/22 20:39:13 nifi Exp $
* $Id: CollectServer.java,v 1.31 2010/10/24 21:40:54 nifi Exp $
*
* -----------------------------------------------------------------
*
@ -34,8 +34,8 @@
*
* Authors : Joakim Eriksson, Niclas Finne
* Created : 3 jul 2008
* Updated : $Date: 2010/10/22 20:39:13 $
* $Revision: 1.30 $
* Updated : $Date: 2010/10/24 21:40:54 $
* $Revision: 1.31 $
*/
package se.sics.contiki.collect;
@ -359,7 +359,7 @@ public class CollectServer implements SerialConnectionListener {
axis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
}
protected double getSensorDataValue(SensorData data) {
return data.getValue(SensorData.BEST_NEIGHBOR_RTMETRIC) + data.getBestNeighborETX();
return data.getValue(SensorData.RTMETRIC);
}
},
new TimeChartPanel(this, NETWORK, "ETX (Over Time)", "ETX to Next Hop", "Time", "ETX") {

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: SensorDataAggregator.java,v 1.11 2010/10/07 20:59:48 nifi Exp $
* $Id: SensorDataAggregator.java,v 1.12 2010/10/24 21:40:54 nifi Exp $
*
* -----------------------------------------------------------------
*
@ -34,8 +34,8 @@
*
* Authors : Joakim Eriksson, Niclas Finne
* Created : 20 aug 2008
* Updated : $Date: 2010/10/07 20:59:48 $
* $Revision: 1.11 $
* Updated : $Date: 2010/10/24 21:40:54 $
* $Revision: 1.12 $
*/
package se.sics.contiki.collect;
@ -55,7 +55,7 @@ public class SensorDataAggregator implements SensorInfo {
private int lost = 0;
private int nodeRestartCount = 0;
private int nextHopChangeCount = 0;
private int lastNextHop = 0;
private int lastNextHop = -1;
private long shortestPeriod = Long.MAX_VALUE;
private long longestPeriod = 0;
@ -93,7 +93,7 @@ public class SensorDataAggregator implements SensorInfo {
int s = seqn + seqnoDelta;
int bestNeighbor = data.getValue(BEST_NEIGHBOR);
if (lastNextHop != bestNeighbor && lastNextHop != 0) {
if (lastNextHop != bestNeighbor && lastNextHop >= 0) {
nextHopChangeCount++;
}
lastNextHop = bestNeighbor;
@ -242,7 +242,7 @@ public class SensorDataAggregator implements SensorInfo {
}
public double getAverageRtmetric() {
return dataCount > 0 ? ((values[BEST_NEIGHBOR_RTMETRIC] + (values[BEST_NEIGHBOR_ETX] / 8.0)) / dataCount) : 0.0;
return getAverageValue(RTMETRIC);
}
public double getAverageRadioIntensity() {

View File

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: SensorInfo.java,v 1.4 2010/10/12 11:39:10 adamdunkels Exp $
* $Id: SensorInfo.java,v 1.5 2010/10/24 21:40:54 nifi Exp $
*
* -----------------------------------------------------------------
*
@ -34,8 +34,8 @@
*
* Authors : Joakim Eriksson, Niclas Finne
* Created : 20 aug 2008
* Updated : $Date: 2010/10/12 11:39:10 $
* $Revision: 1.4 $
* Updated : $Date: 2010/10/24 21:40:54 $
* $Revision: 1.5 $
*/
package se.sics.contiki.collect;
@ -70,7 +70,7 @@ public interface SensorInfo {
public static final int TIME_LISTEN = 14;
public static final int BEST_NEIGHBOR = 15;
public static final int BEST_NEIGHBOR_ETX = 16;
public static final int BEST_NEIGHBOR_RTMETRIC = 17;
public static final int RTMETRIC = 17;
public static final int NUM_NEIGHBORS = 18;
public static final int BEACON_INTERVAL = 19;
public static final int BATTERY_VOLTAGE = 20;