salabim 25.0.0__py3-none-any.whl → 25.0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- salabim/salabim.py +23 -20
- {salabim-25.0.0.dist-info → salabim-25.0.2.dist-info}/METADATA +1 -1
- {salabim-25.0.0.dist-info → salabim-25.0.2.dist-info}/RECORD +5 -5
- {salabim-25.0.0.dist-info → salabim-25.0.2.dist-info}/WHEEL +0 -0
- {salabim-25.0.0.dist-info → salabim-25.0.2.dist-info}/top_level.txt +0 -0
salabim/salabim.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
# _ _ _ ____ ____ ___
|
2
|
-
# ___ __ _ | | __ _ | |__ (_) _ __ ___ |___ \ | ___| / _ \
|
3
|
-
# / __| / _` || | / _` || '_ \ | || '_ ` _ \ __) ||___ \ | | | |
|
4
|
-
# \__ \| (_| || || (_| || |_) || || | | | | | / __/ ___) | _ | |_| | _
|
5
|
-
# |___/ \__,_||_| \__,_||_.__/ |_||_| |_| |_| |_____||____/ (_) \___/ (_)
|
1
|
+
# _ _ _ ____ ____ ___ ____
|
2
|
+
# ___ __ _ | | __ _ | |__ (_) _ __ ___ |___ \ | ___| / _ \ |___ \
|
3
|
+
# / __| / _` || | / _` || '_ \ | || '_ ` _ \ __) ||___ \ | | | | __) |
|
4
|
+
# \__ \| (_| || || (_| || |_) || || | | | | | / __/ ___) | _ | |_| | _ / __/
|
5
|
+
# |___/ \__,_||_| \__,_||_.__/ |_||_| |_| |_| |_____||____/ (_) \___/ (_)|_____|
|
6
6
|
# discrete event simulation
|
7
7
|
#
|
8
8
|
# see www.salabim.org for more information, the documentation and license information
|
9
9
|
|
10
|
-
__version__ = "25.0.
|
10
|
+
__version__ = "25.0.2"
|
11
11
|
import heapq
|
12
12
|
import random
|
13
13
|
import time
|
@@ -42,11 +42,7 @@ import urllib.error
|
|
42
42
|
import base64
|
43
43
|
import zipfile
|
44
44
|
from pathlib import Path
|
45
|
-
|
46
|
-
import peek
|
47
|
-
except ModuleNotFoundError:
|
48
|
-
...
|
49
|
-
|
45
|
+
|
50
46
|
|
51
47
|
from typing import Any, Union, Iterable, Tuple, List, Callable, TextIO, Dict, Set, Type, Hashable, Optional
|
52
48
|
|
@@ -103,7 +99,7 @@ _ANSI_to_rgb = {
|
|
103
99
|
"\033[0m": (),
|
104
100
|
}
|
105
101
|
|
106
|
-
ANSI=types.SimpleNamespace(_color_name_to_ANSI
|
102
|
+
ANSI=types.SimpleNamespace(**_color_name_to_ANSI)
|
107
103
|
|
108
104
|
def a_log(*args):
|
109
105
|
if not hasattr(a_log, "a_logfile_name"):
|
@@ -8125,7 +8121,7 @@ by adding:
|
|
8125
8121
|
self,
|
8126
8122
|
store: Union["Store", Iterable],
|
8127
8123
|
filter: Callable = lambda c: True,
|
8128
|
-
request_priority:
|
8124
|
+
request_priority: float = 0,
|
8129
8125
|
fail_priority: float = 0,
|
8130
8126
|
urgent: bool = True,
|
8131
8127
|
fail_at: float = None,
|
@@ -8305,7 +8301,7 @@ by adding:
|
|
8305
8301
|
self,
|
8306
8302
|
store: Union["Store", Iterable],
|
8307
8303
|
item: "Component",
|
8308
|
-
request_priority: float =
|
8304
|
+
request_priority: float = 0,
|
8309
8305
|
priority: float = 0,
|
8310
8306
|
fail_priority: float = 0,
|
8311
8307
|
urgent: bool = True,
|
@@ -8328,6 +8324,9 @@ by adding:
|
|
8328
8324
|
request_priority: float
|
8329
8325
|
put component in to_store_requesters according to the given priority (default 0)
|
8330
8326
|
|
8327
|
+
priority : float
|
8328
|
+
put component in the store according to this priority (default 0)
|
8329
|
+
|
8331
8330
|
fail_priority : float
|
8332
8331
|
priority of the fail event
|
8333
8332
|
|
@@ -8475,7 +8474,7 @@ by adding:
|
|
8475
8474
|
mode: Any = None,
|
8476
8475
|
urgent: bool = False,
|
8477
8476
|
request_priority: float = 0,
|
8478
|
-
|
8477
|
+
priority: float = 0,
|
8479
8478
|
cap_now: bool = None,
|
8480
8479
|
oneof: bool = False,
|
8481
8480
|
called_from: str = "request",
|
@@ -8619,7 +8618,7 @@ by adding:
|
|
8619
8618
|
scheduled_time = fail_at + self.env._offset
|
8620
8619
|
else:
|
8621
8620
|
raise ValueError("both fail_at and fail_delay specified")
|
8622
|
-
|
8621
|
+
schedule_priority=priority
|
8623
8622
|
self.set_mode(mode)
|
8624
8623
|
|
8625
8624
|
self._failed = False
|
@@ -8918,7 +8917,6 @@ by adding:
|
|
8918
8917
|
self._release(r)
|
8919
8918
|
|
8920
8919
|
def wait_for(self, cond, states, request_priority=0, priority=0, urgent=False, mode=None, fail_delay=None, fail_at=None, cap_now=None):
|
8921
|
-
schedule_priority = priority
|
8922
8920
|
"""
|
8923
8921
|
wait for any or all of the given state values are met
|
8924
8922
|
|
@@ -9021,6 +9019,7 @@ by adding:
|
|
9021
9019
|
raise ValueError("both fail_at and fail_delay specified")
|
9022
9020
|
|
9023
9021
|
self.set_mode(mode)
|
9022
|
+
schedule_priority=priority
|
9024
9023
|
|
9025
9024
|
self._cond = cond # add test ***
|
9026
9025
|
for state in states:
|
@@ -9052,7 +9051,7 @@ by adding:
|
|
9052
9051
|
mode: Any = None,
|
9053
9052
|
urgent: bool = False,
|
9054
9053
|
request_priority: float = 0,
|
9055
|
-
|
9054
|
+
priority: float = 0,
|
9056
9055
|
cap_now: bool = None,
|
9057
9056
|
) -> None:
|
9058
9057
|
"""
|
@@ -9223,10 +9222,11 @@ by adding:
|
|
9223
9222
|
scheduled_time = fail_at + self.env._offset
|
9224
9223
|
else:
|
9225
9224
|
raise ValueError("both fail_at and fail_delay specified")
|
9226
|
-
|
9225
|
+
schedule_priority=priority
|
9227
9226
|
self.set_mode(mode)
|
9228
9227
|
|
9229
9228
|
for arg in args:
|
9229
|
+
|
9230
9230
|
value = True
|
9231
9231
|
priority = request_priority
|
9232
9232
|
if isinstance(arg, State):
|
@@ -9236,8 +9236,10 @@ by adding:
|
|
9236
9236
|
if not isinstance(state, State):
|
9237
9237
|
raise TypeError("incorrect specifier", arg)
|
9238
9238
|
if len(arg) >= 2:
|
9239
|
-
|
9239
|
+
value = arg[1]
|
9240
9240
|
if len(arg) >= 3:
|
9241
|
+
priority = arg[2]
|
9242
|
+
if len(arg) >= 4:
|
9241
9243
|
raise TypeError("incorrect specifier", arg)
|
9242
9244
|
else:
|
9243
9245
|
raise TypeError("incorrect specifier", arg)
|
@@ -9260,6 +9262,7 @@ by adding:
|
|
9260
9262
|
if not self._waits:
|
9261
9263
|
raise TypeError("no states specified")
|
9262
9264
|
|
9265
|
+
|
9263
9266
|
self._remaining_duration = scheduled_time - self.env._now
|
9264
9267
|
|
9265
9268
|
self._trywait()
|
@@ -3,8 +3,8 @@ salabim/LICENSE.txt,sha256=eTPlcDJz4G0096Qv-wfMjm1Wxbd4ilDlsYg5rN4HjWQ,1106
|
|
3
3
|
salabim/__init__.py,sha256=r7qPLvlmX0dkZDyjuTo8Jo3ex3sD1L4pmK6K5ib9vyw,56
|
4
4
|
salabim/calibri.ttf,sha256=RWpf8Uo31RfvGGNaSt9-2sXSuN87AVE_NFMRsV3LhBk,1330156
|
5
5
|
salabim/mplus-1m-regular.ttf,sha256=EuFHr90BJjuAn_r5MleJFN-WfkeWJ4tf7DweI5zr8tU,289812
|
6
|
-
salabim/salabim.py,sha256=
|
7
|
-
salabim-25.0.
|
8
|
-
salabim-25.0.
|
9
|
-
salabim-25.0.
|
10
|
-
salabim-25.0.
|
6
|
+
salabim/salabim.py,sha256=HZGoHWng0YaeCS0BkGPAkavGHgMdw3JfQB6AlYLkRLA,1123721
|
7
|
+
salabim-25.0.2.dist-info/METADATA,sha256=0QGrK9jj-tPPgRPqfnsuNBwjueyMGGr5PL5ZGe3t53o,3457
|
8
|
+
salabim-25.0.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
9
|
+
salabim-25.0.2.dist-info/top_level.txt,sha256=UE6zVlbi3F6T5ma1a_5TrojMaF21GYKDt9svvm0U4cQ,8
|
10
|
+
salabim-25.0.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|