diff options
| author | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-06-09 12:02:37 -0400 |
|---|---|---|
| committer | Björn B. Brandenburg <bbb@cs.unc.edu> | 2010-06-09 12:02:37 -0400 |
| commit | a0afdca82d1b408d67c2ae91aa7e888d1db33def (patch) | |
| tree | 23f753edc21d2fe35587802a5ff780f0cd6f1c7b | |
| parent | 61d816ccbf9e179e5dd9abd4a6056bcaeef7fb05 (diff) | |
support labelling "new" distributions
| -rwxr-xr-x | plot.py | 20 |
1 files changed, 20 insertions, 0 deletions
| @@ -1,5 +1,8 @@ | |||
| 1 | #!/usr/bin/env python | 1 | #!/usr/bin/env python |
| 2 | import defapp | 2 | import defapp |
| 3 | |||
| 4 | import re | ||
| 5 | |||
| 3 | from os.path import splitext, basename | 6 | from os.path import splitext, basename |
| 4 | from optparse import make_option as o | 7 | from optparse import make_option as o |
| 5 | from tempfile import NamedTemporaryFile as Tmp | 8 | from tempfile import NamedTemporaryFile as Tmp |
| @@ -86,6 +89,23 @@ def scenario_heading(conf, want_period=False): | |||
| 86 | dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)' | 89 | dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)' |
| 87 | elif 'heavy' in conf: | 90 | elif 'heavy' in conf: |
| 88 | dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)' | 91 | dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)' |
| 92 | else: | ||
| 93 | # try regular expressions | ||
| 94 | m = re.match('uni-(\d\.\d+)-(\d\.\d+)', conf['dist']) | ||
| 95 | if m: | ||
| 96 | dist = "utilization uniformly in [%s, %s]" % (m.group(1), m.group(2)) | ||
| 97 | m = re.match('bimo-([^-]+)-(\d\.\d+)', conf['dist']) | ||
| 98 | if m: | ||
| 99 | weight = m.group(1) | ||
| 100 | cap = m.group(2) | ||
| 101 | dist = 'util. bimodally ' | ||
| 102 | if 'light' == weight: | ||
| 103 | dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, %s] (1/9)' % cap | ||
| 104 | elif 'medium' == weight: | ||
| 105 | dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, %s] (3/9)' % cap | ||
| 106 | elif 'heavy' == weight: | ||
| 107 | dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, %s] (5/9)' % cap | ||
| 108 | |||
| 89 | if want_period: | 109 | if want_period: |
| 90 | if '33' in conf: | 110 | if '33' in conf: |
| 91 | dist += '; period uniformly in [3, 33]' | 111 | dist += '; period uniformly in [3, 33]' |
