Ejemplo n.º 1
0
theta = 3  # optimum of natural selection
gamma = 1.006e-07  # intensity of natural selection
r = 1  # growth rate
a = 2.346e-06  # intensity of competition
K = 10e12  # carrying capacity
nu=1.1e-05
Vmax = 1
scalar = 20000


#full tree and pruned tree directory
dir_path = './'

files = dir_path + 'treedata/'

td = DVTreeData(path=files, scalar=scalar)

# parameter settings
obs_param = DVParamLiang(gamma=gamma, a=a, K=K,h=1, nu=nu, r=1, theta=theta,V00=.1,V01=.1, Vmax=Vmax, inittrait=theta, initpop=500,
                initpop_sigma = 10.0, break_on_mu=False)


population = 1000
obs_param_TVMlog10 = np.tile(obs_param, (population, 1))
simmodelTVM = dvcpp.DVSimTVMLog10(td, obs_param_TVMlog10)
valid_TVM = np.where(simmodelTVM['sim_time'] == td.sim_evo_time)[0].size
print(valid_TVM);


for rep in range(100):
    simresult = DVSimTVMLog10(td,obs_param)
Ejemplo n.º 2
0
import numpy as np
import timeit as time
from dvtraitsim_shared import DVTreeData, DVParam
import dvtraitsim_cpp as dvcpp
from dvtraitsim_py import DVSim
import pycuda.driver as drv
from gpusim import gpusim
no_tree = 1
K = 10e8
nu = 1 / (100 * K)
gamma = 0.001
a = 0.1
dir_path = 'c:/Liang/Googlebox/Research/Project2'
files = dir_path + '/treesim_newexp/example%d/' % no_tree

td = DVTreeData(path=files, scalar=100000)

obs_param = DVParam(gamma=gamma,
                    a=a,
                    K=K,
                    nu=nu,
                    r=1,
                    theta=0,
                    Vmax=1,
                    inittrait=0,
                    initpop=500,
                    initpop_sigma=10.0,
                    break_on_mu=False)

start = drv.Event()
end = drv.Event()