CiwPython / Ciw

Ciw is a simulation library for open queueing networks.
http://ciw.readthedocs.io
MIT License
151 stars 42 forks source link

Attach server to individual before calculating the service time #183

Closed MichalisPanayides closed 2 years ago

MichalisPanayides commented 2 years ago

This change in the source code can enable the creation of a custom distribution that is server dependent. Currently when trying to access ind.server from a custom distribution class (that inherits from ciw.dists.Distribution) the outcome is False. That is because the server attaches to the individual after the service time is calculated.

The purpose of this PR is to change the order that the attach_server() method and the get_service_time() method are executed.

coveralls commented 2 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling d2ff51320497f8cdab169b3f1bc2219d5457eee7 on 11michalis11:attach_server_to_individual_before_generating_service_rate into b3be84906cd6c4c66afb4d302f9ef85758f2a947 on CiwPython:master.

MichalisPanayides commented 2 years ago

Hey @geraintpalmer. Let me know what you think about these changes 😄

If helpful I can add a subsection on the documentation for server dependent distributions (Probably here)

geraintpalmer commented 2 years ago

Hi @11michalis11 this looks good, I'm happy with the change.

An example in the documentation about server dependent distributions would be really nice. I think it would be better suited here: https://ciw.readthedocs.io/en/latest/Guides/behaviour/index.html Could you write up an example?

I can merge them at the same time then and draft a new release :)

Thanks for the work!