Commit b8135828 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Final fixed for vehits and machine learning

parent 5b735208
......@@ -25,6 +25,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge;
......@@ -90,4 +91,9 @@ public class DefaultVehicularPointInformation<S extends Object> implements Vehic
return _attributes.containsKey(pKey);
}
@Override
public boolean isValid() {
return getDetectionDate() + (long) getAttribute(AvailableInformationAttributes.TTL) > Time.getCurrentTime();
}
}
......@@ -39,7 +39,8 @@ import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.Road
* @version 1.0 at 05.03.2018
*
*/
public class EnvironmentInformation<T extends LocationBasedEnvironmentProperty> implements PointInformation<T> {
public abstract class EnvironmentInformation<T extends LocationBasedEnvironmentProperty>
implements PointInformation<T> {
private T _environment;
......
package de.tudarmstadt.maki.simonstrator.api.component.vehicular.information;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.DefaultVehicularPointInformation;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge;
public class JamInformation extends DefaultVehicularPointInformation<Boolean> {
......@@ -23,4 +23,9 @@ public class JamInformation extends DefaultVehicularPointInformation<Boolean> {
public String toString() {
return "Jam at " + getEdge() + ": " + getValue();
}
@Override
public boolean isValid() {
return getDetectionDate() + (long) getAttribute(AvailableInformationAttributes.TTL) > Time.getCurrentTime();
}
}
......@@ -24,6 +24,7 @@ package de.tudarmstadt.maki.simonstrator.api.component.vehicular.information;
import java.util.ArrayList;
import java.util.List;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.pubsub.Notification;
import de.tudarmstadt.maki.simonstrator.api.component.pubsub.attribute.Attribute;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
......@@ -121,4 +122,9 @@ public class NotificationBasedVehicularPointInformation implements VehicularPoin
return null;
}
@Override
public boolean isValid() {
return getDetectionDate() + (long) getAttribute(AvailableInformationAttributes.TTL) > Time.getCurrentTime();
}
}
......@@ -59,4 +59,6 @@ public interface PointInformation<S extends Object> {
<T extends Object> boolean hasAttribute(AvailableInformationAttributes pKey);
S getValue();
boolean isValid();
}
......@@ -23,6 +23,7 @@ package de.tudarmstadt.maki.simonstrator.api.component.vehicular.information;
import java.util.List;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.AggregatedProperty;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.RoadProperty;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.aggregation.AggregationInformation;
......@@ -97,4 +98,9 @@ public class RoadInformation extends EnvironmentInformation<RoadProperty>
}
return false;
}
@Override
public boolean isValid() {
return getDetectionDate() + (long) getAttribute(AvailableInformationAttributes.TTL) > Time.getCurrentTime();
}
}
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