Salabim

Latest version: v24.0.13

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

Scan your dependencies

Page 21 of 26

2.1.0

-------------------------------------------------------------------------------
Queue.reset_statistics() Queue.reset() / Queue.monitor()
Queue.minimum_length() Queue.length.minimum()
Queue.maximum_length() Queue.length.maximum()
Queue.number_passed() Queue.length_of_stay.number_entries()
Queue.number_direct_passed() Queue.length_of_stay.number_entries_zero()
Queue.mean_length() Queue.length.mean()
Queue.mean_length_of_stay() Queue.length_of_stay.mean()
Queue.minimum_length_of_stay() Queue.length_of_stay.minimum()
Queue.maximum_length_of_stay() Queue.length_of_stay.maximum()
Queue.length() Queue.length() / len()
Queue.print_statistics() Queue.print_histogram()
Queue.length.std()
Queue.length.median()
Queue.length.percentile()
Queue.length.bin_count()
Queue.length_of_stay.std()
Queue.length_of_stay.median()
Queue.length_of_stay.percentile()
Queue.length_of_stay.bin_count()
Resource.availabe_quantity ==> MonitorTimeStamp
Resource.claimed_quantity ==> MonitorTimeStamp
Resource.capacity ==> MonitorTimeStamp
Resource.capacity(cap) Resource.set_capacity(cap)
Component.requested_resources()
Component.requested_quantity(resource)

All monitors can be used with MatPlotLib. For Monitor, there is Monitor.x() to get an array of all
tallied values. For MonitorTimestamp, MonitorTimestamp.xduration() and MonitorTimestamp.xt() are available.
Note that for the time a MonitorTimestamp is disabled, x will be nan.

Defining a non timestamped monitor (class Monitor) is fairly straightforward.
Defining a timestamped monitor is a bit more complicated. The Lock with monitor script shows an example.
Furthermore, refer to the manual for details.

As a consequence of this, Resource.capacity() can no longer be used to change the capacity.
A new method Resource.set_capacity() is provided, instead.

All examples have been updated to support or show the new functionality.

Thanks to Frans Sopers: Bug in Component.release() fixed.
Thanks to Jan Knoop: arialmt font is now included in getfont, which is required for iPad without additional fonts.

2.0.2

=========================
Internal event handling changed, in order to be able to use all event methods (i.e.
activate, hold, request, standby, cancel and passivate regardless whether
the component is current or not). For the current component, always use yield ...
Also, now it is possible to activate, hold or passivate main.

Component.reschedule() and Component.reactivate had been phased out. Both are replaced
by the more versatile Component.activate() method.

Component.activate() has an additional parameter keep_request, which controls whether
pending requests are to be kept upon an activate.

Environment.stop_run() and stop_run() has been phased out.
Use the much more logical Environment.main().activate() or env.main().activate() instead.
This allows the user to specify the time (including inf) of the main reactivation.
The models 'Dining philosophers animated.py' and 'Elevator animated.py' have been
updated accordingly.

Component.request() has now an additional parameter fail_delay.

When a request is pending, the status of the component used to be scheduled, but is now requesting.
Also, a new method Component.isrequesting() is provided to test for this new status

The methods Component.get_priority and Component.set_priority are replaced by one method: Component.priority.

'salabim release notes.txt' is now called 'Release notes.txt'.

The github distribution now also contains the example scripts as used in the manual.

2.0.1

=========================
In the specification of Distribution, it is now also possible to use:
c1 ==> Constant(c1)
c1,c2, ==> Uniform(c1,c2)
c1,c2,c3 ==> Triangular (c1,c2,c3)

It is not required to use the exact name of the distribution anymore.
If you specify only the first letters of the distribution name, the correct distribution will be selected,
regardless of casing.

Examples of these new features
Uniform(13) ==> Uniform(13)
Uni(12,15) ==> Uniform(12,15)
UNIF(12,15) ==> Uniform(12,15)
N(12,3) ==> Normal(12,3)
Tri(10,20). ==> Triangular(10,20,15)
10 ==> Constant(10)
12,15 ==> Uniform(12,15)
(12,15) ==> Uniform(12,15)

Normal distribution now has a default value for standard_deviation : 0, so effectively constant
Uniform distribution now has a default value for upperbound : lowerbound, so effectively constant
Trianguar distribution now has a default value for high : low, so effectively constant
Trianguar distribution now has a default value for mode : (low+high)/2, so a symmetric distribution

2.0.0

---------------------------------------------------------------------------------------
Environment.peek Environment.peek()
Environment.main Environment.main()
Environment.now Environment.now()
Environment.trace Environment.trace(value)
Environment.current_component Environment.current_component()
Environment.name Environment.name(txt)
Environment.base_name Environment.base_name()
Environment.sequence_number Environment.sequence_number()

Component.claimed_resources Component.claimed_resources()
Component.request_failed Component.request_failed()
Component.name Component.name(txt)
Component.base_name Component.base_name()
Component.sequence_number Componnt.sequence_number()
Component.suppress_trace Component.suppress_trace(value)
Component.mode Component.mode(value)
Component.ispassive Component.ispassive()
Component.iscurrent Component.iscurrent()
Component.isscheduled Component.isscheduled()
Component.isstandby Component.isstandby()
Component.isdata Component.isdate()
Component.creation_time Component.creation_time()
Component.scheduled_time Component.scheduled_time()
Component.mode_time Component.mode_time()
Component.status Component.status()
Component.now phased out, use Component.env.now()
Component.main phased out, use Component.env.main()
Component.trace phased out, use Component.env.trace(value)
Component.current_component phased out, use Component.env.current_component()

Resource.requesters Resource.requesters()
Resource.claimers Resource.claimers()
Resource.capacity Resource.capacity(cap)
Resource.claimed_quantity Resource.claimed_quantity()
Resource.strict_order Resource.strict_order(value)

Queue.name Queue.name(txt)
Queue.base_name Queue.base_name()
Queue.sequence_number Queue.sequence_number()
Queue.head Queue.head()
Queue.tail Queue.tail()
Queue.pop Queue.pop()
Queue.length Queue.length(), len() recommended
Queue.minimum_length Queue.minimum_length()
Queue.maximum_length Queue.maximum_length()
Queue.minimum_length_of_stay Queue.minimum_length_of_stay()
Queue.maximum_length_of_stay Queue.maximum_length_of_stay()
Queue.number_passed Queue.number_passed()
Queue.mean_length_of_stay Queue.mean_length_of_stay()
Queue.mean_length Queue.mean_length()

Uniform.mean Uniform.mean()
Triangular.mean Triangular.mean()
Constant.mean Constant.mean()
Exponential.mean Exponential.mean()
Normal.mean Normal.mean()
Cdf.mean Cdf.mean()
Pdf.mean Pdf.mean()
Distribution.mean Distribution.mean()

Uniform.sample Uniform.sample()
Triangular.sample Triangular.sample()
Constant.sample Constant.sample()
Exponential.sample Exponential.sample()
Normal.sample Normal.sample()
Cdf.sample Cdf.sample()
Pdf.sample Pdf.sample()
Distribution.sample Distribution.sample()

AnimateSlider.v AnimateSlider.v(value)
---------------------------------------------------------------------------------------
***ATTENTION***
Be very careful with adding the parentheses, particularly when using in
logical tests, like:
if c.ispassive: always True !
if c.status==passive always False !
if trace: always True
and never assign to one of these methods,like
env.trace=True overrides the trace method of env
c.name='Machine' overrides the name method of the component c

Nearly all existing models will need be updated. All sample files are now version 2 compatible.

Nearly only internal change: the possible values of the status of a component were up to version 2.0.0
global variables, containing the name of the status. From this version the values of status are actually
references to methods that return the name of the status. This affects passive, data, current, standby,
scheduled and suspended. From an application point of view this does not change anything.
Testing of the status is still done with (e.g.)
if c.status()=sim.passive:
or, better yet,
if c.ispassive():
Only when the status has to be printed, be sure to *call* the status() method, thus
print('current status of c=', c.status()())

If the distribution Pdf gets now a distribution as an x-value, not the
distribution, but a sample of that this distribution will be returned.
Example:
d=sim.Pdf((Uniform(10,20),10,Uniform(20,30),80,Uniform(30,40),10))
d.sample() 10% between 10 and 20, 80% between 20 and 30 and 10% between 30 and 40.
d.mean() is 25.

The argument list if Component.request() is redefined. See the manual or docstring
for details.
The argument list if Component.release() is redefined. See the manual or docstring
for details.

The method Queue.index_of() has been renamed Queue.index() to be more in line
with Python standards.

The script to install salalabim in site-packages is now called install.py

There are two new sample models, 'Lock with resources' and 'Lock with resources animated',
showing a different approach of the Lock model, involving resources.

Major improvements of the docstrings and manual (at www.salabim.org/manual).
Just a reminder: you can get help on all methods
of salabim (pages and pages of information) with
import salabim as sim
help(sim)
or just one method or class by (e.g.)
import salabim as sim
help(Animate)
help(Component.enter)
help(env.now)

Bug fixes.

1.1.3

=========================
Pythonista could not handle the long one line statement defining the std_fonts.
Therefore the definition of the dictionary is now in several lines of maximal 80
characters. The table is now also sorted (only for cosmetic reasons).
The colornames dictionary is now sorted (only for cosmetic reasons).

1.1.2

=========================
Under the hood restructuring of classes, thus enabling overriding.

In order to support packaging (i.e make salabim a site_package), the simulation
environment is no longer automatically defined.
It is now necessary to make an environment in the application, by:
Environment()
The Environment class has now an extra argument, is_default_env, which is True by
default.
Also, the global variable random has been phased out. Instead, salabim uses now
the random class directly in all statistical sampling functions.
It is possible to set the seed of the random stream by means of
- random_seed()
- random.seed(), provided random is imported
- Environment(random_seed=...)
The standard random stream is now used in all distribution definitions, unless
a randomstream is explicitly specified.

Other than in previous versions, reproducibility is only available if
a random seed value is specified, usually when defining an Environment.

All sample programs are defined in such a way that they give reproducible results.

main is no longer a global variable. You can use either the main
property in Component or Environment classes or just main() from the
salabim module, e.g. with env.main()

The default environment can be queried with the function default_env(),
e.g. de=sim.default_env().

All sample filea are updated according to the new interface.

Font handling has been improved. It is now allowed to specify a font by the
file name or the descriptor, e.g.
'timesi' or 'Times New Roman Italic'.
The case is not important any more.
The function show_fonts() can be used to retrieve all currently available
font names (on this machine).

The salabim_install script now installs salabim in a more Pythonic way
in the site-packages folder.

Bug in slider function under Pythonista fixed.

Page 21 of 26

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.