예제 #1
0
def run_lsystem(lsystem='simple_maize_nolight.lpy', parameters=None):
    if parameters:
        lsys = Lsystem(lsystem, {'parameters': parameters})
    else:
        lsys = Lsystem(lsystem)
    lstring = lsys.iterate()
    lscene = lsys.sceneInterpretation(lstring)
    return lsys, lstring, lscene
예제 #2
0
def test_mtglpy_topvine():
    fn = path('vinemtg_n.lpy')
    if not fn.exists():
        return

    l = Lsystem(str(fn))
    parameters = {}
    parameters['carto_file'] = 'geom_n.dat'
    parameters['picle_file'] = 'vine_n.dat'
    parameters['TTfin'] = None

    #l.context().updateNamespace(parameters)

    c_iter = l.getLastIterationNb()
    nbstep = l.derivationLength - c_iter
    tree = l.iterate(l.axiom, c_iter, nbstep)

    scene = l.sceneInterpretation(tree)

    mtg = lpy2mtg(tree, l, scene)

    print(len(mtg))
    axial_tree = AxialTree()
    axial_tree = mtg2lpy(mtg, l, axial_tree)

    g = lpy2mtg(axial_tree, l, scene)

    assert len(g) == len(mtg)
    #axial_tree = mtg2axialtree(mtg, scale, parameters, axial_tree)

    # Check
    assert True
    return mtg, tree, axial_tree
예제 #3
0
def generate_bgeom(step=None):
    from openalea.lpy import Lsystem
    import os
    print('Scene generator launched')
    l = Lsystem(
        lsysfile, {
            'RESOLUTION': 2,
            'daystep': 1,
            'TIMEBAR': False,
            'LEAFY': True,
            'WITH_INFLO': True,
            'EXPORT_TO_MTG': False
        })

    if step is None:
        firststep = 0
        nbsteps = l.derivationLength
    else:
        firststep = step
        nbsteps = step + 1

    open(stepfile, 'w').write(str(nbsteps))
    if not os.path.exists(workingrep): os.makedirs(workingrep)
    for step in range(firststep, nbsteps):
        if step == firststep: lstring = l.derive(firststep + 1)
        else: lstring = l.derive(lstring, step, 1)
        lscene = l.sceneInterpretation(lstring)
        fname = join(workingrep, bgeomfile.format(str(step).zfill(4)))
        lscene.save(tempbgeomfile)
        os.rename(tempbgeomfile, fname)
        print("Scene", step, "generated ...")
예제 #4
0
    def update_itable(self):
        path = str(self.dirname / 'index-table.json')
        self.write_itable(self.itable, path)

        # update combi_parameters.csv
        path = str(self.dirname / 'combi_params.csv')

        parameters = self.itable.values()
        allkeys = set().union(*parameters)

        def _missing(d):
            return len(allkeys - set(d.keys()))

        if any([_missing(p) for p in parameters]):
            self.activate()
            new = []
            for p in parameters:
                lsys = Lsystem(self.walter, {'params': p})
                newp = {
                    k: lsys.context().locals().get(k, 'undef')
                    for k in allkeys
                }
                new.append(newp)
            parameters = new

        combi = []
        for k, v in zip(self.itable, parameters):
            d = {'ID': k}
            d.update(v)
            combi.append(d)
        df = pd.DataFrame(combi)
        df.to_csv(path, index=False, sep='\t')
def run_lsys(**kwds):
    params = {k: v for k, v in _lsys_params.iteritems()}
    params.update(kwds)
    l = Lsystem('sensitivityanalysis.lpy', params)
    lstring = l.iterate()
    lscene = l.sceneInterpretation(lstring)
    return lstring, lscene
예제 #6
0
def force_cut(lstring):
    fake_rule = """
    Fake:
      produce Fake"""
    fake_lsys = Lsystem()
    fake_lsys.addRule(fake_rule)
    fake_lsys.axiom = lstring
    return fake_lsys.iterate()
