Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
team-simpy
simpy
Commits
f944be37
Commit
f944be37
authored
Sep 04, 2013
by
Stefan Scherfke
Browse files
Fixed a few more typos and broken links in the docstrings of core and rt.
parent
506f814c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
simpy/core.py
simpy/core.py
+1
-1
simpy/rt.py
simpy/rt.py
+12
-7
No files found.
simpy/core.py
View file @
f944be37
...
...
@@ -639,7 +639,7 @@ class BaseEnvironment(object):
class
Environment
(
BaseEnvironment
):
"""Inherits :class`BaseEnvironment` and implements a simulation environment
"""Inherits :class
:
`BaseEnvironment` and implements a simulation environment
which simulates the passing of time by stepping from event to event.
You can provide an *initial_time* for the environment. By defaults, it
...
...
simpy/rt.py
View file @
f944be37
...
...
@@ -12,36 +12,41 @@ from simpy.core import Environment, Infinity
class
RealtimeEnvironment
(
Environment
):
"""An environment which uses the real (e.g. wallclock) time.
"""An :class:`~simpy.core.Environment` which uses the real (e.g. wallclock)
time.
A time step will take *factor* seconds of real time (one second by
default)
,
e.g. if you step from ``0`` until ``3`` with ``factor=0.5``, the
default)
;
e.g.
,
if you step from ``0`` until ``3`` with ``factor=0.5``, the
:meth:`simpy.core.BaseEnvironment.run()` call will take at least 1.5
seconds.
If the processing of the events for a time step takes too long,
a :exc:`RuntimeError` is raised in :meth:`step()`. You can disable this
behavior by setting *strict* to ``False``.
"""
behavior by setting *strict* to ``False``.
"""
def
__init__
(
self
,
initial_time
=
0
,
factor
=
1.0
,
strict
=
True
):
Environment
.
__init__
(
self
,
initial_time
)
self
.
env_start
=
initial_time
self
.
real_start
=
time
()
self
.
factor
=
factor
"""Scaling factor of the realtime."""
"""Scaling factor of the real
-
time."""
self
.
strict
=
strict
"""Running mode of the environment. :meth:`step()` will raise a
:exc:`RuntimeError` if this is set to ``True`` and the processing of
events t
ook
too long."""
events t
akes
too long."""
def
step
(
self
):
"""Waits until enough realtime has passed for the next event to happen.
"""Waits until enough real-time has passed for the next event to
happen.
The delay is scaled according to the real-time :attr:`factor`. If the
events of a time step are processed too slowly for the given
:attr:`factor` and if :attr:`strict` is enabled, a :exc:`RuntimeError`
is risen."""
is raised.
"""
evt_time
=
self
.
peek
()
if
evt_time
is
Infinity
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment