Skip to content

Commit

Permalink
Fixed logic where numLayers=0 did not send any more segments; moved r…
Browse files Browse the repository at this point in the history
…eporting to messages after warmup of 1 day; replaced 60 hour runs by 6 hours trends are similar after 36 hours
  • Loading branch information
atbits committed Oct 11, 2018
1 parent 626ec45 commit f9b819d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 11 deletions.
2 changes: 1 addition & 1 deletion data/reports.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Scenario.name = %%Scenario.subname%%_N%%Scenario.nodeNotes%%_R%%Scenario.flow%%_

Report.nrofReports = 2
# length of the warm up period (simulated seconds)
Report.warmup = 0
Report.warmup = 86400
# default directory of reports (can be overridden per Report with output setting)
Report.reportDir = reports/
# Report classes to load
Expand Down
2 changes: 1 addition & 1 deletion data/ttl/60hrs.txt → data/ttl/06hrs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# 172800
# 43200
# 216000
Group.msgTtl = 3600
Group.msgTtl = 360
12 changes: 6 additions & 6 deletions one_list.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#~/bin/bash
bStr=" -b 1"
bStr=" -b 5"
bCmd="java -Xmx512M -cp target:lib/ECLA.jar:lib/DTNConsoleConnection.jar core.DTNSim ${bStr} data/def.txt data/vct.txt "
eCmd="data/reports.txt"

nonLinear="data/flow/nonLinear.txt"
prefCC="data/prefCC.txt"
fullAdapt="data/fullAdapt.txt"
ttlList="12 24 36 48 60"
ttlList="24 36 48 12"

for ttl in ${ttlList} ; do
# five runs for Full Adapt, prefCC, nonLinear, Linear, nonSVC
# five runs for Full Adapt, prefCC, nonLinear, Linear, nonSVC - only Full Adapt and nonSVC for now
echo "${bCmd} ${nonLinear} ${fullAdapt} data/ttl/${ttl}hrs.txt ${eCmd}"
echo "${bCmd} ${nonLinear} ${prefCC} data/ttl/${ttl}hrs.txt ${eCmd}"
echo "${bCmd} ${nonLinear} data/ttl/${ttl}hrs.txt ${eCmd}"
# echo "${bCmd} ${nonLinear} ${prefCC} data/ttl/${ttl}hrs.txt ${eCmd}"
# echo "${bCmd} ${nonLinear} data/ttl/${ttl}hrs.txt ${eCmd}"

echo "${bCmd} data/ttl/${ttl}hrs.txt ${eCmd}"
# echo "${bCmd} data/ttl/${ttl}hrs.txt ${eCmd}"

echo "${bCmd} data/flow/nonSVC.txt data/ttl/${ttl}hrs.txt ${eCmd}"

Expand Down
2 changes: 1 addition & 1 deletion report.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

ttlList="720 1440 2160 2880 3600"
ttlList="720 1440 2160 2880"
flowList="low medium high"
contorlList="nonSVC sAdptAndCC"
nodeList="base drop1 drop2 drop4"
Expand Down
12 changes: 10 additions & 2 deletions src/routing/SNWAdaptiveRouter.java
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ protected void sendBurst() {
layerLast = numLayers;
}
if(0 != (adaptMode & SRC_ADAPT)) {
if(burstId * burstGap> 24 * 3600)
if(burstId * burstGap> 6 * 3600)
adaptLayerLast();

}
Expand All @@ -350,6 +350,7 @@ protected void sendBurst() {
burstId++;
}

int ack0=0, ack1=0, ack2=0, ack3=0;
// adapt based on acks - presently same logic as scripts
void adaptLayerLast() {
int ackCount=0;
Expand All @@ -361,22 +362,28 @@ void adaptLayerLast() {
msgId = "B" + String.format("%04d", burstId - 4 * sixHrBurstCount) + "_L0";
if(srcAckList.contains(msgId)) ackCount++;
if(ackCount ==0) {
ack0++;
if(layerLast > 0.15 * numLayers)
layerLast = 0.98 * layerLast;
} else if(ackCount ==1){
ack1++;
if(layerLast > 0.33 * numLayers)
layerLast = 0.99 * layerLast;
else
layerLast = 0.002 + layerLast;
} else if(ackCount ==2){
ack2++;
if(layerLast > 0.66 * numLayers)
layerLast = 0.995 * layerLast;
else
layerLast = 0.005 + layerLast;
} else { // ackCount ==3
ack3++;
if(layerLast < numLayers)
layerLast = 0.01 + layerLast;
}
if(layerLast < 1.1) layerLast = 1.1;
if(layerLast > numLayers) layerLast = numLayers;
}

List<String> ackList = new ArrayList<String>();
Expand Down Expand Up @@ -430,7 +437,8 @@ void printSummary() {
SNWAdaptiveRouter destRtr = ((SNWAdaptiveRouter)dstHost.getRouter());
System.out.println("At time " + SimClock.getIntTime() / 3600 + " hours Sent=" + sentCount +
" BL-rcvd=" + destRtr.baseLayerCount + " delivered=" + destRtr.destRcvdCount +
" layerLast " + layerLast);
" layerLast " + layerLast + " ackCounts " + ack0 + ", "+ ack1 + ", "+
ack2 + ", "+ ack3);
}

@SuppressWarnings(value = { "unchecked", "rawtypes" }) /* ugly way to make this generic */
Expand Down

0 comments on commit f9b819d

Please sign in to comment.