Commit 0fbcbc65 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Updated property estimator

parent 6daa3597
......@@ -100,5 +100,10 @@
<artifactId>jama</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-math3</artifactId>
<version>3.0</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
......@@ -20,7 +20,10 @@
package de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.costs;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.tudarmstadt.maki.simonstrator.api.component.pubsub.Notification;
......@@ -53,6 +56,18 @@ public class ConfigurableVehicularPropertyImpactEstimator implements VehicularPr
return 0;
}
@Override
public List<Double> getImpactLevels() {
List<Double> levels = new ArrayList<>();
for (VehicularPropertyImpact property : _properties.values()) {
if (!levels.contains(property.getImpactKnown())) {
levels.add(property.getImpactKnown());
}
}
Collections.sort(levels);
return levels;
}
@Override
public double calculateImpactIfUnknown(Class<? extends RoadProperty> pProperty) {
if (_properties.containsKey(pProperty)) {
......
......@@ -20,6 +20,9 @@
package de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.costs;
import java.util.ArrayList;
import java.util.List;
import de.tudarmstadt.maki.simonstrator.api.component.pubsub.Notification;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.properties.BumpProperty;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.properties.FogProperty;
......@@ -53,6 +56,16 @@ public class DefaultVehicularPropertyImpactEstimator implements VehicularPropert
return 10;
}
@Override
public List<Double> getImpactLevels() {
List<Double> levels = new ArrayList<>();
levels.add(1d);
levels.add(10d);
levels.add(100d);
levels.add(1000d);
return levels;
}
@Override
public double calculateImpactIfKnown(Notification pNotification) {
EnvironmentInformation<? extends LocationBasedEnvironmentProperty> environmentInformation = EnvironmentInformation
......
......@@ -20,6 +20,8 @@
package de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.costs;
import java.util.List;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.properties.RoadProperty;
public interface VehicularPropertyImpactEstimator extends PropertyImpactEstimator {
......@@ -34,4 +36,6 @@ public interface VehicularPropertyImpactEstimator extends PropertyImpactEstimato
}
double calculateImpactIfUnknown(Class<? extends RoadProperty> pProperty);
List<Double> getImpactLevels();
}
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