Salabim

Latest version: v24.0.9

Safety actively analyzes 642283 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 12 of 25

19.0.4

==========================
New functionality (0)
---------------------
Queue.extend() has an extra parameter, clear_source. If clear_source = True, the given source will be cleared
after copying the elements to self.
This means that
q0.extend(q1, clear_source=True)
effectively transfers all elements of q1 into q0, prior to emptying q1.
Note that clear_source cannot be applied if source is a list or a tuple.

New functionality (1)
---------------------
non-level monitors can now be filled from a list or tuple, like
m = Monitor("my monitor", level=False, fill=(1,2,5,7,2,3))
which is functionally equivalent to
m = Monitor("my monitor", level=False)
for el in (1,2,5,7,2,3):
m.tally(el)

Bug fix (0)
-----------
Autoscaling of histograms was incorrectly always enabled.
Now histograms are autoscaled only if neither number_of_bins, nor lowerbound nor bin_width is specified.

Bug fix (1)
-----------
Due to a problem with the Black formatter, version 19.0.3 did not run under Python versions prior to 3.6.
This is fixed with this release.

19.0.3

==========================
New method (0)
--------------
Monitor.rename() can be used to rename a monitor in a chained way.
This is particularly useful when merging with the + operator, merging with sum or slicing with [],
multiplication and division as well as the unit conversion methods (to_years, ...),
because the resulting monitors get automatically a name, that might not be appropriate.
The Monitor.rename() method is essentially the same as Monitor.name(), but will return the monitor itself.
Examples:
(mon0 + mon1 + mon2 + mon3).rename('mon0 - mon3').print_histogram()
sum(mon for mon in (mon0, mon1, mon2, mon3)).rename('mon0 - mon3').print_histogram()
mon0[1000:2000].rename('mon0 between t=1000 and t=2000').print_statistics()
mon0.to_years().rename('mon0 in hours').print_statistics()


New method (1)
--------------
Queue.rename() can be used to rename a queue in a chained way.
This particularly useful when the queues are combined with +, -, |, & and ^ operator or the sum function,
because the resulting queue get automatically a name, that might not be appropriate.
The Queue.rename() method is essentially the same as Queue.name(), but will return the queue itself.
Examples:
(q0 + q1 + q2 + q3).rename('q0 - q3').print_statistics()
(q1 - q0).rename('difference of q1 and q0)').print_histograms()


New functionality
-----------------
It is now possible to get the union of several queues by means of the sum function.
Example:
rows = [Queue('row.') for _ in range(10)]
...
sum(rows).print_info()


Improved functionality (0)
--------------------------
When animating a large number of objects, it was possible that tkinter crashed because there were too many tkinter
bitmaps aka canvas objects, sometimes by issuing a 'Fail to allocate bitmap', sometimes without any message.
From this version on, salabim limits the number of bitmap automatically by combining animation objects
in one aggregated bitmap if the number of bitmaps exceeds a given maximum.
Unfortunately it is not possible to detect this 'Fail to allocate bitmap', so it may take some experimentation to
find a workable maximum (maybe going as low as 1000).
By default, salabim sets the maximum number of bitmaps to 4000, but may be changed with the
Environment.maximum_number_of_bitmaps() method, or the maximum_number_of_bitmaps parameter of
Environment.animation_parameters().
Choosing a too low maximum (particularly 0), may result in a performance degradation.
The bitmap aggregation process is transparent to the user, but improves the usability of salabim.
Note that does this not apply to the Pythonista implementation, where bitmaps are always aggregated.


Improved functionality (1)
--------------------------
When using the new style Animate classes (AnimateLine, AnimateRectangle, ...), texts are optional. Up to
this version, even a blank text (which is the default), resulted in a small 'empty' bitmap to be 'displayed'.
From this version, these blank texts are ignored automatically , which is transparent to the user but can result
in better performance and reduces the probability of a tkinter crash.


Changed functionality (0)
-------------------------
The method Environment.animation_parameters() does no longer automatically enable animate, but
instead leaves the animate status unchanged. So, if the user now wants to start the animation as
well when specifying other parameters, it is necessary to add animate=True.
Or, better yet, specify the various parameters with their corresponding method and use
env.animate(True).
E.g. instead of
env.animation_parameters(x0=100, modelname="My model")
use now
env.animation_parameters(x0=100, modelname="My model", animate=True)
or
env.x0(100)
env.modelname("My model")
env.animate(True)


Changed functionality (1)
-------------------------
When creating an animated video, the default codec is now mp4v instead of MP4V.
If this causes a problem in an appication, just add +MP4V to the filename, like
env.video("my_video.mp4+MP4V")


Changed functionality (2)
-------------------------
The function random_seed is defined in a slightly different way and is now in line with
the random_seed parameter of Environment().
The docstring and the documentation have been updated accordingly.

