{"id":37624248,"url":"https://github.com/areenberg/phph","last_synced_at":"2026-01-20T16:41:37.635Z","repository":{"id":228071412,"uuid":"461024000","full_name":"areenberg/phph","owner":"areenberg","description":"A Python package for PH/PH/c queueing systems","archived":false,"fork":false,"pushed_at":"2025-12-27T22:58:32.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-30T00:48:51.668Z","etag":null,"topics":["phase-type-distributions","probability","queueing","queueing-theory","service","waiting-time"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/areenberg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-02-18T22:27:03.000Z","updated_at":"2025-12-27T22:58:35.000Z","dependencies_parsed_at":"2024-03-17T00:17:14.277Z","dependency_job_id":"66ec04c7-3061-403d-b756-f6666d6e58a2","html_url":"https://github.com/areenberg/phph","commit_stats":null,"previous_names":["areenberg/phph"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/areenberg/phph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/areenberg","download_url":"https://codeload.github.com/areenberg/phph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/areenberg%2Fphph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T06:30:42.265Z","status":"ssl_error","status_checked_at":"2026-01-16T06:30:16.248Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phase-type-distributions","probability","queueing","queueing-theory","service","waiting-time"],"created_at":"2026-01-16T10:45:30.286Z","updated_at":"2026-01-16T10:45:30.366Z","avatar_url":"https://github.com/areenberg.png","language":"Python","readme":"# PhPh: A Python package for PH/PH/c queueing systems\n \nPhPh is a Python package for evaluating PH/PH/c queueing systems.\n\n## Features\n\n* Available on PyPI.\n* Allows for evaluation of multiserver models containing any Phase-type (PH) inter-arrival and service-time distribution.\n* Returns fundamental performance metrics such as the expected waiting time, expected occupancy, and the probability of waiting longer than *t* units of time.  \n* Users can choose to view the metrics observed by *actual* arriving customers or *virtual* Poisson arrivals.\n\n# Quick start guide\n\nThe following shows how to get quickly started with PhPh.\n\n## Installation\n\nDownload and install PhPh directly from PyPI. \n\n```\npip install phph\n```\n\n## Usage\n\nStart by specifying the inter-arrival and service-time distributions.\n\n```python\n#Import packages\nimport phph\nimport numpy as np\n\n#Set the server capacity\nservers = 5\n\n#ARRIVAL PARAMETERS - Example of Erlang distribution\n\n#Initial distribution\narrivalInitDistribution = np.matrix([[1,0]])\n\n#Phase-type generator\narrivalGenerator = np.matrix([[-12,12],\n                              [0,-12]])\n\n#SERVICE PARAMETERS - Example of hyper-exponential distribution\n\n#Initial distribution\nserviceInitDistribution = np.matrix([[(1/3),(1/2),(1/6)]])\n\n#Phase-type generator\nserviceGenerator = np.matrix([[-2,0,0],\n                              [0,-1,0],\n                              [0,0,-6]])\n\n```\n\nNow, create the model object.\n\n```python\nmdl = phph.model(arrivalInitDistribution,arrivalGenerator,\n                 serviceInitDistribution,serviceGenerator,\n                 servers)\n```\n\nWe can now use the object `mdl` to return various performance metrics. In the following, we calculate the expected waiting time, the expected occupancy, and the probability of waiting.\n\n```python\n#Expected waiting time \nprint(mdl.meanWaitingTime())\n#0.455024\n\n#Expected occupancy\nprint(mdl.meanOccupancy())\n#6.896811\n\n#Probability of waiting\nprint(mdl.probWait())\n#0.562802\n```\n\n# Classes and methods\n\nThe following shows how to create the model and provides a list of all available performance metrics.\n\n## Model class\n\nCreate the model object with:\n\n```python\nmdl = phph.model(arrivalInitDistribution,arrivalGenerator,\n                 serviceInitDistribution,serviceGenerator,\n                 servers)\n```\n\n* `arrivalInitDistribution` is a NumPy row vector defining the initial distribution of the PH distribution associated with **arrivals**.\n* `arrivalGenerator` is a NumPy matrix defining the PH generator of the distribution associated with **arrivals**.\n* `serviceInitDistribution` is a NumPy row vector defining the initial distribution of the PH distribution associated with **services**.\n* `serviceGenerator` is a NumPy matrix defining the PH generator of the distribution associated with **services**.\n* `servers` is a non-zero positive integer and defines the number of servers in the queueing system.\n\n## Performance metrics\n\n* `mdl.meanWaitingTime()`. Returns the *actual* (i.e. observed by arriving customers) expected waiting time. \n* `mdl.meanResponse()`. Returns the *actual* expected total time in the system.\n* `mdl.probWait(type=\"actual\")`. Returns the probability of waiting. Choose between `\"actual\"` (default) and `\"virtual\"` using the argument `type`. \n* `mdl.probEmpty(type=\"actual\")`. Returns the probability that the system is empty. Choose between `\"actual\"` (default) and `\"virtual\"` using the argument `type`.\n* `mdl.probK(k,type=\"actual\")`. Returns the probability of observing `k` customers in the system on arrival. Choose between `\"actual\"` (default) and `\"virtual\"` using the argument `type`.\n* `mdl.waitDist(t,type=\"actual\")`. Returns the probability of waiting more than `t` time units. Choose between `\"actual\"` (default) and `\"virtual\"` using the argument `type`.\n* `mdl.meanQueueLength()`. Returns the expected length of the queue. \n* `mdl.meanOccupancy()`. Returns the expected occupancy.\n\n## Other output\n\n* `mdl.localStateDist(k)`. Returns the local state distribution of level `k`.\n* `mdl.localState(k)`. Returns the definition of the local state space of level `k`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareenberg%2Fphph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fareenberg%2Fphph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fareenberg%2Fphph/lists"}