Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, network,
exact=False,
name='Simulation',
tracker=trackers.StateTracker(),
deadlock_detector=deadlock.NoDetection(),
node_class=None,
arrival_node_class=None):
"""
Initialise an instance of the simualation.
"""
self.current_time = 0.0
self.network = network
self.set_classes(node_class, arrival_node_class)
if exact:
self.NodeType = ExactNode
self.ArrivalNodeType = ExactArrivalNode
getcontext().prec = exact
self.name = name
self.deadlock_detector = deadlock_detector
self.inter_arrival_times = self.find_arrival_dists()
self.service_times = self.find_service_dists()
self.batch_sizes = self.find_batching_dists()
self.number_of_priority_classes = self.network.number_of_priority_classes
self.transitive_nodes = [self.NodeType(i + 1, self) for i in range(network.number_of_nodes)]
self.nodes = ([self.ArrivalNodeType(self)] + self.transitive_nodes + [ExitNode()])
self.statetracker = tracker
self.statetracker.initialise(self)
self.times_dictionary = {self.statetracker.hash_state(): 0.0}
self.times_to_deadlock = {}
self.rejection_dict = self.nodes[0].rejection_dict
self.baulked_dict = self.nodes[0].baulked_dict