Commit 83c15c58 authored by Julian Zobel's avatar Julian Zobel
Browse files

Merge branch 'jz/bachelor-thesis-louis-neumann' into jz/dev-metrics

parents 6ac51fc3 e8d1d98c
......@@ -37,6 +37,9 @@ import de.tudarmstadt.maki.simonstrator.api.component.network.NetworkComponent.N
*
* @author Bjoern Richerzhagen
* @version 1.0, 25.02.2012
*
* @changes:
* Louis Neumann - setting LORA to "unlimited" bandwith
*/
public enum PhyType {
......@@ -92,7 +95,7 @@ public enum PhyType {
* Assuming the following defaults: zero link-layer packet loss, 0.3 kbit/s BW,
* 500us latency, 1kByte MTU
*/
LORA(NetInterfaceName.LORA, 0, 1 * Rate.kbit_s,
LORA(NetInterfaceName.LORA, 0, 1 * Rate.Gbit_s,
500 * Time.MICROSECOND, 1024, true);
......
......@@ -25,6 +25,7 @@ import java.util.Arrays;
import com.vividsolutions.jts.geom.Coordinate;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
/**
......@@ -53,7 +54,11 @@ import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
* assertions. Replace does now fully replace the position vector entries. PVs are now
* always at least 3D (with 0 altitude)
*
* @author Bjoern Richerzhagen, Julian Zobel
* - 14.03.2019 Louis Neumann: added timestamp when creating a PositionVector and adjusted ageOfLocation()
*
* - 18.04.2019 Louis Neumann: added setAgeofLocation()
*
* @author Bjoern Richerzhagen, Julian Zobel, Louis Neumann
* @version 1.2, 10.09.2018
*/
public class PositionVector implements Location {
......@@ -67,6 +72,10 @@ public class PositionVector implements Location {
private double[] values;
private double accuracy = -1;
/**
* Timestamp with time when created
*/
private long created;
/**
* Create a new Position Vector
......@@ -84,6 +93,7 @@ public class PositionVector implements Location {
this.dimensions = dimensions;
this.values = new double[dimensions];
this.created = Time.getCurrentTime();
}
/**
......@@ -97,6 +107,7 @@ public class PositionVector implements Location {
for (int i = 0; i < vec.getDimensions(); i++) {
setEntry(i, vec.getEntry(i));
}
this.created = Time.getCurrentTime();
}
public PositionVector(double longitudeOrX, double latitudeOrY) {
......@@ -104,6 +115,7 @@ public class PositionVector implements Location {
this.setLatitudeOrY(latitudeOrY);
this.setLongitudeOrX(longitudeOrX);
this.setAltitude(0);
this.created = Time.getCurrentTime();
}
public PositionVector(double longitudeOrX, double latitudeOrY, double altitude) {
......@@ -111,6 +123,7 @@ public class PositionVector implements Location {
this.setLatitudeOrY(latitudeOrY);
this.setLongitudeOrX(longitudeOrX);
this.setAltitude(altitude);
this.created = Time.getCurrentTime();
}
public PositionVector(Location location) {
......@@ -126,6 +139,7 @@ public class PositionVector implements Location {
this.setLatitudeOrY(location.getLatitudeOrY());
this.setLongitudeOrX(location.getLongitudeOrX());
this.created = Time.getCurrentTime();
}
/**
......@@ -139,6 +153,7 @@ public class PositionVector implements Location {
for (int i = 0; i < values.length; i++) {
setEntry(i, values[i]);
}
this.created = Time.getCurrentTime();
}
@Override
......@@ -539,7 +554,15 @@ public class PositionVector implements Location {
@Override
public long getAgeOfLocation() {
return 0; // always a fresh location
return Time.getCurrentTime() - created;
}
/**
*
* @param ageOfLocation the ageOfLocation to set
*/
public void setAgeofLocation(long ageOfLocation) {
this.created = ageOfLocation;
}
@Override
......@@ -584,4 +607,6 @@ public class PositionVector implements Location {
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment