From a0afdca82d1b408d67c2ae91aa7e888d1db33def Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20B=2E=20Brandenburg?= Date: Wed, 9 Jun 2010 12:02:37 -0400 Subject: support labelling "new" distributions --- plot.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'plot.py') diff --git a/plot.py b/plot.py index c542506..b23f2c5 100755 --- a/plot.py +++ b/plot.py @@ -1,5 +1,8 @@ #!/usr/bin/env python import defapp + +import re + from os.path import splitext, basename from optparse import make_option as o from tempfile import NamedTemporaryFile as Tmp @@ -86,6 +89,23 @@ def scenario_heading(conf, want_period=False): dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, 0.9] (3/9)' elif 'heavy' in conf: dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, 0.9] (5/9)' + else: + # try regular expressions + m = re.match('uni-(\d\.\d+)-(\d\.\d+)', conf['dist']) + if m: + dist = "utilization uniformly in [%s, %s]" % (m.group(1), m.group(2)) + m = re.match('bimo-([^-]+)-(\d\.\d+)', conf['dist']) + if m: + weight = m.group(1) + cap = m.group(2) + dist = 'util. bimodally ' + if 'light' == weight: + dist = dist + 'in [0.001, 0.5] (8/9) and [0.5, %s] (1/9)' % cap + elif 'medium' == weight: + dist = dist + 'in [0.001, 0.5] (6/9) and [0.5, %s] (3/9)' % cap + elif 'heavy' == weight: + dist = dist + 'in [0.001, 0.5] (4/9) and [0.5, %s] (5/9)' % cap + if want_period: if '33' in conf: dist += '; period uniformly in [3, 33]' -- cgit v1.2.2