Permalink
Browse files

Adds DeltaP indicator.

  • Loading branch information...
1 parent b102831 commit 6bdc8229389058d5cc38aaf48723cc96fdfd2fb3 @wkoder committed Apr 11, 2012
Showing with 21 additions and 15 deletions.
  1. +2 −2 src/Analyzer.py
  2. +13 −7 src/Metrics.py
  3. +6 −6 src/MetricsCalc.py
View
@@ -302,7 +302,7 @@ def generateBestImage(self, functionName, highlight, filename, worst=False):
metrics = Metrics(pareto, [results[0][1]])
for run in xrange(len(results[0][1])):
metrics.setSolutionsToCompare(0, run, None, None)
- value = metrics.invertedGenerationalDistance()
+ value = metrics.deltaP()
if value*factor < bestValue*factor:
bestValue = value
generation[i] = run
@@ -324,7 +324,7 @@ def _getFunctionLatex(self, functionName, reportDir, highlight):
desc = highlight
if desc is None:
desc = "all results"
- caption = "run of %s for %s (according to IGD)." % (desc, functionName)
+ caption = "run of %s for %s (according to DeltaP)." % (desc, functionName)
bestImage = Analyzer.__IMAGES_DIR__ + functionName + "_best_fun.png"
self.generateBestImage(functionName, highlight, reportDir + bestImage)
View
@@ -47,23 +47,29 @@ def generationalDistance(self):
"""
return self.momet.generationalDistance(self.functions[self.a][self.aIdx], self.paretoOptimal)
- def generationalDistanceAlt(self):
+ def generationalDistanceP(self):
"""
- Computes the generational distance from the obtained solution set to the optimal Pareto front.
+ Computes the alternative generational distance from the obtained solution set to the optimal Pareto front.
"""
- return self.momet.generationalDistanceAlt(self.functions[self.a][self.aIdx], self.paretoOptimal)
+ return self.momet.generationalDistanceP(self.functions[self.a][self.aIdx], self.paretoOptimal)
def invertedGenerationalDistance(self):
"""
- Computes the generational distance from the obtained solution set to the optimal Pareto front.
+ Computes the inverted generational distance from the obtained solution set to the optimal Pareto front.
"""
return self.momet.invertedGenerationalDistance(self.functions[self.a][self.aIdx], self.paretoOptimal)
- def invertedGenerationalDistanceAlt(self):
+ def invertedGenerationalDistanceP(self):
"""
- Computes the generational distance from the obtained solution set to the optimal Pareto front.
+ Computes the alternative inverted generational distance from the obtained solution set to the optimal Pareto front.
+ """
+ return self.momet.invertedGenerationalDistanceP(self.functions[self.a][self.aIdx], self.paretoOptimal)
+
+ def deltaP(self):
+ """
+ Computes the delta P from the obtained solution set to the optimal Pareto front.
"""
- return self.momet.invertedGenerationalDistanceAlt(self.functions[self.a][self.aIdx], self.paretoOptimal)
+ return self.momet.deltaP(self.functions[self.a][self.aIdx], self.paretoOptimal)
def errorRatio(self):
"""
View
@@ -29,14 +29,14 @@ def computeMetrics(self, optimalPareto, solutions):
self.nSolutions = len(self.solutionNames)
metrics = Metrics(optimalPareto, solutionData)
- unaryMetrics = ['Error ratio', 'Generational distance', 'Generational distance (alt)', 'Inverted generational distance', \
- 'Inverted generational distance (alt)', 'Spacing', "Hypervolume"]
+ unaryMetrics = ['Error ratio', 'Generational distance', 'Inverted generational distance', 'Delta P', \
+ 'Spacing', "Hypervolume"]
unaryMetricOptType = [MetricsCalc.__MIN__, MetricsCalc.__MIN__, MetricsCalc.__MIN__, MetricsCalc.__MIN__, \
- MetricsCalc.__MIN__, MetricsCalc.__MIN__, MetricsCalc.__MAX__]
+ MetricsCalc.__MIN__, MetricsCalc.__MAX__]
unaryMetricType = [MetricsCalc.__CONV__, MetricsCalc.__CONV__, MetricsCalc.__CONV__, MetricsCalc.__CONV__, \
- MetricsCalc.__CONV__, MetricsCalc.__DIST__, [MetricsCalc.__CONV__, MetricsCalc.__DIST__]]
- unaryMetricFunction = [metrics.errorRatio, metrics.generationalDistance, metrics.generationalDistanceAlt, metrics.invertedGenerationalDistance, \
- metrics.invertedGenerationalDistanceAlt, metrics.spacing, metrics.hypervolume]
+ MetricsCalc.__DIST__, [MetricsCalc.__CONV__, MetricsCalc.__DIST__]]
+ unaryMetricFunction = [metrics.errorRatio, metrics.generationalDistance, metrics.invertedGenerationalDistance, metrics.deltaP, \
+ metrics.spacing, metrics.hypervolume]
self.nUnaryMetrics = len(unaryMetrics)
binaryMetrics = ['Coverage', 'Additive epsilon', 'Multiplicative epsilon']
binaryMetricOptType = [MetricsCalc.__MAX__, MetricsCalc.__MIN__, MetricsCalc.__MIN__]

0 comments on commit 6bdc822

Please sign in to comment.