|
@@ -42,7 +42,11 @@ public class SimpleLink implements Link {
|
|
|
* whether the status changed during the last simulation step
|
|
|
*/
|
|
|
private boolean statusChanged;
|
|
|
-
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Fixed Delay of the Link
|
|
|
+ */
|
|
|
+ private long fixedDelay = 2;
|
|
|
/**
|
|
|
* Initializes a simple Link with name and an empty devices list.
|
|
|
*
|
|
@@ -162,6 +166,22 @@ public class SimpleLink implements Link {
|
|
|
|
|
|
@Override
|
|
|
public long getTransmissionDelayFrom(SmartDevice from, SmartDevice to) {
|
|
|
- return 0;
|
|
|
+ return fixedDelay;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Set the delay of this Link
|
|
|
+ * @param delay fixed transmission delay
|
|
|
+ */
|
|
|
+ public void setFixedDelay(long delay){
|
|
|
+ this.fixedDelay = delay;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Returns the fixed transmission delay
|
|
|
+ * @return transmission delay
|
|
|
+ */
|
|
|
+ public long getFixedDelay(){
|
|
|
+ return this.fixedDelay;
|
|
|
}
|
|
|
}
|