コード例 #1
0
 def test_unidades_tiempo_definidas(símismo):
     bf = ModeloPrueba(unid_tiempo='દિવસ')
     cnctd = Conectado(bf, símismo.mds)
     cnctd.conectar(var_mds='Aleatorio', var_bf='Escala', mds_fuente=False)
     cnctd.estab_conv_tiempo(mod_base='mds', conv=30)
     res = cnctd.simular(10, vars_interés=['bf_Escala', 'mds_Aleatorio'])
     npt.assert_array_equal(res['mds_Aleatorio'], np.arange(11 * 30,
                                                            step=30))
コード例 #2
0
                        'Capacity per tubewell': cp,
                        'Fw': fw,
                        'Policy Canal lining': cl,
                        'Policy RH': rw,
                        'Policy Irrigation improvement': ir
                    }

# 3. Now create the model
# Create a coupled model instance
modelo = Conectado()

# Establish SDM and Biofisical model paths. The Biofisical model path must point to the Python wrapper for the model
modelo.estab_mds(
    os.path.join(os.path.split(__file__)[0], 'Vensim', 'Tinamit_Rechna.vpm'))
modelo.estab_bf(Envoltura)
modelo.estab_conv_tiempo(mod_base='mds', conv=6)

# Couple models(Change variable names as needed)
modelo.conectar(var_mds='Soil salinity Tinamit CropA',
                mds_fuente=False,
                var_bf="CrA - Root zone salinity crop A")
modelo.conectar(var_mds='Soil salinity Tinamit CropB',
                mds_fuente=False,
                var_bf="CrB - Root zone salinity crop B")
modelo.conectar(var_mds='Area fraction Tinamit CropA',
                mds_fuente=False,
                var_bf="Area A - Seasonal fraction area crop A")
modelo.conectar(var_mds='Area fraction Tinamit CropB',
                mds_fuente=False,
                var_bf="Area B - Seasonal fraction area crop B")
modelo.conectar(var_mds='Watertable depth Tinamit',