''' Global Inputs '''
WORKSTATION_JSON = 'Workstations075.json'
EVOLUTION_CYCLES = 10
FIELD_SIZE = 30
DRAW_EVERY_CYCLE = False
SHOW_PRODUCT_PATH = False
TIME_PER_STEP = 0
FADE = False

''' Evolutionary Optimizer Constants '''
POPULATION_SIZE = 50
SELECTION_FACTOR = 0.2  # Linear probability of distribution
MUTATION_FACTOR = 0.4
RECOMBINATION_FACTOR = 0.4
DIVERGENCE_COMPARISON_COUNT = 3

''' Product Optimizer Constants '''
COEVOLUTION_ON = True
PRODUCTS_PER_LIST = 10
PRODUCTS_PATH_LENGTH = 7
LISTS_PER_GENERATION = 5
PRODUCTS_SELECTION_FACTOR = 0.5
PRODUCTS_MUTATION_FACTOR = 0.4
PRODUCTS_RECOMBINATION_FACTOR = 0.4
DIVERGENCE_COMPARISON_COUNT = 3

# DO NOT CHANGE THIS
if not COEVOLUTION_ON:
    LISTS_PER_GENERATION = 1
    PRODUCTS_MUTATION_FACTOR = 0


def getConstantsDict():
    '''Helper function putting all consts into a dict'''
    constantNames = ['WORKSTATION_JSON', 'EVOLUTION_CYCLES', 'FIELD_SIZE',
                     'POPULATION_SIZE', 'SELECTION_FACTOR', 'MUTATION_FACTOR',
                     'RECOMBINATION_FACTOR', 'DIVERGENCE_COMPARISON_COUNT',
                     'COEVOLUTION_ON', 'PRODUCTS_PER_LIST', 'PRODUCTS_PATH_LENGTH',
                     'LISTS_PER_GENERATION', 'PRODUCTS_SELECTION_FACTOR',
                     'PRODUCTS_MUTATION_FACTOR', 'PRODUCTS_RECOMBINATION_FACTOR']
    return dict((name, eval(name)) for name in constantNames)
