本文整理汇总了Python中nupic.support.configuration.Configuration.getInt方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.getInt方法的具体用法?Python Configuration.getInt怎么用?Python Configuration.getInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nupic.support.configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.getInt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createAndStartSwarm
# 需要导入模块: from nupic.support.configuration import Configuration [as 别名]
# 或者: from nupic.support.configuration.Configuration import getInt [as 别名]
def createAndStartSwarm(client, clientInfo="", clientKey="", params="",
minimumWorkers=None, maximumWorkers=None,
alreadyRunning=False):
"""Create and start a swarm job.
Args:
client - A string identifying the calling client. There is a small limit
for the length of the value. See ClientJobsDAO.CLIENT_MAX_LEN.
clientInfo - JSON encoded dict of client specific information.
clientKey - Foreign key. Limited in length, see ClientJobsDAO._initTables.
params - JSON encoded dict of the parameters for the job. This can be
fetched out of the database by the worker processes based on the jobID.
minimumWorkers - The minimum workers to allocate to the swarm. Set to None
to use the default.
maximumWorkers - The maximum workers to allocate to the swarm. Set to None
to use the swarm default. Set to 0 to use the maximum scheduler value.
alreadyRunning - Insert a job record for an already running process. Used
for testing.
"""
if minimumWorkers is None:
minimumWorkers = Configuration.getInt(
"nupic.hypersearch.minWorkersPerSwarm")
if maximumWorkers is None:
maximumWorkers = Configuration.getInt(
"nupic.hypersearch.maxWorkersPerSwarm")
return ClientJobsDAO.get().jobInsert(
client=client,
cmdLine="$HYPERSEARCH",
clientInfo=clientInfo,
clientKey=clientKey,
alreadyRunning=alreadyRunning,
params=params,
minimumWorkers=minimumWorkers,
maximumWorkers=maximumWorkers,
jobType=ClientJobsDAO.JOB_TYPE_HS)