예제 #7
0
def run_lgrass(scenario_id=1,
               inputs_dir_path='inputs',
               outputs_dir_path='outputs'):
    """ Run lgrass.lpy file from external script

    :param str inputs_dir_path: the path to the input files (meteo, list of simulations...)
    :param str outputs_dir_path: the path to the outputs files
    :param int scenario_id: the index of the scenario to be run from the list of simulations CSV file

    """

    # Scenario to be run
    scenarii_df = pd.read_csv(os.path.join('inputs', 'plan_simulation.csv'),
                              index_col='Scenario')
    scenario = scenarii_df.loc[scenario_id].to_dict()
    scenario_name = scenario['name']

    # Update parameters of flowering model
    flowering_model = lgrass.flowering_functions.FloweringFunctions()
    flowering_model.param.__dict__.update(
        (k, scenario[k])
        for k in set(scenario).intersection(flowering_model.param.__dict__))

    # Load lsystem
    lpy_filename = os.path.join(lgrass.__path__[0], "lgrass.lpy")
    lsystem = Lsystem(lpy_filename)

    # Update parameters
    lsystem.option_profile = "plateau"
    lsystem.flowering_model = flowering_model
    lsystem.derivationLength = int(scenario['derivationLength'])
    lsystem.option_tallage = scenario['option_tallage']
    lsystem.option_senescence = scenario['option_senescence']
    lsystem.option_floraison = scenario['option_floraison']
    lsystem.meteo_path = os.path.join(inputs_dir_path,
                                      scenario['meteo_filename'])
    lsystem.sowing_date = scenario['sowing_date']
    lsystem.site = scenario['site']
    lsystem.output_induction_file_name = '{}_induction'.format(scenario_name)
    lsystem.output_organ_lengths_file_name = '{}_organ_lengths'.format(
        scenario_name)
    lsystem.cutting_dates = [] if pd.isna(scenario['cutting_dates']) \
        else [scenario['cutting_dates']] if isinstance(scenario['cutting_dates'], int) \
        else [int(i) for i in scenario['cutting_dates'].split("_")]
    lsystem.ParamP[0]['C'] = scenario['value_C']
    lsystem.ParamP[0]['Premiecroiss'] = scenario['Premiecroiss']
    lsystem.ParamP[0]['PS_compensation_point'] = scenario[
        'PS_compensation_point']
    if outputs_dir_path:
        lsystem.OUTPUTS_DIRPATH = outputs_dir_path

    # Run the lsystem
    try:
        lsystem.derive(
        )  # permet le declenchement de la fonction "End" du script lpy
        lsystem.clear()
    except Exception as e:
        print(e)
예제 #8
0
def str2mtg(s):
    #s = s.replace('N', 'F')
    tree = AxialTree(s)
    l = Lsystem()
    l.addInterpretationRule('N --> F', 0)
    geom_tree = l.homomorphism(tree)
    scene = l.sceneInterpretation(geom_tree)
    scale = dict(list(zip(('P', 'A', 'N', 'L', 'F'), (1, 2, 3, 3, 3))))
    mtg = axialtree2mtg(tree, scale, scene)
    return tree, mtg, scene
예제 #9
0
def test_cut_bug():
    lsystem_file = pj(data_access.get_data_dir(), 'check_cut_module.lpy')
    lsys = Lsystem(lsystem_file)
    lstring = lsys.iterate()
    # cut branches
    new_lstring = force_cut(lstring)
    lscene = lsys.sceneInterpretation(lstring)
    for sid in lscene.todict():
        assert sid in range(len(lstring))
        # suucceed if correction is needed (old lpy version)
        # assert new_lstring[sid].name == 'Internode'
        #  succeed on more recent lpy version
        assert lstring[sid].name == 'Internode'
예제 #10
0
def test_run(overwrite_desired_data=False):
    lpy_filename = os.path.join(lgrass.__path__[0], "lgrass.lpy")
    lsys = Lsystem(lpy_filename)
    axiom = lsys.axiom

    lsys.meteo_path = os.path.join(INPUTS_DIRPATH, 'meteo_file.csv')
    lsys.INPUTS_DIRPATH = INPUTS_DIRPATH
    lsys.OUTPUTS_DIRPATH = OUTPUTS_DIRPATH
    lsys.GRAPHS_DIRPATH = GRAPHS_DIRPATH
    lsys.derivationLength = NSTEP
    lsys.DureeExp = NSTEP
    lsys.option_tallage = True
    lsys.option_senescence = True
    lsys.option_floraison = True
    lsys.option_caribu = 'Off'
    lsys.option_tiller_regression = False
    lsys.option_mophogenetic_regulation_by_carbone = False
    lsys.derive(axiom, NSTEP)

    # convert the outputs to Pandas dataframe
    surface_biomass = pd.read_csv(lsys.chemin_fichier1.name)
    evol = pd.read_csv(lsys.chemin_fichier2.name)
    output_induction_file_path = os.path.join(OUTPUTS_DIRPATH,
                                              'output_induction.csv')
    output_induction = pd.read_csv(output_induction_file_path)
    output_organ_lengths_file_path = os.path.join(OUTPUTS_DIRPATH,
                                                  'output_organ_lengths.csv')
    output_organ_lengths = pd.read_csv(output_organ_lengths_file_path)

    # # compare outputs
    compare_actual_to_desired(OUTPUTS_DIRPATH, surface_biomass,
                              DESIRED_SORTIE_SURFACE_BIOMASS_FILENAME,
                              lsys.chemin_fichier1.name,
                              overwrite_desired_data)
    compare_actual_to_desired(OUTPUTS_DIRPATH, evol,
                              DESIRED_SERIE_FOLIAIRE_FILENAME,
                              lsys.chemin_fichier2.name,
                              overwrite_desired_data)
    compare_actual_to_desired(OUTPUTS_DIRPATH, output_induction,
                              DESIRED_OUTPUT_INDUCTION_FILENAME,
                              output_induction_file_path,
                              overwrite_desired_data)
    compare_actual_to_desired(OUTPUTS_DIRPATH, output_organ_lengths,
                              DESIRED_OUTPUT_ORGAN_LENGTHS_FILENAME,
                              output_organ_lengths_file_path,
                              overwrite_desired_data)

    if overwrite_desired_data:
        print("New desired files written")
    else:
        print("Test passed successfully")
예제 #11
0
def lsystem(file_name, axiom='', derivationlength=-1, parameters={}):
    """ Build a lsystem object from file_name """
    l = Lsystem(file_name, parameters)

    if len(axiom):
        l.makeCurrent()
        if type(axiom) != AxialTree:
            axiom = AxialTree(axiom)
        l.axiom = axiom
        #l.done()
    if derivationlength >= 0:
        l.derivationLength = derivationlength

    return l
예제 #12
0
def generate(seed = 0, tree = 0, fdist = 4, regenerate = False):
    from openalea.lpy import Lsystem
    import os
    rep = glob.glob(pattern.format(tree, seed, '*' , fdist))
    if len(rep) == 2 and not regenerate: 
        print('Do not regenerate', seed, tree, fdist)
        return True
    l = Lsystem(lsysfile,{'RESOLUTION' : 1, 'daystep' : 30, 'TIMEBAR' : False, 'LEAFY' : True, 'WITH_INFLO' : True, 'EXPORT_TO_MTG' : False, 'TREE' : tree, 'SEED' : seed, 'FRUITBRANCHSIZE' : fdist})
    if l.tree_load:
        print('Generate', seed, tree, fdist)
        try:
            lstring = l.derive()
            return True
        except:
            return False
    else :
        print('Not loaded tree', tree)
        return False
예제 #13
0
    def run(self, sim_id=None, dry_run=False, **kwds):
        """Run WALTer in project dir

        Parameters
        ----------
        sim_id:
            simulation identifier
        dry_run: (bool)
            prevent running the simulation (do only side effects).
        **kwds:
            walter parameters values (as named arguments)

        Examples
        --------
           p = Project()
           p.run(nb_plt_utiles=1,
                dist_border_x=0,
                dist_border_y=0,
                nbj=30,
                beginning_CARIBU=290)

        Returns
        -------
            the lsystem and lstring generated by the run
        """

        self.activate()
        already_known_id = self.itable.keys()
        if sim_id is None:
            sim_id = self.get_id(kwds)
        if sim_id not in already_known_id:
            self.update_itable()
        lsys, lstring = None, None
        if not dry_run:
            lsys = Lsystem(self.walter, {'params': kwds, 'ID': sim_id})
            time_start = time.time()
            lstring = lsys.iterate()
            time_stop = time.time()
            with open(
                    self.output_path(sim_id=sim_id) / "Simulation_time.txt",
                    'w') as time_file:
                time_file.write(str(time_stop - time_start))

        return lsys, lstring
예제 #14
0
def generate_bgeom(step=None, endstep=None):
    from openalea.lpy import Lsystem
    import os
    print('Scene generator launched')
    l = Lsystem(
        lsysfile, {
            'SEED': 0,
            'TREE': 0,
            'RESOLUTION': 2,
            'TIMESTEP': 1,
            'TIMEBAR': False,
            'LEAFY': True,
            'WITH_INFLO': True,
            'TEXTURE': True,
            'GENERALIZEDCYLINDER': True,
            'WITH_GLM': True,
            'FRUIT_MODEL': False,
            'GLM_RESTRICTION': None,
            '_GLM_TYPE': 3,
            'EXPORT_TO_MTG': False
        })

    if step is None:
        firststep = 0
        endstep = l.derivationLength
    else:
        firststep = step
        if endstep is None:
            endstep = l.derivationLength
        else:
            assert endstep < l.derivationLength

    open(stepfile, 'w').write(str(endstep))
    if not os.path.exists(workingrep): os.makedirs(workingrep)
    for step in range(firststep, endstep):
        if step == firststep: lstring = l.derive(firststep + 1)
        else: lstring = l.derive(lstring, step, 1)
        lscene = l.sceneInterpretation(lstring)
        fname = join(workingrep, bgeomfile.format(str(step).zfill(4)))
        lscene.save(tempbgeomfile)
        os.rename(tempbgeomfile, fname)
        print("Scene", step, "generated ...")
예제 #15
0
def test_mtglpy():
    fn = path('ex_luz4.lpy')
    if not fn.exists():
        return

    l = Lsystem('ex_luz4.lpy')

    tree = l.iterate()

    scene = l.sceneInterpretation(tree)

    mtg = lpy2mtg(tree, l, scene)
    print(len(mtg))
    axial_tree = AxialTree()
    axial_tree = mtg2lpy(mtg, l, axial_tree)
    print(len(axial_tree))
    #axial_tree = mtg2axialtree(mtg, scale, parameters, axial_tree)

    # Check
    assert True
    return mtg, tree
예제 #16
0
    def lpy_plot(self, line):

        from math import ceil, sqrt, floor

        try:
            ip = get_ipython()
        except NameError:
            ip = None

        args = parse_argstring(self.lpy_plot, line)
        file = args.file
        sizes = [int(i.strip()) for i in args.size.split(',')]

        cell = args.cell
        size_display = (int(sizes[0]),
                        int(sizes[1])) if len(sizes) > 1 else (int(sizes[0]),
                                                               int(sizes[0]))

        ls = Lsystem(file)
        rows = cols = ceil(sqrt(ls.derivationLength + 1))
        size = rows * cell
        start = -size / 2 + cell / 2
        sw = SceneWidget(size_display=size_display, size_world=size)
        sw.add(ls.sceneInterpretation(ls.axiom), position=(start, start, 0))

        def plot():
            tree = ls.axiom
            for i in range(1, ls.derivationLength):
                row = floor(i / rows)
                col = (i - row * cols)
                x = row * cell + start
                y = col * cell + start
                tree = ls.derive(tree, i, 1)
                sw.add(ls.sceneInterpretation(tree), (x, y, 0))
            ip.events.unregister('post_run_cell', plot)

        if ip:
            ip.events.register('post_run_cell', plot)

        return sw
예제 #17
0
def parse_extern_modules(lpyfile):
    """ Parse an lpyfile to retrieve its modules and expected extern parameters """
    lines = list(open(lpyfile).readlines())
    externs = set()
    def f(**kwd):
        nonlocal externs
        externs = externs.union(set(kwd.keys()))
    code = ''.join([l for l in lines if l.startswith('extern')])
    n = {'extern' : f, 'externs' : externs}
    exec(code, n, n)
    
            
    code2 = ''.join([l for l in lines if l.startswith('module')])
    from openalea.lpy import Lsystem
    l = Lsystem()
    l.setCode(code2)
    l.makeCurrent()
    modules = {}
    for m in l.execContext().declaredModules():
        modules[m.name] = m.parameterNames
    l.done()
    return externs, modules
