'Returns a list of dictionaries mapping variables to random values in range,
as expected by tupleize_answers.'

def randomize_variables(self, samples):

    variables = samples.split('@')[0].split(',')
    numsamples = int(samples.split('@')[1].split('#')[1])
    sranges = zip(*map((lambda x: map(float, x.split(','))), samples.split('@')[1].split('#')[0].split(':')))
    ranges = dict(zip(variables, sranges))
    out = []
    for _ in range(numsamples):
        var_dict = {}
        for var in ranges:
            value = random.uniform(*ranges[var])
            var_dict[str(var)] = value
        out.append(var_dict)
    return out
