Skip to content

Generator Configuration

Hayley Howard edited this page Mar 15, 2018 · 32 revisions

The GeneratorConfig class contains the variables required for proper operation of the Generator. A user should update the hardcoded variables within the __init__() function before creating a Generator object. If the configuration must be updated at a later time, the GeneratorConfig class does include various "setter" and "getter" functions to update or verify the configuration. See the "Sample Code" section for examples on how to do this. The "References" section details a list of all available functionality in GeneratorConfig.

GeneratorConfig source code location:

/Generator/generator_framework/generator_config.py

Sample Code

Getting the current configuration from your Generator object:

my_generator = Generator()

print(my_generator._Config.get_config())

Setting a new configuration:

my_generator = Generator()

my_generator._Config.set_config('database', 7, 1.255 * 10000000, 0, 1.25 * 1500000, 0, 6, .5, datetime.date.today(), 8, 1000000, 'poisson')

When setting each configuration parameter separately, it is important to note that the function type should be updated as follows:

my_generator._Config.set_func_type(func_type_name)

Methods

  • set_func_type(string func_type): configure the distribution function type. valid inputs are "poisson" or "weibull"
  • set_config(string db_name, int days, int high_max, int high_min, int low_max, int low_min, int business_hrs, int shape, date() start_date, int work_hr_start, int scale, string func_type): configure every variable of the GeneratorConfig object.
  • get_config(): returns an array with the current Generator Configuration
Clone this wiki locally