Skip to content

Commit

Permalink
Fixed averaging issues in CastaliaResults (see #549). Minor bug fixes…
Browse files Browse the repository at this point in the history
… in Castalia and CastaliaPlot
  • Loading branch information
yuritse committed Jun 16, 2011
1 parent 6552f9a commit ac070d4
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 97 deletions.
23 changes: 15 additions & 8 deletions Castalia/bin/Castalia
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ parser.add_option("-o","--output", dest="output", type="string", metavar="FILE",
parser.add_option("-r","--repeat", dest="repeat", type="int", metavar="N", default=1, help="Number of repetitions for each unique scenario")
(options,args) = parser.parse_args()

if len(args):
quit("\nERROR: unexpected argument\n"+args[0])

customConfigList = []

def makeConfig(c,dictionary):
Expand Down Expand Up @@ -303,23 +306,27 @@ for ini in iniList:
if options.debug: print result
raw_result = []
for line in result.split("\n"):
m = re.match("Scenario:\s(.*)\$repetition=\d+$",line)
m = re.match("Scenario:\s(.*)\$repetition=(\d+)$",line)
if (m):
raw_result = []
has_result = 0
line = m.group(1).replace("$","").replace(" ","").strip(",")
if len(line) > 0:
if len(baselabel): label = baselabel + "," + line
else: label = line
if len(label) == 0: label = "None"
fr.write("Castalia| label:"+label+"\n")
label = m.group(1).replace("$","").replace(" ","").strip(",")
if len(label) == 0:
if len(baselabel) > 0:
label = baselabel
else:
label = "None"
elif len(baselabel) > 0:
label = baselabel + "," + label
fr.write("Castalia| repeat:"+m.group(2)+" label:"+label+"\n")
continue
if (re.match("^Castalia|\s+(.*)$",line)):
fr.write(line + "\n")
has_result = 1
else:
raw_result.append(line)
if not has_result: fr.write("\n".join(raw_result))
if not has_result:
fr.write("\n".join(raw_result))

if not options.debug: commands.getoutput("rm omnetpp.tmp")
fr.close()
1 change: 1 addition & 0 deletions Castalia/bin/CastaliaPlot
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ for line in lines:
l,n = data.pop(0).split(" ",1)
data = reorder(data)
n = int(n)
if l == "seed": l = labels[plot_all]
if labels[plot_all] != l: plot_all = plot_all + 1
if labels[plot_all] != l:
print "CastaliaPlot: WARNING unexpected label in the table '" + l + "'"
Expand Down
Loading

0 comments on commit ac070d4

Please sign in to comment.