Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
jdcpni committed Dec 3, 2021
1 parent 552fc04 commit 24a7340
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"<state_feature>:<function>.")
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 "
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)

0 comments on commit 24a7340

Please sign in to comment.