Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
4b5d9098
Commit
4b5d9098
authored
Oct 31, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes in CoreObject for thread synching in offShift and canDeliverOnInterruption
parent
3918cac5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+9
-2
No files found.
dream/simulation/CoreObject.py
View file @
4b5d9098
...
...
@@ -86,6 +86,8 @@ class CoreObject(ManPyObject):
"moveEnd"
:
0
,
"processOperatorUnavailable"
:
0
}
# flag notifying the the station can deliver entities that ended their processing while interrupted
self
.
canDeliverOnInterruption
=
False
def
initialize
(
self
):
from
Globals
import
G
...
...
@@ -525,7 +527,10 @@ class CoreObject(ManPyObject):
@
staticmethod
def
findGiversFor
(
activeObject
):
givers
=
[]
for
object
in
[
x
for
x
in
activeObject
.
previous
if
(
not
x
is
activeObject
)
and
not
x
.
canDispose
.
triggered
and
x
.
expectedSignals
[
'canDispose'
]]:
for
object
in
[
x
for
x
in
activeObject
.
previous
if
(
not
x
is
activeObject
)
and
not
x
.
canDispose
.
triggered
and
(
x
.
expectedSignals
[
'canDispose'
]
or
(
x
.
canDeliverOnInterruption
and
x
.
timeLastShiftEnded
==
x
.
env
.
now
))]:
# extra check.If shift ended right now and the object
# can unload we relax the canDispose flag
if
object
.
haveToDispose
(
activeObject
):
givers
.
append
(
object
)
return
givers
...
...
@@ -559,7 +564,9 @@ class CoreObject(ManPyObject):
giversReceiver
=
self
self
.
giver
=
giver
self
.
giver
.
receiver
=
self
if
self
.
giver
.
expectedSignals
[
'canDispose'
]:
if
self
.
giver
.
expectedSignals
[
'canDispose'
]
or
(
self
.
giver
.
canDeliverOnInterruption
and
self
.
giver
.
timeLastShiftEnded
==
self
.
env
.
now
):
# extra check.If shift ended right now and the object
# can unload we relax the canDispose flag
self
.
sendSignal
(
receiver
=
self
.
giver
,
signal
=
self
.
giver
.
canDispose
)
self
.
printTrace
(
self
.
id
,
signalGiver
=
self
.
giver
.
id
)
return
True
...
...
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