@@ -115,6 +115,8 @@ def create_sced_instance(data_provider:DataProvider,
115
115
assert current_state is not None
116
116
117
117
sced_md = data_provider .get_initial_actuals_model (options , sced_horizon , current_state .minutes_per_step )
118
+ options .plugin_context .callback_manager .invoke_after_get_initial_actuals_model_for_sced_callbacks (
119
+ options , sced_md )
118
120
119
121
# Set initial state
120
122
_copy_initial_state_into_model (options , current_state , sced_md )
@@ -382,6 +384,8 @@ def create_deterministic_ruc(options,
382
384
383
385
# Create a new model
384
386
md = data_provider .get_initial_forecast_model (options , ruc_horizon , 60 )
387
+ options .plugin_context .callback_manager .invoke_after_get_initial_forecast_model_for_ruc_callbacks (
388
+ options , md )
385
389
386
390
initial_ruc = current_state is None or current_state .timestep_count == 0
387
391
@@ -627,6 +631,8 @@ def create_simulation_actuals(
627
631
# Get a new model
628
632
total_step_count = options .ruc_horizon * 60 // step_size_minutes
629
633
md = data_provider .get_initial_actuals_model (options , total_step_count , step_size_minutes )
634
+ options .plugin_context .callback_manager .invoke_after_get_initial_actuals_model_for_simulation_actuals_callbacks (
635
+ options , md )
630
636
631
637
# Fill it in with data
632
638
if this_hour == 0 :
@@ -706,12 +712,11 @@ def _ensure_contingencies_monitored(options:Options, md:EgretModel, initial_ruc:
706
712
def _copy_initial_state_into_model (options :Options ,
707
713
current_state :SimulationState ,
708
714
md :EgretModel ):
709
- for g , initial_status in current_state .get_all_initial_generator_state ():
710
- md .data ['elements' ]['generator' ][g ]['initial_status' ] = initial_status
711
- for g , initial_p_output in current_state .get_all_initial_power_generated ():
712
- md .data ['elements' ]['generator' ][g ]['initial_p_output' ] = initial_p_output
713
- for s , initial_state_of_charge in current_state .get_all_initial_state_of_charge ():
714
- md .data ['elements' ]['storage' ][s ]['initial_state_of_charge' ] = initial_state_of_charge
715
+ for g , g_dict in md .elements ('generator' , generator_type = 'thermal' ):
716
+ g_dict ['initial_status' ] = current_state .get_initial_generator_state (g )
717
+ g_dict ['initial_p_output' ] = current_state .get_initial_power_generated (g )
718
+ for s ,s_dict in md .elements ('storage' ):
719
+ s_dict ['initial_state_of_charge' ] = current_state .get_initial_state_of_charge (s )
715
720
716
721
def get_attrs_to_price_option (options :Options ):
717
722
'''
0 commit comments