Skip to content

[Question]: What happens when service discipline returns None? #222

@galenseilis

Description

@galenseilis

I am contemplating what would happen if I had a service discipline that sometimes returns None. As an extreme case to get a sense of the behaviour of Ciw I created a service discipline that always returns None. Here is the minimum reproducible example:

import ciw
import pandas as pd

def just_none(individuals):
    return None

N = ciw.create_network(
    arrival_distributions=[ciw.dists.Exponential(rate=5)],
    service_distributions=[ciw.dists.Exponential(rate=5)],
    service_disciplines=[just_none],
    number_of_servers=[1]
)

ciw.seed(2018)
Q = ciw.Simulation(N)
Q.simulate_until_max_time(1)

df = pd.DataFrame(
    Q.get_all_records()
    )

print(df.to_markdown(index=False))

The output (below) suggests that customers are being served. I had assumed the opposite would occur.

id_number customer_class original_customer_class node arrival_date waiting_time service_start_date service_time service_end_date time_blocked exit_date destination queue_size_at_arrival queue_size_at_departure server_id record_type
1 Customer Customer 1 0.152353 0 0.152353 0.00561602 0.157969 0 0.157969 -1 0 0 1 service
2 Customer Customer 1 0.349852 0 0.349852 0.141531 0.491383 0 0.491383 -1 0 1 1 service
4 Customer Customer 1 0.5283 0 0.5283 0.0537462 0.582046 0 0.582046 -1 1 2 1 service

What is the behaviour of Ciw when a service discipline returns None?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions