本文整理汇总了Python中simulation.Simulation.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.__init__方法的具体用法?Python Simulation.__init__怎么用?Python Simulation.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation.Simulation
的用法示例。
在下文中一共展示了Simulation.__init__方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import __init__ [as 别名]
def __init__(self,**kwargs):
if not 'sims' in kwargs:
self.error('sims must be provided')
#end if
sims = kwargs['sims']
self.sims = sims
del kwargs['sims']
files = set()
for sim in sims:
files = files | sim.files
#end for
kwargs['files'] = files
inputs = []
filenames = []
for sim in sims:
inputs.append(sim.input)
filenames.append(sim.infile)
#end for
kwargs['input'] = BundledQmcpackInput(inputs=inputs,filenames=filenames)
Simulation.__init__(self,**kwargs)
deps = []
for sim in sims:
for dep in sim.dependencies:
deps.append((dep.sim,'other'))
#end for
#end for
self.depends(*deps)
示例2: __init__
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import __init__ [as 别名]
def __init__(self,**sim_args):
has_group_atoms = 'group_atoms' in sim_args
group_atoms = True
if has_group_atoms:
group_atoms = sim_args['group_atoms']
del sim_args['group_atoms']
#end if
Simulation.__init__(self,**sim_args)
if group_atoms and isinstance(self.system,PhysicalSystem):
self.system.structure.group_atoms()
示例3: __init__
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import __init__ [as 别名]
def __init__(self,**sim_args):
has_group_atoms = 'group_atoms' in sim_args
group_atoms = False
if has_group_atoms:
group_atoms = sim_args['group_atoms']
del sim_args['group_atoms']
#end if
Simulation.__init__(self,**sim_args)
if group_atoms and isinstance(self.system,PhysicalSystem):
self.warn('requested grouping by atomic species, but pwscf does not group atoms anymore!')
示例4: __init__
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import __init__ [as 别名]
def __init__(self, simYear, batAveYear, N, P, startDate='default',
doubleDown=False, minPA=502, minERA=None, method=1):
Simulation.__init__(self, simYear, startDate)
self.batAveYear = self._check_year(batAveYear)
self.numBots = N
self.numPlayers = P
self.startDate = startDate
self.minPA = minPA
self.minERA = minERA
self.minBatAve = 0 # set upon setup
self.players = [] # set upon setup
self.bots = [] # set upon setup
self.isSetup = False # # set upon setup
self.doubleDown = doubleDown
# default selection method
# see NPReporter self.methods for definitions of methods
self.method = method
示例5: __init__
# 需要导入模块: from simulation import Simulation [as 别名]
# 或者: from simulation.Simulation import __init__ [as 别名]
def __init__(self,*sims,**kwargs):
if len(sims)==1 and isinstance(sims[0],list):
sims = sims[0]
#end if
sims = list(sims) # make a copy
if len(sims)==0:
self.error('attempted to bundle 0 simulations\n at least one simulation must be provided to bundle')
#end if
for sim in sims:
if not isinstance(sim,Simulation):
self.error('attempted to bundle non-simulation object: '+sim.__class__.__name__)
#end if
#end for
relative_paths = False
if 'relative' in kwargs:
relative_paths = kwargs['relative']
del kwargs['relative']
#end if
self.sims = sims
self.bundle_jobs(relative=relative_paths)
self.system = None
if not 'path' in kwargs:
kwargs['path'] = self.sims[0].path
#end if
if not 'job' in kwargs:
kwargs['job'] = self.job
#end if
Simulation.__init__(self,**kwargs)
self.infile = None
if isinstance(self.job.get_machine(),Workstation):
self.outfile = None
self.errfile = None
#end if
self.bundle_dependencies()
#sims in bundle should not submit jobs
for sim in sims:
sim.skip_submit = True