Ejemplo n.º 1
0
 def _create_dist(self, name, value, named_dists):
     '''Attempt to create a distribution representing the data in @value.
     If @value is a string, use it as a key for @named_dists.'''
     # A list of values
     if type(value) == type([]):
         map(lambda x : self.__check_value(name, x, [float, int]), value)
         return rv.uniform_choice(value)
     elif type(value) in [float, int]:
         return lambda : value
     elif named_dists and value in named_dists:
         return named_dists[value]
     else:
         raise ValueError("Invalid %s value: %s" % (name, value))
Ejemplo n.º 2
0
import gen.rv as rv
import os
import pprint
import schedcat.generator.tasks as tasks
import shutil as sh

from Cheetah.Template import Template
from common import get_config_option,num_cpus,recordtype
from config.config import DEFAULTS,PARAMS
from gen.dp import DesignPointGenerator
from parse.col_map import ColMapBuilder

NAMED_PERIODS = {
    'harmonic'            : rv.uniform_choice([25, 50, 100, 200]),
    'uni-short'           : rv.uniform_int( 3,  33),
    'uni-moderate'        : rv.uniform_int(10, 100),
    'uni-long'            : rv.uniform_int(50, 250),
}

NAMED_UTILIZATIONS = {
    'uni-very-light': rv.uniform(0.0001, 0.001),
    'uni-light'     : rv.uniform(0.001, 0.1),
    'uni-medium'    : rv.uniform(  0.1, 0.4),
    'uni-heavy'     : rv.uniform(  0.5, 0.9),
    'uni-mixed'     : rv.uniform(0.001, .4),

    'exp-light'     : rv.exponential(0, 1, 0.10),
    'exp-medium'    : rv.exponential(0, 1, 0.25),
    'exp-heavy'     : rv.exponential(0, 1, 0.50),

    'bimo-light'    : rv.multimodal([(rv.uniform(0.001, 0.5), 8),