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
442b8927
Commit
442b8927
authored
Jul 11, 2013
by
Ontje Lünsdorf
Browse files
Set default priority for convenience and set name attribute in initialize.
parent
9f6191db
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
simpy/core.py
simpy/core.py
+2
-1
No files found.
simpy/core.py
View file @
442b8927
...
...
@@ -355,6 +355,7 @@ class Initialize(Event):
"""Initializes a process."""
def
__init__
(
self
,
env
,
process
):
self
.
env
=
env
self
.
name
=
None
self
.
ok
=
True
self
.
_value
=
None
self
.
callbacks
=
[
process
.
_resume
]
...
...
@@ -528,7 +529,7 @@ class Scheduler(object):
self
.
queue
=
[]
self
.
_eid
=
count
()
def
schedule
(
self
,
event
,
priority
,
delay
=
0
):
def
schedule
(
self
,
event
,
priority
=
DEFAULT_PRIORITY
,
delay
=
0
):
"""Schedule an *event* with a given *priority* and a *delay*."""
heappush
(
self
.
queue
,
(
self
.
now
+
delay
,
priority
,
next
(
self
.
_eid
),
event
))
...
...
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