phitter.simulation.queueing_simulation package

Submodules

phitter.simulation.queueing_simulation.queueing_simulation module

class phitter.simulation.queueing_simulation.queueing_simulation.QueueingSimulation(a, a_parameters, s, s_parameters, c, k=inf, n=inf, d='FIFO', pbs_distribution=None, pbs_parameters=None)

Bases: object

average_elements_queue()

Average elements in queue

Returns:

Average elements in queue

Return type:

float

average_elements_system()

Average elements in system

Returns:

Average elements in system

Return type:

float

average_time_queue()

Average time in queue

Returns:

Average time in queue

Return type:

float

average_time_service()

Average time in service

Returns:

Average time in service

Return type:

float

average_time_system()

Average time in system

Returns:

Average time in system

Return type:

float

confidence_interval_metrics(simulation_time=inf, confidence_level=0.95, replications=30)

Generate a confidence interval for probabilities and metrics.

Parameters:
  • simulation_time (int, optional) – Simulation time. Defaults to float(“Inf)

  • confidence_level (int, optional) – Confidence level for the confidence interval for all the metrics and probabilities. Defaults to 0.95.

  • replications (int, optional) – Number of samples of simulations to create. Defaults to 30.

Returns:

Returns probabilities and metrics dataframe with confidene interval for all metrics.

Return type:

tuple[pd.DataFrame, pd.DataFrame]

elements_prob(bins=50000)

Creates the probability for each number of elements. Example: Probability to be 0, prob. to be 1, prob. to be 2… depending on simulation values

Parameters:

bins (int, optional) – Number of intervals to determine the probability to be in each stage. Defaults to 50000.

Returns:

Element and probability result

Return type:

dict

metrics_summary()

Returns the summary of the following metrics: Average Time in System, Average Time in Queue, Average Time in Service, Std. Dev. Time in System, Std. Dev. Time in Queue, Std. Dev. Time in Service, Average Elements in System, Average Elements in Queue, Probability to join the System, Probability to finish after Time, Probability to Wait in Line

Returns:

Returns dataframe with all the information

Return type:

pd.DataFrame

no_clients_prob()

Probability of no having clients

Returns:

No clients probability

Return type:

float

number_elements_prob(number, prob_type)

Calculates the probability Exact, less or equals or greater or equals.

Parameters:
  • number (int) – Number that we want to identify the different probabilities

  • prob_type (str) – Could be one of the following options: ‘exact_value’, ‘greater_equals’, ‘less_equals’

Returns:

Probability of the number of elements

Return type:

float

number_probability_summary()

Returns the probability for each element. The probability is Exact, less or equals or greater or equals; represented in each column.

Returns:

Dataframe with all the needed probabilities for each element.

Return type:

pd.DataFrame

probability_to_finish_after_time()

Probability to finish after time

Returns:

Probability to finish after time

Return type:

float

probability_to_join_system()

Probability to join the system

Returns:

Probability to join the system

Return type:

float

probability_to_wait_in_line()

Probability to wait in the queue

Returns:

Probability to wait in the queue

Return type:

float

run(simulation_time=inf)

Simulation of any queueing model.

Parameters:
  • simulation_time (float, optional) – This variable defines the total duration of the simulation. It sets the length of time over which the simulation will model the system’s behavior. Defaults to float(“inf”)

  • number_of_simulations (int, optional) – Number of simulations of the process. Can also be considered as the number of days or number of times you want to simulate your scenario. Defaults to 1.

Returns:

[description]

Return type:

tuple

servers_utilization()

Determine the server utilization according to the simulation result

Returns:

Utilization of all servers, you can find the server number in the rows

Return type:

pd.DataFrame

standard_deviation_time_queue()

Standard Deviation time in queue

Returns:

Standard Deviation time in queue

Return type:

float

standard_deviation_time_service()

Standard Deviation time in service

Returns:

Standard Deviation time in service

Return type:

float

standard_deviation_time_system()

Standard Deviation time in system

Returns:

Standard Deviation time in system

Return type:

float

system_utilization()

Returns system utilization according to simulation

Returns:

System Utilization

Return type:

float

to_csv(file_name, index=True)

Simulation results to CVS

Parameters:
  • file_name (str) – File Name to add to the CSV file. You should include “.csv” at the end of your file

  • index (bool, optional) – Defaults to True. Add index in CSV file.

Return type:

None

to_excel(file_name, sheet_name='Sheet1', index=True)

Simulation results to Excel File

Parameters:
  • file_name (str) – File Name to add to the Excel file. You should include “.xlsx” at the end of your file

  • index (bool, optional) – Defaults to True. Add index in Excel file.

Return type:

None

Module contents