OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 # This script is used to plot simulation dynamics. | 10 # This script is used to plot simulation dynamics. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 return self._subplot | 42 return self._subplot |
43 | 43 |
44 def getYMax(self): | 44 def getYMax(self): |
45 return self._y_max | 45 return self._y_max |
46 | 46 |
47 def getNumberOfFlows(self): | 47 def getNumberOfFlows(self): |
48 return len(self.samples) | 48 return len(self.samples) |
49 | 49 |
50 | 50 |
51 def addSample(self, line): | 51 def addSample(self, line): |
52 groups = re.search(r'_(((\d)+((,(\d)+)*))_(\D+))#\d@(\S+)', line) | 52 if '#' not in line: |
53 return | |
stefan-webrtc
2016/09/23 13:49:41
Is this still needed?
Gaetano Carlucci
2016/09/23 14:05:36
no. thanks
| |
54 | |
55 groups = re.search(r'_(((\d)+((,(\d)+)*))_(\D+))#\d:(\d)@(\S+)', line) | |
53 | 56 |
54 # Each variable will be plotted in a separated box. | 57 # Each variable will be plotted in a separated box. |
55 var_name = groups.group(1) | 58 var_name = groups.group(1) |
56 alg_name = groups.group(8) | 59 alg_name = groups.group(9) |
57 | 60 |
58 alg_name = alg_name.replace('_', ' ') | 61 alg_name = alg_name.replace('_', ' ') |
59 | 62 |
60 if alg_name not in self.samples.keys(): | 63 if alg_name not in self.samples.keys(): |
61 self.samples[alg_name] = {} | 64 self.samples[alg_name] = {} |
62 | 65 |
63 if var_name not in self.samples[alg_name].keys(): | 66 if var_name not in self.samples[alg_name].keys(): |
64 self.samples[alg_name][var_name] = [] | 67 self.samples[alg_name][var_name] = [] |
65 | 68 |
66 sample = re.search(r'(\d+\.\d+)\t([-]?\d+\.\d+)', line) | 69 sample = re.search(r'(\d+\.\d+)\t([-]?\d+\.\d+)', line) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 ax = fig.add_subplot(n, 1, v.getSubplot()) | 160 ax = fig.add_subplot(n, 1, v.getSubplot()) |
158 plotVar(v, ax, i == 0, i == n - 1) | 161 plotVar(v, ax, i == 0, i == n - 1) |
159 i += 1 | 162 i += 1 |
160 | 163 |
161 if save_figure: | 164 if save_figure: |
162 fig.savefig(test_name + ".png") | 165 fig.savefig(test_name + ".png") |
163 plt.show() | 166 plt.show() |
164 | 167 |
165 if __name__ == '__main__': | 168 if __name__ == '__main__': |
166 main() | 169 main() |
OLD | NEW |