本文整理汇总了Python中GPopulation.GPopulation.clearFlags方法的典型用法代码示例。如果您正苦于以下问题:Python GPopulation.clearFlags方法的具体用法?Python GPopulation.clearFlags怎么用?Python GPopulation.clearFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GPopulation.GPopulation
的用法示例。
在下文中一共展示了GPopulation.clearFlags方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: your_func
# 需要导入模块: from GPopulation import GPopulation [as 别名]
# 或者: from GPopulation.GPopulation import clearFlags [as 别名]
#.........这里部分代码省略.........
self.internalPop.proc_pool.join()
else:
logging.debug("CTRL-C detected, finishing evolution.")
if freq_stats: print "\n\tA break was detected, you have interrupted the evolution !\n"
if freq_stats != 0:
self.printStats()
self.printTimeElapsed()
if self.dbAdapter:
logging.debug("Closing the DB Adapter")
if not (self.currentGeneration % self.dbAdapter.getStatsGenFreq() == 0):
self.dumpStatsDB()
self.dbAdapter.commitAndClose()
if self.migrationAdapter:
logging.debug("Closing the Migration Adapter")
if freq_stats: print "Stopping the migration adapter... ",
self.migrationAdapter.stop()
if freq_stats: print "done !"
if s == signal.SIGINT:
print self.bestIndividual()
exit(0)
else:
return self.bestIndividual()
signal.signal(signal.SIGINT, stop_evolution)
while True:
if self.migrationAdapter:
logging.debug("Migration adapter: exchange")
self.migrationAdapter.exchange()
self.internalPop.clearFlags()
self.internalPop.sort()
if not self.stepCallback.isEmpty():
for it in self.stepCallback.applyFunctions(self):
stopFlagCallback = it
if not self.terminationCriteria.isEmpty():
for it in self.terminationCriteria.applyFunctions(self):
stopFlagTerminationCriteria = it
if freq_stats:
if (self.currentGeneration % freq_stats == 0) or (self.getCurrentGeneration() == 0):
self.printStats()
#print self.bestIndividual()
if self.dbAdapter:
if self.currentGeneration % self.dbAdapter.getStatsGenFreq() == 0:
self.dumpStatsDB()
if stopFlagTerminationCriteria:
logging.debug("Evolution stopped by the Termination Criteria !")
if freq_stats:
print "\n\tEvolution stopped by Termination Criteria function !\n"
break
if stopFlagCallback:
logging.debug("Evolution stopped by Step Callback function !")
if freq_stats:
print "\n\tEvolution stopped by Step Callback function !\n"
break
if self.interactiveMode: