Commit 5b735208 authored by Tobias Meuser's avatar Tobias Meuser
Browse files

Final version for Springer book

parent 90029522
/* /*
* Copyright (c) 2005-2010 KOM Multimedia Communications Lab * Copyright (c) 2005-2010 KOM Multimedia Communications Lab
* *
* This file is part of Simonstrator.KOM. * This file is part of Simonstrator.KOM.
* *
...@@ -22,6 +22,8 @@ package de.tudarmstadt.maki.simonstrator.api.component.pubsub; ...@@ -22,6 +22,8 @@ package de.tudarmstadt.maki.simonstrator.api.component.pubsub;
import de.tudarmstadt.maki.simonstrator.api.component.overlay.OverlayContact; import de.tudarmstadt.maki.simonstrator.api.component.overlay.OverlayContact;
public interface SubscriptionListener { public interface BypassCloudListener {
void onSubscribeAtBroker(OverlayContact pSubscriber, Subscription[] subscriptions); void onSubscribeAtBroker(OverlayContact pSubscriber, Subscription[] subscriptions);
void onNotificationArrivedAtBroker(Notification pNotification);
} }
...@@ -120,7 +120,9 @@ public class VectoralJamProperty extends NumericVectoralProperty { ...@@ -120,7 +120,9 @@ public class VectoralJamProperty extends NumericVectoralProperty {
@Override @Override
public EnvironmentProperty getDefaultProperty() { public EnvironmentProperty getDefaultProperty() {
return new VectoralJamProperty(getLocation(), getEdge()); VectoralJamProperty jamProperty = new VectoralJamProperty(getLocation(), getEdge());
jamProperty.setSpeed(getEdge().getOriginalMaxSpeedState());
return jamProperty;
} }
@Override @Override
......
/* /*
* Copyright (c) 2005-2010 KOM Multimedia Communications Lab * Copyright (c) 2005-2010 KOM Multimedia Communications Lab
* *
* This file is part of Simonstrator.KOM. * This file is part of Simonstrator.KOM.
* *
...@@ -23,5 +23,9 @@ package de.tudarmstadt.maki.simonstrator.api.component.vehicular.relevance; ...@@ -23,5 +23,9 @@ package de.tudarmstadt.maki.simonstrator.api.component.vehicular.relevance;
import de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation; import de.tudarmstadt.maki.simonstrator.api.component.vehicular.information.PointInformation;
public interface ImpactFunction<T extends PointInformation> { public interface ImpactFunction<T extends PointInformation> {
double calculateImpact(T pInformation); default double calculateImpact(T pInformation) {
return calculateImpact(pInformation.getDetectionDate());
}
double calculateImpact(long pDetectionDate);
} }
...@@ -117,7 +117,7 @@ public abstract class AbstractQoIBasedImpactFunction<T extends PointInformation> ...@@ -117,7 +117,7 @@ public abstract class AbstractQoIBasedImpactFunction<T extends PointInformation>
} }
ttl = getTTL(pInformation.get(0)); ttl = getTTL(pInformation.get(0));
numberOfMessages = amount * ttl / (difference + Time.SECOND); numberOfMessages = amount * ttl * SCALING / (difference + Time.SECOND);
rate = ttl / (double) numberOfMessages; rate = ttl / (double) numberOfMessages;
...@@ -149,11 +149,9 @@ public abstract class AbstractQoIBasedImpactFunction<T extends PointInformation> ...@@ -149,11 +149,9 @@ public abstract class AbstractQoIBasedImpactFunction<T extends PointInformation>
double pErrorProbability, double pNumberOfMessages, double pCostWrongKeep, double pCostWrongChange); double pErrorProbability, double pNumberOfMessages, double pCostWrongKeep, double pCostWrongChange);
@Override @Override
public double calculateImpact(T pInformation) { public double calculateImpact(long pDetectionDate) {
double impact = calculateImpact(1 - accuracy, numberOfMessages, double impact = calculateImpact(1 - accuracy, numberOfMessages,
(((pInformation.getDetectionDate() - maxTimestamp) / SCALING + ttl) / (double) ttl) * numberOfMessages, ((ttl - (maxTimestamp - pDetectionDate) / SCALING) / (double) ttl) * numberOfMessages, b) / (accuracy);
b)
/ (accuracy);
return impact; return impact;
} }
......
...@@ -186,6 +186,10 @@ public class RoadNetworkEdge { ...@@ -186,6 +186,10 @@ public class RoadNetworkEdge {
return _originalMaxSpeed; return _originalMaxSpeed;
} }
public double getOriginalMaxSpeedState() {
return RoadNetworkEdge.getCorrespondingState(_originalMaxSpeed);
}
public int getLaneAmount() { public int getLaneAmount() {
return _lanes.size(); return _lanes.size();
} }
......
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