From 24a7340e61b018da532deae33e26cc5959a3dd38 Mon Sep 17 00:00:00 2001 From: jdcpni Date: Thu, 2 Dec 2021 20:17:50 -0500 Subject: [PATCH] - --- .../modulatory/control/controlmechanism.py | 2 +- .../control/optimizationcontrolmechanism.py | 29 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/psyneulink/core/components/mechanisms/modulatory/control/controlmechanism.py b/psyneulink/core/components/mechanisms/modulatory/control/controlmechanism.py index 67034619dfe..8e5c1de0e05 100644 --- a/psyneulink/core/components/mechanisms/modulatory/control/controlmechanism.py +++ b/psyneulink/core/components/mechanisms/modulatory/control/controlmechanism.py @@ -1548,7 +1548,7 @@ def _instantiate_input_ports(self, input_ports=None, context=None): self.aux_components = [] for i in range(len(projection_specs)): - if option == SEPARATE: + if option == SEPARATE: # Each outcome_input_port get its own Projection outcome_port_index = i else: diff --git a/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py b/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py index ba0c82106b3..532daf6a76a 100644 --- a/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py +++ b/psyneulink/core/components/mechanisms/modulatory/control/optimizationcontrolmechanism.py @@ -1204,7 +1204,7 @@ def _validate_params(self, request_set, target_set=None, context=None): f"{STATE_FEATURES}) or a dict with entries of the form " f":.") if len(convert_to_list(state_feat_fcts))>1: - invalid_fct_specs = [fct_spec for fct_spec in state_feat_fcts if not fct_spec in state_feats] + invalid_fct_specs = [fct_spec for fct_spec in state_feat_fcts if fct_spec not in state_feats] if invalid_fct_specs: raise OptimizationControlMechanismError(f"The following entries of the dict specified for " f"'{STATE_FEATURE_FUNCTIONS} of {self.name} have keys that " @@ -1468,18 +1468,18 @@ def _instantiate_control_signals(self, context): Assign each modulatory_signal sequentially to corresponding item of control_allocation. """ - # # MODIFIED 11/21/21 NEW: - # # FIX - PURPOSE OF THE FOLLOWING IS TO "CAPTURE" CONTROL SPECS MADE LOCALLY ON MECHANISMS IN THE COMP - # # AND INSTANTIATE ControlSignals FOR THEM HERE, ALONG WITH THOSE SPECIFIED IN THE CONSTRUCTOR - ## FOR THE OCM. ALSO CAPTURES DUPLICATES (SEE MOD BELOW). - # # FIX: WITHOUT THIS, GET THE mod param ERROR; WITH IT, GET FAILURES IN test_control: - # # TestModelBasedOptimizationControlMechanisms_Execution - # # test_evc - # # test_stateful_mechanism_in_simulation - # # TestControlMechanisms: - # # test_lvoc - # # test_lvoc_both_prediction_specs - # # test_lvoc_features_function + # MODIFIED 11/21/21 NEW: + # FIX - PURPOSE OF THE FOLLOWING IS TO "CAPTURE" CONTROL SPECS MADE LOCALLY ON MECHANISMS IN THE COMP + # AND INSTANTIATE ControlSignals FOR THEM HERE, ALONG WITH THOSE SPECIFIED IN THE CONSTRUCTOR + # FOR THE OCM. ALSO CAPTURES DUPLICATES (SEE MOD BELOW). + # FIX: WITHOUT THIS, GET THE mod param ERROR; WITH IT, GET FAILURES IN test_control: + # TestModelBasedOptimizationControlMechanisms_Execution + # test_evc + # test_stateful_mechanism_in_simulation + # TestControlMechanisms: + # test_lvoc + # test_lvoc_both_prediction_specs + # test_lvoc_features_function # if self.agent_rep and self.agent_rep.componentCategory=='Composition': # control_signals_from_composition = self.agent_rep._get_control_signals_for_composition() # self.output_ports.extend(control_signals_from_composition) @@ -2141,5 +2141,4 @@ def add_state_features(self, features, context=None): if features: features = self._parse_state_feature_specs(features=features, context=context) - self.add_ports(InputPort, features) - + self.add_ports(InputPort, features) \ No newline at end of file