Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .hypothesis/examples/29a0888f2630c3d7/2d5103d9aa08908b
Binary file not shown.
Binary file removed .hypothesis/examples/29a0888f2630c3d7/3bfd3000f4d09ff0
Binary file not shown.
Binary file removed .hypothesis/examples/29a0888f2630c3d7/aeed295ab0fa36c1
Binary file not shown.
Binary file removed .hypothesis/examples/29a0888f2630c3d7/de8a847bff8c343d
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/02848ce3c6dfca85
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/0adbbc0e978d87be
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/1c20758af7e9f9a5
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/589cd42f92297ac4
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/7cc4aa8f917cbbfc
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/94b6e6116f53a455
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/ae1636a12488347b
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/c5dccddeaad3275a
Binary file not shown.
Binary file removed .hypothesis/examples/a40d01c034da88b1/ecb1ac629f8d49ff
Binary file not shown.
18 changes: 17 additions & 1 deletion ciw/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,20 @@ def __init__(self,
self.number_of_servers = number_of_servers
self.queueing_capacity = queueing_capacity
self.class_change_matrix = class_change_matrix
self.schedule = schedule
self.schedule = schedule


class CustomerClass:
"""
An information store for each customer class in the queueing network
"""
def __init__(self,
arrival_distributions,
service_distributions,
transition_matrix):
"""
Initialises the CutomerCass object
"""
self.arrival_distributions = arrival_distributions
self.service_distributions = service_distributions
self.transition_matrix = transition_matrix
49 changes: 34 additions & 15 deletions ciw/tests/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
class TestServiceCentre(unittest.TestCase):

def test_init_method(self):
number_of_servers = 2
queueing_capacity = 'Inf'
class_change_matrix = [[0.2, 0.8],
[1.0, 0.0]]
schedule = None
number_of_servers = 2
queueing_capacity = 'Inf'
class_change_matrix = [[0.2, 0.8],
[1.0, 0.0]]
schedule = None
SC = ciw.ServiceCentre(number_of_servers,
queueing_capacity,
class_change_matrix,
schedule)
queueing_capacity,
class_change_matrix,
schedule)
self.assertEqual(SC.number_of_servers, number_of_servers)
self.assertEqual(SC.queueing_capacity, queueing_capacity)
self.assertEqual(SC.class_change_matrix, class_change_matrix)
Expand All @@ -26,14 +26,33 @@ def test_init_method(self):
class_change_prob1=floats(min_value=0.0, max_value=1.0),
class_change_prob2=floats(min_value=0.0, max_value=1.0))
def test_init_method_h(self, number_of_servers, queueing_capacity, class_change_prob1, class_change_prob2):
class_change_matrix = [[class_change_prob1, 1 - class_change_prob1],
[class_change_prob2, 1 - class_change_prob2]]
schedule = None
class_change_matrix = [[class_change_prob1, 1 - class_change_prob1],
[class_change_prob2, 1 - class_change_prob2]]
schedule = None
SC = ciw.ServiceCentre(number_of_servers,
queueing_capacity,
class_change_matrix,
schedule)
queueing_capacity,
class_change_matrix,
schedule)
self.assertEqual(SC.number_of_servers, number_of_servers)
self.assertEqual(SC.queueing_capacity, queueing_capacity)
self.assertEqual(SC.class_change_matrix, class_change_matrix)
self.assertEqual(SC.schedule, schedule)
self.assertEqual(SC.schedule, schedule)


class TestCustomerClass(unittest.TestCase):

def test_init_method(self):
arrival_distributions = [["Uniform", 4.0, 9.0],
["Exponential", 5],
["Gamma", 0.6, 1.2]]
service_distributions = [["Gamma", 4.0, 9.0],
["Uniform", 0.6, 1.2],
["Exponential", 5]]
transition_matrix = [[.2, .6, .2], [0, 0, 0], [.5, 0, 0]]

CC = ciw.CustomerClass(arrival_distributions,
service_distributions,
transition_matrix)
self.assertEqual(CC.arrival_distributions, arrival_distributions)
self.assertEqual(CC.service_distributions, service_distributions)
self.assertEqual(CC.transition_matrix, transition_matrix)