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

First version for privacy-aware offloading

parent 00aaa34e
......@@ -783,7 +783,7 @@ public class DefaultConfigurator implements Configurator {
break;
}
consArgs[i] = configureComponent(elem);
if (consArgs[i].getClass()
if (!consArgs[i].getClass()
.isAssignableFrom(types[i]))
throw new ConfigurationException(
"The type of the component configured for the parameter '"
......
......@@ -60,7 +60,7 @@ import it.polito.appeal.traci.SumoTraciConnection;
public class TraciSimulationController implements VehicleController, SimulationSetupExtractor, EdgeController, SimulatorObserver {
private static final File TEMP_FILE = new File(new File(System.getProperty("user.home") + "/.simonstrator"), "road_network.tmp");
private static final boolean TRAIN_PATH_PROBABILITIES = false;
private static final boolean TRAIN_PATH_PROBABILITIES = true;
private Random _random = Randoms.getRandom(getClass());
......
......@@ -27,6 +27,8 @@ import de.tudarmstadt.maki.simonstrator.api.Host;
import de.tudarmstadt.maki.simonstrator.api.Time;
import de.tudarmstadt.maki.simonstrator.api.common.graph.INodeID;
import de.tudarmstadt.maki.simonstrator.api.component.ComponentNotAvailableException;
import de.tudarmstadt.maki.simonstrator.api.component.privacy.PrivacyComponent;
import de.tudarmstadt.maki.simonstrator.api.component.privacy.PrivacyLevel;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.environment.data.properties.VehicleProperty;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.AttractionPoint;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.Location;
......@@ -42,6 +44,7 @@ import de.tudarmstadt.maki.simonstrator.api.component.sis.type.SiSTypes;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.VehicleInformationComponent;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.SimulationSetupExtractor;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.api.VehicleController;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.hybrid.VehicularReceiver;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkEdge;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.RoadNetworkRoute;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.roadnetwork.exception.NoAdditionalRouteAvailableException;
......@@ -181,8 +184,16 @@ public class DefaultVehicleInformationComponent implements VehicleInformationCom
@Override
public VehicleProperty getVehicleProperty() {
PrivacyLevel privacyLevel = PrivacyLevel.NO_PRIVACY;
try {
PrivacyComponent privacyComponent = getHost().getComponent(PrivacyComponent.class);
privacyLevel = privacyComponent.getPrivacyLevel();
} catch (ComponentNotAvailableException e) {
// Nothing to be done
}
return new VehicleProperty(host.getId().value(), getLastLocation(),
getCurrentRoute().getStart(), getCurrentSpeed(), getLength());
getCurrentRoute().getStart(), getCurrentSpeed(), getLength(), privacyLevel);
}
@Override
......
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