예제 #18
0
파일: process_glm.py 프로젝트: jvail/vmango
def generate_mtg(trees=list(range(3)), params=dict()):
    from openalea.lpy import Lsystem
    from openalea.mtg import MTG
    from openalea.mtg.algo import union
    g = None
    for tree in trees:
        print('Generate tree', tree)
        nparams = params.copy()
        nparams.update({
            'TREE': tree,
            'TIMESTEP': 180 if not params['FRUIT_MODEL'] else 90,
            'EXPORT_TO_MTG': True,
            'PARALLELFRUITMODEL': False
        })
        nparams.setdefault('WITH_GLM', True)
        l = Lsystem(basename(lsysfile), nparams)
        lstring = l.iterate()
        resmtg = l.resultmtg
        assert type(resmtg) == MTG
        if g is None:
            g = resmtg
        else:
            g = union(g, resmtg)
    return g
예제 #19
0
    flowering_param.param.temp_vern_min = x[0]
    flowering_param.param.temp_vern_inter = x[1]
    flowering_param.param.temp_vern_max = x[2]
    flowering_param.param.daily_vern_rate = x[3]
    flowering_param.param.basic_vern_rate = x[4]
    flowering_param.param.photoperiod_min = x[5]
    flowering_param.param.photoperiod_max = x[6]
    flowering_param.param.max_photo_ind_rate = x[7]
    flowering_param.param.coeff_primordia_emission_vegetative = x[8]
    flowering_param.param.coeff_primordia_emission_reproductive = x[9]

    name = str(x[10][0]) + "_" + str(x[10][1])
    print(name)
    names.append(name)
    lpy_filename = os.path.join('lgrass.lpy')
    testsim[name] = Lsystem(lpy_filename)
    testsim[name].derivationLength = 200
    testsim[name].meteo_path = 'D:/Simon/Comites_de_these/Comite_de_these_2/Modelisation/Meteo_sites_GEVES_daylength.csv'
    testsim[name].sowing_date = x[10][1]
    testsim[name].site = x[10][0]
    testsim[name].flowering_model = flowering_param
    testsim[name].output_induction_file_name = 'induction_' + name
    testsim[name].output_organ_lengths_file_name = 'organ_lengths_' + name

# function to run an L-system from the 'testsim' dictionnary


def runlsystem(n):
    testsim[names[n]].derive()  # permet le declenchement de la fonction "End" du script lpy
    # print(testsim[names[n]].output_dict)
    # with open(os.path.join(OUTPUTS_DIRPATH, 'sortie_test_path', str(n) + '.csv'), 'wb') as sortie_test_path:
예제 #20
0
def shoot_grow(g, demand_only=True):
    lsys = Lsystem(str(os.path.join(lsysdir, 'morphogenesis.lpy')), {'demand_only': demand_only})
    lsys.axiom = mtg2lpy(g, lsys, AxialTree())
    axt = lsys.iterate()
    scene = lsys.sceneInterpretation(axt)
    return lpy2mtg(axt, lsys, scene)
예제 #21
0
def shoot_init(carbon_seed_stock=0.1):
    lsys = Lsystem(str(os.path.join(lsysdir, 'morphogenesis.lpy')), {'carbon_seed_stock': carbon_seed_stock})
    axialtree = lsys.axiom
    scene = lsys.sceneInterpretation(axialtree)
    return lpy2mtg(axialtree, lsys, scene)
예제 #22
0
# -*- coding: utf-8 -*-
"""Simple converter of lpy files to ply format."""

import os
import sys

from openalea.lpy import Lsystem
from openalea.plantgl.all import Tesselator

usage = """Convert lpy file to ply format
  usage: {} FILE"""
if len(sys.argv) != 2:
    print(usage.format(__name__))

lpy_file = sys.argv[1]
lsys = Lsystem(lpy_file)
ply_file = os.path.splitext(
    os.path.basename(os.path.expanduser(lpy_file)))[0]
ply_file = ply_file + '.ply'

n = lsys.derivationLength
tree = lsys.axiom
for i in range(n):
    # Apply rewritting rules on the tree -> One step of simulation
    tree = lsys.iterate(tree, 1)
    scene = lsys.sceneInterpretation(tree)

d = Tesselator()
nind = 0
nvert = 0
vert_part = ''
예제 #23
0
if len(sys.argv) == 2:
    out_meth = 'ply'
else:
    out_meth = sys.argv[2]

# Connect to I/O channels
in1 = CisInput('LPy_time')
if out_meth == 'ply':
    out = CisPlyOutput('LPy_mesh')
