# Path: MultiNEAT/viz.py
# def Draw(x, size=(300,300)):
#     img = np.zeros((size[0], size[1], 3), dtype=np.uint8)
#     img += 10
# 
#     if isinstance(x, NeuralNetwork):
#         DrawPhenotype(img, (0, 0, 250, 250), x )
#     else:
#         nn = NeuralNetwork()
#         x.BuildPhenotype(nn)
#         DrawPhenotype(img, (0, 0, 250, 250), nn )
# 
#     return img


import sys
import random as rnd
import cv2
import numpy as np
import MultiNEAT as NEAT
import pygame
import pymunk as pm
import progressbar as pbar
import pickle
from MultiNEAT.viz import Draw
from pygame.locals import *
from pygame.color import *
from pymunk import Vec2d
from pymunk.pygame_util import draw, from_pygame
ns_Pmin_lowering_multiplier = 0.9
ns_Pmin_raising_multiplier = 1.1
ns_quick_archiving_min_evals = 8


max_evaluations = 10000

screen_size_x, screen_size_y = 600, 600
max_timesteps = 1200

collision_type_wall = 0
collision_type_nn = 1
collision_type_ball = 2
collision_type_floor = 3

params = NEAT.Parameters()
params.PopulationSize = 150
params.DynamicCompatibility = True
params.AllowClones = False
params.AllowLoops = True
params.CompatTreshold = 5.0
params.CompatTresholdModifier = 0.3
params.YoungAgeTreshold = 15
params.SpeciesMaxStagnation = 100
params.OldAgeTreshold = 35
params.MinSpecies = 3
params.MaxSpecies = 10
params.RouletteWheelSelection = True
params.RecurrentProb = 0.2
params.OverallMutationRate = 0.02

# Path: MultiNEAT/viz.py
# def Draw(x, size=(300,300)):
#     img = np.zeros((size[0], size[1], 3), dtype=np.uint8)
#     img += 10
# 
#     if isinstance(x, NeuralNetwork):
#         DrawPhenotype(img, (0, 0, 250, 250), x )
#     else:
#         nn = NeuralNetwork()
#         x.BuildPhenotype(nn)
#         DrawPhenotype(img, (0, 0, 250, 250), nn )
# 
#     return img


# Path: examples/NoveltySearch.py
import sys
import random as rnd
import cv2
import numpy as np
import MultiNEAT as NEAT
import pygame
import pymunk as pm
import progressbar as pbar
import pickle
from MultiNEAT.viz import Draw
from pygame.locals import *
from pygame.color import *
from pymunk import Vec2d
from pymunk.pygame_util import draw, from_pygame

ns_Pmin_lowering_multiplier = 0.9
ns_Pmin_raising_multiplier = 1.1
ns_quick_archiving_min_evals = 8


max_evaluations = 10000

screen_size_x, screen_size_y = 600, 600
max_timesteps = 1200

collision_type_wall = 0
collision_type_nn = 1
collision_type_ball = 2
collision_type_floor = 3

params = NEAT.Parameters()
params.PopulationSize = 150
params.DynamicCompatibility = True
params.AllowClones = False
params.AllowLoops = True
params.CompatTreshold = 5.0
params.CompatTresholdModifier = 0.3
params.YoungAgeTreshold = 15
params.SpeciesMaxStagnation = 100
params.OldAgeTreshold = 35
params.MinSpecies = 3
params.MaxSpecies = 10
params.RouletteWheelSelection = True
params.RecurrentProb = 0.2
params.OverallMutationRate = 0.02

params.MutateWeightsProb = 0.90