32 print(
'TurnDataReader.readData() called with infile == None!')
49 matchlb = re.compile(
r'^([0-9]+) (\S+) (\S+)$')
52 matchalg = re.compile(
r'^(\S+)$')
57 for line
in f.readlines():
61 m = matchlb.search(line)
63 if self.
verbose:
print(
'Found data record match:', m.group(1), m.group(2), m.group(3))
68 if m.group(2) ==
'nan':
71 counts =
float(m.group(2))
73 if m.group(3) ==
'nan':
76 turns =
float(m.group(3))
80 print(
'TurnDataReader.readData() found data record with no algorithm defined in', self.
infile)
85 if lb
not in self.
data:
86 self.
data[lb] = dict()
88 self.
data[lb][algId] = (turns, counts)
91 print(
'Alg:', algId,
'LB:', lb,
'Turns:', turns,
'Counts:', counts)
94 m = matchalg.search(line)
96 if self.
verbose:
print(
'Found new algorithm:', m.group(1))
101 print(
'TurnDataReader.readData() found unrecognized algorithm name in', self.
infile)
109 if __name__ ==
'__main__':