summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Koslowski <koslowski@kit.edu>2015-08-31 12:24:48 +0200
committerSebastian Koslowski <koslowski@kit.edu>2015-08-31 12:24:48 +0200
commit656e80a7a25465f2df15533c046f406051bde71b (patch)
treeccda65fee7641ab2a115384d0958d04d7a5e2632
parenta06420691493534ca268ce52e1f16504c216828d (diff)
Revert "Merge remote-tracking branch 'sdh11/complexity'"
This reverts commit 5e645075ebaeb1d32a0a4c7b2e99a4bed8220163, reversing changes made to 73a1a0e9ecdc8ed596271bbe2923d6d976327461.
-rw-r--r--grc/base/FlowGraph.py55
-rw-r--r--grc/blocks/options.xml6
2 files changed, 0 insertions, 61 deletions
diff --git a/grc/base/FlowGraph.py b/grc/base/FlowGraph.py
index 8f008aa7e3..697ae8c47a 100644
--- a/grc/base/FlowGraph.py
+++ b/grc/base/FlowGraph.py
@@ -18,7 +18,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
"""
import time
-import math
from . import odict
from Element import Element
from .. gui import Messages
@@ -64,58 +63,6 @@ class FlowGraph(Element):
def __str__(self):
return 'FlowGraph - %s(%s)' % (self.get_option('title'), self.get_option('id'))
- def get_complexity(self):
- """
- Determines the complexity of a flowgraph
- """
- dbal = 0
- block_list = self.get_blocks()
- for block in block_list:
- # Skip options block
- if block.get_key() == 'options':
- continue
-
- # Don't worry about optional sinks?
- sink_list = filter(lambda c: not c.get_optional(), block.get_sinks())
- source_list = filter(lambda c: not c.get_optional(), block.get_sources())
- sinks = float(len(sink_list))
- sources = float(len(source_list))
- base = max(min(sinks, sources), 1)
-
- # Port ratio multiplier
- if min(sinks, sources) > 0:
- multi = sinks / sources
- multi = (1 / multi) if multi > 1 else multi
- else:
- multi = 1
-
- # Connection ratio multiplier
- sink_multi = max(float(sum(map(lambda c: len(c.get_connections()), sink_list)) / max(sinks, 1.0)), 1.0)
- source_multi = max(float(sum(map(lambda c: len(c.get_connections()), source_list)) / max(sources, 1.0)), 1.0)
- dbal = dbal + (base * multi * sink_multi * source_multi)
-
- elements = float(len(self.get_elements()))
- connections = float(len(self.get_connections()))
- disabled_connections = len(filter(lambda c: not c.get_enabled(), self.get_connections()))
- blocks = float(len(block_list))
- variables = elements - blocks - connections
- enabled = float(len(self.get_enabled_blocks()))
-
- # Disabled multiplier
- if enabled > 0:
- disabled_multi = 1 / (max(1 - ((blocks - enabled) / max(blocks, 1)), 0.05))
- else:
- disabled_multi = 1
-
- # Connection multiplier (How many connections )
- if (connections - disabled_connections) > 0:
- conn_multi = 1 / (max(1 - (disabled_connections / max(connections, 1)), 0.05))
- else:
- conn_multi = 1
-
- final = round(max((dbal - 1) * disabled_multi * conn_multi * connections, 0.0) / 1000000, 6)
- return final
-
def rewrite(self):
def refactor_bus_structure():
@@ -152,8 +99,6 @@ class FlowGraph(Element):
for child in self.get_children(): child.rewrite()
refactor_bus_structure();
- # Update the complexity
- self._options_block.get_param('complexity').set_value(self.get_complexity())
def get_option(self, key):
"""
diff --git a/grc/blocks/options.xml b/grc/blocks/options.xml
index 8502fc3e2a..dc02b83c2a 100644
--- a/grc/blocks/options.xml
+++ b/grc/blocks/options.xml
@@ -178,12 +178,6 @@ part#slurp
</option>
<tab>Advanced</tab>
</param>
- <param>
- <name>Complexity</name>
- <key>complexity</key>
- <value>0</value>
- <type>float</type>
- </param>
<check>not $window_size or len($window_size) == 2</check>
<check>not $window_size or 300 &lt;= $(window_size)[0] &lt;= 4096</check>
<check>not $window_size or 300 &lt;= $(window_size)[1] &lt;= 4096</check>