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
6c1013bc
Commit
6c1013bc
authored
Sep 10, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CoreObject to use ManPyObject method
parent
d00abf64
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
25 deletions
+8
-25
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+5
-5
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-20
No files found.
dream/simulation/CapacityStationController.py
View file @
6c1013bc
...
...
@@ -123,11 +123,11 @@ class CapacityStationController(EventGenerator):
for
entity
in
entitiesToCheck
:
if
not
entity
.
shouldMove
:
# when the first entity that should not move is reached break
break
if
station
.
expectedSignals
[
'isRequested'
]:
# ToDo, here we do not check if station.expectedSignals['isRequested']==1
# consistency problem?
succeedTuple
=
(
buffer
,
self
.
env
.
now
)
station
.
isRequested
.
succeed
(
succeedTuple
)
# send is requested to station
station
.
expectedSignals
[
'isRequested'
]
=
0
# wait until the entity is removed
buffer
.
waitEntityRemoval
=
True
buffer
.
expectedSignals
[
'entityRemoved'
]
=
1
...
...
dream/simulation/CoreObject.py
View file @
6c1013bc
...
...
@@ -290,24 +290,9 @@ class CoreObject(ManPyObject):
# update wipStatList
if
self
.
gatherWipStat
:
self
.
wipStatList
.
append
([
self
.
env
.
now
,
len
(
activeObjectQueue
)])
if
self
.
entityRemoved
.
triggered
:
if
self
.
entityRemoved
.
value
!=
self
.
env
.
now
and
self
.
waitEntityRemoval
and
self
.
expectedSignals
[
'entityRemoved'
]:
# print self.id,'triggered and waiting'
self
.
entityRemoved
=
self
.
env
.
event
()
if
self
.
expectedSignals
[
'entityRemoved'
]:
self
.
printTrace
(
self
.
id
,
signal
=
'(removedEntity)'
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
entityRemoved
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'entityRemoved'
]
=
0
elif
self
.
waitEntityRemoval
and
self
.
expectedSignals
[
'entityRemoved'
]:
# print self.id,'not triggered and waiting'
self
.
printTrace
(
self
.
id
,
signal
=
'(removedEntity)'
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
entityRemoved
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'entityRemoved'
]
=
0
elif
not
self
.
waitEntityRemoval
and
not
self
.
expectedSignals
[
'entityRemoved'
]:
# print self.id,'not triggered but not waiting'
pass
self
.
sendSignal
(
receiver
=
self
,
signal
=
self
.
entityRemoved
)
return
entity
#===========================================================================
...
...
@@ -494,9 +479,7 @@ class CoreObject(ManPyObject):
# assign the entry of the receiver
self
.
receiver
.
assignEntryTo
()
if
self
.
receiver
.
expectedSignals
[
'isRequested'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
receiver
.
isRequested
.
succeed
(
succeedTuple
)
self
.
receiver
.
expectedSignals
[
'isRequested'
]
=
0
self
.
sendSignal
(
receiver
=
self
.
receiver
,
signal
=
self
.
receiver
.
isRequested
)
return
True
# if no receiver can accept then try to preempt a receive if the stations holds a critical order
self
.
preemptReceiver
()
...
...
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