# Path: phievo/Networks/mutation.py
# T=1.0 #typical time scale
# C=1.0 #typical concentration
# L=1.0 #typical size for diffusion
#                 E_I=log(interval[1]/min_param) #range of possible energies
# def ligand_fct(random_generator):
# def build_lists(mutation_dict):
# def sample_dictionary_ranges(key,random_generator):
# def random_parameters(Types,random_generator):
# def rand_modify(self,random_generator):
#     def __init__(self,generator = random.Random()):
#     def compute_Cseed(self):
#     def random_Species(self, Type='Species'):
#     def random_Interaction(self,Interaction_Type):
#     def remove_Interaction(self,Type):
#     def random_remove_output(self):
#     def random_add_output(self):
#     def random_change_output(self):
#     def random_duplicate(self):
#     def mutate_Node(self,Type):
#     def build_mutations(self):
#         def update_dict(self,dictionary,key,name):
#     def compute_next_mutation(self):
#     def mutate_and_integrate(self,prmt,nnetwork,tgeneration,mutation=True):
# class Mutable_Network(classes_eds2.Network):
# 
# Path: phievo/Networks/initialization.py
# T=1.0 #typical time scale
# C=1.0 #typical concentration
# L=1.0 #typical size for diffusion
#    L=mutation.Mutable_Network(g)
# def init_network():
# def fitness_treatment(population):
# 
# Path: phievo/initialization_code.py
# def init_evolution(inits, deriv2):
# def check_model_dir(model):
# def init_networks(inits):
# def get_network_from_test(test_py, classes_eds2):
# def initialize_test(init_py):
# def parameters2file(inits, file_name):
# def make_workplace_dir(parent_dir):
# def display_error(msg = 'ERROR',filename = 'error.txt'):


import ipywidgets as w
import phievo.ConfigurationTools.widgetfunctions as wf
import phievo.ConfigurationTools.containers as wc
import phievo.ConfigurationTools.initnetwork as inet
import os
from IPython.display import display
from phievo.Networks import mutation
from phievo.Networks import initialization
from phievo.initialization_code import ccode_dir,python_path
from shutil import copyfile


doc_url = "http://phievo.readthedocs.io/en/latest/"

pfile = {"deriv2" : "phievo.Networks.deriv2",
             "interaction" : "phievo.Networks.interaction",
             "pretty_graph": "phievo.Networks.lovelyGraph",
             "plotdata" : "phievo.Networks.plotdata"}

cfile = {
    "fitness":  "Create a template file",
    "init_history":  "Create a template file",
    "input": "Create a template file",
    "header" : os.path.join(ccode_dir,'integrator_header.h'),
    "utilities" : os.path.join(ccode_dir,'utilities.c'),
    "geometry" : os.path.join(ccode_dir,'linear_geometry.c'),
    "integrator" : os.path.join(ccode_dir,'euler_integrator.c'),
    "main" : os.path.join(ccode_dir,'main_general.c')
}

prmt = initialization.prmt
restart = prmt.pop("restart")


# Path: phievo/Networks/mutation.py
# T=1.0 #typical time scale
# C=1.0 #typical concentration
# L=1.0 #typical size for diffusion
#                 E_I=log(interval[1]/min_param) #range of possible energies
# def ligand_fct(random_generator):
# def build_lists(mutation_dict):
# def sample_dictionary_ranges(key,random_generator):
# def random_parameters(Types,random_generator):
# def rand_modify(self,random_generator):
#     def __init__(self,generator = random.Random()):
#     def compute_Cseed(self):
#     def random_Species(self, Type='Species'):
#     def random_Interaction(self,Interaction_Type):
#     def remove_Interaction(self,Type):
#     def random_remove_output(self):
#     def random_add_output(self):
#     def random_change_output(self):
#     def random_duplicate(self):
#     def mutate_Node(self,Type):
#     def build_mutations(self):
#         def update_dict(self,dictionary,key,name):
#     def compute_next_mutation(self):
#     def mutate_and_integrate(self,prmt,nnetwork,tgeneration,mutation=True):
# class Mutable_Network(classes_eds2.Network):
# 
# Path: phievo/Networks/initialization.py
# T=1.0 #typical time scale
# C=1.0 #typical concentration
# L=1.0 #typical size for diffusion
#    L=mutation.Mutable_Network(g)
# def init_network():
# def fitness_treatment(population):
# 
# Path: phievo/initialization_code.py
# def init_evolution(inits, deriv2):
# def check_model_dir(model):
# def init_networks(inits):
# def get_network_from_test(test_py, classes_eds2):
# def initialize_test(init_py):
# def parameters2file(inits, file_name):
# def make_workplace_dir(parent_dir):
# def display_error(msg = 'ERROR',filename = 'error.txt'):


# Path: phievo/ConfigurationTools/application.py
import ipywidgets as w
import phievo.ConfigurationTools.widgetfunctions as wf
import phievo.ConfigurationTools.containers as wc
import phievo.ConfigurationTools.initnetwork as inet
import os
from IPython.display import display
from phievo.Networks import mutation
from phievo.Networks import initialization
from phievo.initialization_code import ccode_dir,python_path
from shutil import copyfile



doc_url = "http://phievo.readthedocs.io/en/latest/"

pfile = {"deriv2" : "phievo.Networks.deriv2",
             "interaction" : "phievo.Networks.interaction",
             "pretty_graph": "phievo.Networks.lovelyGraph",
             "plotdata" : "phievo.Networks.plotdata"}

cfile = {
    "fitness":  "Create a template file",
    "init_history":  "Create a template file",
    "input": "Create a template file",
    "header" : os.path.join(ccode_dir,'integrator_header.h'),
    "utilities" : os.path.join(ccode_dir,'utilities.c'),
    "geometry" : os.path.join(ccode_dir,'linear_geometry.c'),
    "integrator" : os.path.join(ccode_dir,'euler_integrator.c'),
    "main" : os.path.join(ccode_dir,'main_general.c')
}

prmt = initialization.prmt
restart = prmt.pop("restart")


mutation.dictionary_ranges['CorePromoter.delay']=0   # convert to int(T/dt) in run_evolution.py