当前位置: 首页>>代码示例>>Python>>正文


Python Simulation.__init__方法代码示例

本文整理汇总了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)
开发者ID:jyamu,项目名称:qmc,代码行数:31,代码来源:qmcpack.py

示例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()
开发者ID:jyamu,项目名称:qmc,代码行数:12,代码来源:pwscf.py

示例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!')
开发者ID:Paul-St-Young,项目名称:myNexus,代码行数:12,代码来源:pwscf.py

示例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
开发者ID:frahman5,项目名称:beatthestreak,代码行数:21,代码来源:npsimulation.py

示例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
开发者ID:Paul-St-Young,项目名称:myNexus,代码行数:41,代码来源:bundle.py


注:本文中的simulation.Simulation.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。