-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix utilisation bug #145
Fix utilisation bug #145
Conversation
Q.simulate_until_max_time(200) | ||
for srvr in Q.transitive_nodes[0].servers: | ||
self.assertGreaterEqual(srvr.total_time, srvr.busy_time) | ||
self.assertLessEqual(Q.transitive_nodes[0].server_utilisation, 1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw in a assertGreaterEqual
than 0
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
ciw/tests/test_node.py
Outdated
@@ -1,5 +1,7 @@ | |||
import unittest | |||
import ciw | |||
from hypothesis import given | |||
from hypothesis.strategies import (floats, integers, random_module) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for the brackets? Haven't seen that conventionally anywhere else.
Q = ciw.Simulation(N) | ||
Q.simulate_until_max_time(168) | ||
for srvr in Q.transitive_nodes[0].servers: | ||
self.assertGreaterEqual(srvr.total_time, srvr.busy_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this doesn't have the check of the actual bug does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. The problem was srvr.busy_time
was larger then srvr.total_time
because I was also adding the final customers' waiting time to the busy time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes! I see that now 👍
Looks good @geraintpalmer: merge! 👍 |
Fixes bug in which utilisation is not calculated correctly, resulting in utilisation > 100%. |
Bug allowed utilisation to be greater than 100% in some cases.
This fixes that bug, and adds tests and property based tests to check for it.