本文整理汇总了Python中Simulation.simulate方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.simulate方法的具体用法?Python Simulation.simulate怎么用?Python Simulation.simulate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Simulation
的用法示例。
在下文中一共展示了Simulation.simulate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: plot_species
# 需要导入模块: import Simulation [as 别名]
# 或者: from Simulation import simulate [as 别名]
hill_connections = (np.eye(NCells,k=-1) + np.eye(NCells,k=1)) > 0
# a -> pnt
sim.add_interaction('a','pnt','hill_activ',hill_connections,params=[1.0,1.5,4])
# a -> notch
sim.add_interaction('a','notch','hill_activ',hill_connections,params=[1.5,0.5,2])
'''
# start with only first cell up
low_dict = {'a':0.0,'s':0.0,'h':0.0,'u':0.0,'y':0.0,'p':0.0,'sp':0.0,'m':0.0}
high_dict = {'a':1.0+F,'s':1.0,'h':0.0,'u':0.0,'y':0.0,'p':0.0,'sp':0.0,'m':0.0}
sim.set_initial_conditions(range(0,NCells),low_dict)
sim.set_initial_conditions([0],high_dict)
print 'starting simulation'
t = np.linspace(0,225,100)
cdata = sim.simulate(t)
print 'simulation done'
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib.gridspec as gridspec
x_coord = np.linspace(1,NCells,NCells)
# plot species at various times
def plot_species(species_name,times):
tindices = [np.abs(t-v).argmin() for v in times]
astatus = np.zeros((NCells,len(tindices)))
for i in xrange(NCells):
for j in xrange(len(tindices)):
示例2: main
# 需要导入模块: import Simulation [as 别名]
# 或者: from Simulation import simulate [as 别名]
def main(start_day=1, end_day=80, extend_days=0, price_per_kg=0.25, food_cost=0.35, facility_cost=2.89, r_value=0.00, cycles_per_year=2, restriction=0.05):
sim = Simulation(start_day, end_day, extend_days, price_per_kg, food_cost, facility_cost, r_value, cycles_per_year, restriction)
sim.simulate()
sim.print_end_costs()
return sim