本文整理汇总了Python中Analyzer.Analyzer.getFunctionResults方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.getFunctionResults方法的具体用法?Python Analyzer.getFunctionResults怎么用?Python Analyzer.getFunctionResults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.getFunctionResults方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import getFunctionResults [as 别名]
#.........这里部分代码省略.........
os.remove(filename)
except:
print >>sys.stderr, "Couldn't delete temporal file: %s" % filename
def _getSelectedResultNames(self):
resultNames = []
for i in xrange(self.analyzer.nResults):
implementationItem = self.solutionSelector.layout().itemAt(i).widget()
if implementationItem.isChecked():
resultNames.append(str(implementationItem.text()))
return resultNames
def exportAllImages(self):
settings = QSettings()
directory = settings.value(MainWindow.__PREF_SAVE_ALL__).toString()
directory = QFileDialog.getExistingDirectory(self, "Select a directory to export to", directory)
if directory is None or not os.path.exists(directory):
return
self.analyzer.exportAllImages(directory, self._getSelectedResultNames())
settings.setValue(MainWindow.__PREF_SAVEL_ALL__, QVariant(directory))
self.statusBar().showMessage("Images saved!", 5000)
def computeMetricsAsync(self):
self.statusBar().showMessage("Computing metrics...")
QTimer.singleShot(0, self.computeMetrics)
def computeMetrics(self):
self._computeMetrics(self.currentSolution.functionName)
self.statusBar().showMessage("Metrics computed!", 5000)
def _computeMetrics(self, functionName):
pareto = self.analyzer.getFunctionPareto(functionName)
solutions = self.analyzer.getFunctionResults(functionName, self._getSelectedResultNames())
self.metrics.updateMetrics(pareto, solutions, functionName)
def helpAbout(self):
QMessageBox.about(
self,
"About Image Changer",
"""<b>Multi-Objective Optimization Interface</b> v%s
<p>Copyright © 2011-2012 %s All rights reserved.
<p>This application can be used to perform simple optimization analysis.
<p><a href='%s'>%s</a>
<p>Python %s - Qt %s - PyQt %s on %s"""
% (
__VERSION__,
__AUTHOR__,
__WEBSITE__,
__WEBSITE__,
platform.python_version(),
QT_VERSION_STR,
PYQT_VERSION_STR,
platform.system(),
),
)
def addImplementation(self):
if self.analyzer.nResults == 0:
directory = ""
else:
directory = os.path.abspath(os.path.join(str(self.analyzer.resultDirectories[-1]), os.path.pardir))
directory = QFileDialog.getExistingDirectory(
self, "Select a directory to scan", directory, QFileDialog.ShowDirsOnly
)
if not os.path.exists(directory) or directory in self.analyzer.resultDirectories: