Skip to content
Open
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
16 changes: 14 additions & 2 deletions ciw/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Simulation(object):
def __init__(
self,
network,
exact=False,
exact: int = 0,
name="Simulation",
tracker=None,
deadlock_detector=None,
Expand All @@ -32,8 +32,20 @@ def __init__(
server_class=None,
):
"""
Initialise an instance of the simualation.
Initialise an instance of the simulation.

This class supports exact arithmetic when `exact` is given a positive integer
representing the desired numerical precision. A precision of `0` is interpreted
to mean using ordinary float precision.
"""

# Input validation
if not isinstance(exact, int):
raise TypeError(f"{exact=} must be an integer.")
if exact < 0:
raise TypeError(f"{exact=} must be non-negative.")

# Assignments
self.current_time = 0.0
self.network = network
self.set_classes(node_class, arrival_node_class, exit_node_class, individual_class, server_class)
Expand Down
Loading