scheduling_block_instance

Module containing SchedulingBlockInstance class that represents a specific instance of a scheduling block type.

class ska_sdp_resource_model.simulate.scheduling_block_instance.SchedulingBlockInstance(scheduling_block_instance, scheduling_block_group)[source]

Bases: object

Class for holding a specific instance of a scheduling block type.

run()[source]

Simulate resource usage of a single scheduling block instance.

observe()[source]

Simulate an observation using the telescope.

process()[source]

Run batch processing for a given set of pipelines.

store_raw_visibilities()

Request and allocate storage capacity for raw visibilities.

store_pre_processed_visibilities()

Request and allocate storage capacity for pre-processed visibilities.

store_data_products()

Request and allocate storage capacity for data products.

get_event_log()[source]

Return the event log for the scheduling block instance.

allocate_capacity_storage_raw_visibilities(env, sdp)[source]

Request and allocate storage capacity for raw visibilities.

This method converts the required storage from gigabytes to petabytes, requests the necessary capacity storage from the SDP (ScienceDataProcessor), and logs the allocation event.

Parameters:

sdp (ScienceDataProcessor) – ScienceDataProcessor instance.

Yields:

simpy.events.Event – An event that represents the request for storage capacity.

allocate_performance_storage(env, sdp)[source]

Request and allocate storage for pre-processed visibilities.

This method converts the required storage from gigabytes to terabytes, requests the necessary performance storage from the SDP (ScienceDataProcessor), and logs the allocation event.

Parameters:
  • env (simpy.Environment) – A simpy simulation environment.

  • sdp (ScienceDataProcessor) – A ScienceDataProcessor object.

Returns:

performance_storage_required (float) – The amount of performance storage allocated in TB.

delete_pre_processed_visibilities(env, sdp)[source]

Delete pre-processed visibilities from performance storage.

This method deletes pre-processed visibilities from performance storage after all pipeline steps have completed.

Parameters:
  • env (simpy.Environment) – A simpy simulation environment.

  • sdp (ScienceDataProcessor) – A ScienceDataProcessor object.

get_event_log()[source]

Return the event log for the scheduling block instance.

get_priority_pipeline_groups()[source]

Get dictionary of pipelines grouped by priority.

no_priority()[source]

Check if any pipeline has a priority set.

observe(env, telescope, sdp)[source]

Simulate an observation using the telescope.

This method logs the start and end times of the observation and appends the observation details to the event log.

Parameters:
  • env (simpy.Environment) – A simpy simulation environment.

  • telescope (simpy.Resource) – A telescope resource.

Yields:

simpy.events.Event

The event representing the request for the

telescope resource.

simpy.events.Timeout: The timeout event representing the

observation duration.

process(env, sdp)[source]

Run batch processing for a given set of pipelines.

This method simulates the execution of multiple data processing pipelines and stores the resulting data products. It logs the start and end times of the batch processing and calculates the total storage required for the data products.

Parameters:
  • env (simpy.Environment) – A simpy simulation environment.

  • sdp (ScienceDataProcessor) – A ScienceDataProcessor object.

Yields:

simpy.events.Event – Events for running pipelines and storing data products.

run(env, telescope, sdp)[source]

Simulate resource usage of a single scheduling block instance.

Parameters:
  • env (simpy.Environment) – A simpy simulation environment.

  • telescope (simpy.Resource) – A telescope resource.

  • sdp (ScienceDataProcessor) – A ScienceDataProcessor object.

Returns:

None

run_batch_processing(env, sdp)[source]

Run batch processing.

This method simulates the execution of batch processing for the scheduling block instance. It allocates storage for raw visibilities, pre-processed visibilities, and data products, and runs the pipelines for data processing.

Parameters:
  • env (simpy.Environment) – A simpy simulation environment.

  • sdp (ScienceDataProcessor) – A ScienceDataProcessor object.

Yields:

simpy.events.Event – Events for running pipelines and storing data products.

run_pipelines(env, sdp)[source]

Run all pipelines for the scheduling block instance.