elif out_meth == 'obj':
    out = CisObjOutput('LPy_mesh')
else:
    out = CisAsciiArrayOutput('LPy_mesh', '%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\t%f\n')

# Create lsystem & discretizer
lsys = Lsystem(fname)
d = Tesselator()

# Continue looping until no more input times
# TODO: Automated unit conversion
mm_to_cm = 0.1
flag = True
while (flag):

    # Receive next step
    flag, result = in1.recv()
    if not flag:
        print("LPy: End of input.")
        break
    niter = result[0]
    print("LPy: Received request for step %d" % niter)
예제 #24
0
파일: lpystudio.py 프로젝트: jvail/lpy
def runmodel(fname):
    from openalea.lpy import Lsystem
    l = Lsystem(fname)
    lstring = l.iterate()
    l.plot(lstring)
예제 #25
0
파일: lpystudio.py 프로젝트: jvail/lpy
def animatemodel(fname):
    from openalea.lpy import Lsystem
    l = Lsystem(fname)
    l.animate()
예제 #26
0
#     :param lsystem: lsystem that can be used to create the 3d representation of axialtree
#     :return: adapted axialtree
#     """
#
#     def repr_geom(self):
#         return __scene
#
#     scene = lsystem.sceneInterpretation(axialtree)
#     axialtree.__scene = scene
#     axialtree._repr_geom_ = types.MethodType(repr_geom, axialtree)
#
#     return axialtree

context = {}

lsystem = Lsystem()
axialtree = AxialTree()
# axialtree = adapt_axialtree(axialtree, lsystem)

code = '''

"""
input = lstring="_(0.01)-(90)F(1)"
output = lstring
"""
N = 2

derivation length: N

production: 
예제 #27
0
def createtree(path):
    lsys = Lsystem(path)
    lstring = lsys.iterate()
    lscene = lsys.sceneInterpretation(lstring)
    return lscene
예제 #28
0
def import_lpy_controls(filepath):
    if not path(filepath).isfile():
        return

    control = dict()

    f = open(filepath, 'r')
    script = f.read()
    f.close()

    if script is None: script = ""
    beginTag = LpyParsing.InitialisationBeginTag
    if not beginTag in script:
        return str(script), control
    else:
        txts = str(script).split(beginTag)
        new_script = txts[0]
        context_to_translate = txts[1]
        context = Lsystem().context()
        context.initialiseFrom(beginTag + context_to_translate)

    managers = get_managers()
    visualparameters = []
    scalars = []
    functions = []
    curves = []
    geoms = []

    lpy_code_version = 1.0
    if context.has_key('__lpy_code_version__'):
        lpy_code_version = context['__lpy_code_version__']
    if context.has_key('__scalars__'):
        scalars_ = context['__scalars__']
        scalars = [ProduceScalar(v) for v in scalars_]
    if context.has_key('__functions__') and lpy_code_version <= 1.0:
        functions = context['__functions__']
        for n, c in functions:
            c.name = n
        functions = [c for n, c in functions]
        funcmanager = managers['Function']
        geoms += [(funcmanager, func) for func in functions]
    if context.has_key('__curves__') and lpy_code_version <= 1.0:
        curves = context['__curves__']
        for n, c in curves:
            c.name = n
        curves = [c for n, c in curves]
        curvemanager = managers['Curve2D']
        geoms += [(curvemanager, curve) for curve in curves]
    if context.has_key('__parameterset__'):
        for panelinfo, objects in context['__parameterset__']:
            for typename, obj in objects:
                visualparameters.append((managers[typename], obj))

    for scalar in scalars:
        control[unicode(scalar.name)] = scalar.value
    for (manager, geom) in geoms:
        if geom != list():
            control[geom.getName()] = geom
    for (manager, geom) in visualparameters:
        if geom != list():
            control[geom.getName()] = geom

    new_controls = []
    for name, value in control.items():
        interfaces = guess_interface(value)
        if interfaces:
            new_controls.append(Control(name, interfaces[0], value))

    try:
        control["color map"] = to_color(context.turtle.getColorList())
    except AttributeError:
        pass
    else:
        new_controls.append(
            Control("color map", 'IColorList', control["color map"]))

    for control in new_controls:
        register_control(control)