Bug fixes
---------
Minor error in AnimateMonitor and Monitor.animate() for non-level monitors fixed.

19.0.2

==========================

New functionality
-----------------
It is now possible to scale the output of non-level monitor, which is most useful for the automatically
registered length_of_stay monitor of queues. For instance, if the time unit of the simulation is days,
the duration in the queue (q) is registered in days. Buf if a histogram in minutes is more appropriate,
it is possible to say
q.length_of_stay.to_hours().print_histogram()
Equivalent methods are available for year, weeks, days, minutes, seconds, milliseconds and microseconds.
Alternatively the method Monitor.to_time_unit() might be used as in
q.length_of_stay.to_time_unit('minutes').print_histogram()
Finally, a monitor may be scaled with a given factor, e.g.
q.length_of_stay.multiply(24 * 60).print_histogram()
or even
(q.length_of_stay * 24 * 60).print_histogram()

Here is a list of all the new Monitor methods:

Monitor.multiply()
Monitor.to_years()
Monitor.to_weeks()
Monitor.to_days()
Monitor.to_hours()
Monitor.to_minutes()
Monitor.to_seconds()
Monitor.to_milliseconds()
Monitor.to_microseconds()
Monitor.to_time_unit()

On top of Environment.to_years, Environment.to_weeks, etc., there is now a generic method
Environment.to_time_unit()
For instance,
env.to_minutes(env.now)
is equivalent to
env._to_time_unit('minutes', env.now)


Bug fixes
---------
Minor error in run without a duration or till parameter fixed (was not correctly fixed in version 19.0.1)
Bug in Queue.extend() fixed.
Bug in Queue.clear() fixed.

19.0.1

=========================
Added functionality
-----------------
The methods Queue.add, Queue.append, Queue.add_at_head, Queue.add_sorted, Queue.add_in_front_of,
Queue.add_behind, Queue.insert, Queue.remove now return the the queue itself (self), in order
to allow chaining,like
waitingline.add(car1).add(car2)


Documentation update
--------------------
The documentation has been enhanced.
A section on using monitors in other packages, like matplotlib has been added.
This includes a hint to use
plt.plot(*waitingline.length.tx(), drawstyle="steps-post")
to generate a plot from a level monitor.


Bug fixes
---------
Minor error in run without a duration or till parameter fixed.

19.0.0

=========================
New functionality
-----------------
Queues now register the arrival rate and the departure rate, defined as
number of arrivals since last reset / duration since last reset
number of departures since last reset / duration since last reset
The following methods are available:
Queue.arrival_rate()
Queue.departure_rate()
The registration can be reset with
Queue.arrival_rate(reset=True)
Queue.departure_rate(reset=True)
Note that this functionality is completely independent of the monitoring.


Added functionality
-------------------
Video production now supports also the creation of a series of individual frames, in
.jpg, .png, .tiff or .bmp format.
By specifying video with one of these extension, the filename will be padded with 6 increasing digits, e.g.
env.video('test.jpg')
will write individual autonumbered frames named
test000000.jpg
test000001.jpg
test000002.jpg
...
Prior to creating the frames, all files matching the specification will be removed, in order to get only
the required frames, most likely for post processing with ffmpeg or similar.

Note that individual frame video production is available on all platforms, including Pythonista.


The method Environment.delete_video() can be used to delete all autonumbered files, like
env.delete_video('test.jpg')
will delete
test000000.jpg
test000001.jpg
test000002.jpg
...
If this method is used with any other file type, like .mp4, the file does not need to exist (i.e. no action is taken then).


Announcements
-------------
From this version, salabim uses the CalVer (see www.calver.org) standard for version numbering.
This means that versions are numbered YY.major.minor, where
YY is the year of the release minus 2000
major is the major version number (0 based)
minor is the minor version number (0 based)

From this version, legacy Python (<= 2.7) is not longer officially supported.

2.4.2

=========================
Added functionality
-------------------
Sampling from a Pdf distribution now also supports getting a number of samples without replacement.
In order to be able to use that, all probabilities have to be the same, like
colors_dis = sim.Pdf(("red", "green", "blue", "yellow"), 1)
Then we can get a random list of all colors with
colors_dis.sample(4) e.g. ["yellow", "green", "blue", "red"]
or two randomly choosen colors, without replacement with
colors_dis.sample(2) e.g. ["green", "blue"]
Note that if n=1, a list of one value will be returned
colors_dis,sample(1) e.g. ["blue"]


Bug fixes
---------
Under some conditions, Monitor.merge() did not work properly. Fixed.
Under rare conditions Pdf did not handle timeunits properly. Fixed.

Internal changes
----------------
The code is now 'blackened', causing neater and more consistent formatting.
This has not any effect on the functionality.

Sampling from a Pdf distribution has been optimized.

Page 12 of 25

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.