From 72bdd360e1c4a4e3bf5dccd7a75fa2d6c7f5baa6 Mon Sep 17 00:00:00 2001
From: Anne-Liza <a.m.r.m.bruggeman@student.tudelft.nl>
Date: Mon, 26 Nov 2018 14:01:36 +0100
Subject: [PATCH] Added sleep_time to create_mathematical_problem()

Former-commit-id: d8302d0cd26b1ed4cff3216ae62f1b6ab5250ef7
---
 kadmos/graph/graph_data.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/kadmos/graph/graph_data.py b/kadmos/graph/graph_data.py
index ef7794ae2..c12a6e3d2 100644
--- a/kadmos/graph/graph_data.py
+++ b/kadmos/graph/graph_data.py
@@ -1724,19 +1724,24 @@ class RepositoryConnectivityGraph(DataGraph):
             self.add_node('D{0}'.format(discipline + 1), category='function', instance=1, function_type='regular')
             runtime_range = kwargs['runtime_range'] if 'runtime_range' in kwargs else []
             if runtime_range:
-                self.nodes['D{0}'.format(discipline + 1)]['performance_info'] = {'run_time': random.randint(
-                    runtime_range[0], runtime_range[1])}
+                run_time_node = random.randint(runtime_range[0], runtime_range[1])
+                self.nodes['D{0}'.format(discipline + 1)]['performance_info'] = {'run_time': run_time_node}
+                self.nodes['D{0}'.format(discipline + 1)]['sleep_time'] = run_time_node
             else:
-                self.nodes['D{0}'.format(discipline + 1)]['performance_info'] = {'run_time': 1}
+                self.nodes['D{0}'.format(discipline + 1)]['performance_info'] = {'run_time': 0}
+                self.nodes['D{0}'.format(discipline + 1)]['sleep_time'] = 0
             for local_constraint in range(n_local_constraints[discipline]):  # Local constraints
                 self.add_node('G{0}_{1}'.format(discipline+1, local_constraint+1), category='function', instance=1,
                               function_type='regular')
                 self.nodes['G{0}_{1}'.format(discipline+1, local_constraint+1)]['performance_info'] = {'run_time': 0}
+                self.nodes['G{0}_{1}'.format(discipline+1, local_constraint+1)]['sleep_time'] = 0
         self.add_node('F', category='function', instance=1, function_type='regular')  # Objective
         self.nodes['F']['performance_info'] = {'run_time': 0}
+        self.nodes['F']['sleep_time'] = 0
         for constraint in range(n_global_constraints):  # Global constraints
             self.add_node('G0{0}'.format(constraint + 1), category='function', instance=1, function_type='regular')
             self.nodes['G0{0}'.format(constraint + 1)]['performance_info'] = {'run_time': 0}
+            self.nodes['G0{0}'.format(constraint + 1)]['sleep_time'] = 0
 
         # All variable nodes are defined
         for global_var in range(n_global_var):  # Global design variables
@@ -6598,8 +6603,8 @@ class MdaoDataGraph(DataGraph, MdaoMixin):
             # If there is no converger node or if the converger is an optimizer (IDF), then change the coupled functions
             # to post-coupling functions
             if converger is None or self.nodes[converger]['architecture_role'] == self.ARCHITECTURE_ROLES_FUNS[1] or \
-                    (any(self.SUBSYS_PREFIX + self.CONVERGER_STRING in node for node in self.nodes) and not
-                        self.SYS_PREFIX + self.CONVERGER_STRING in self.nodes):
+                    (self.graph['problem_formulation']['mdao_architecture'] == self.OPTIONS_ARCHITECTURES[2] and
+                     'distr_function_ordering' in self.graph):
                 if 'distr_function_ordering' in self.graph:
                     distr_function_ordering = self.graph['distr_function_ordering']
                     post_desvars_functions = copy.deepcopy(distr_function_ordering[0][self.FUNCTION_ROLES[4]])
-- 
GitLab