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
ccf38908
Commit
ccf38908
authored
Sep 02, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example does not have to send signal now
parent
15a9b727
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
3 deletions
+2
-3
dream/simulation/Examples/BalancingABuffer.py
dream/simulation/Examples/BalancingABuffer.py
+2
-2
dream/simulation/Globals.py
dream/simulation/Globals.py
+0
-1
No files found.
dream/simulation/Examples/BalancingABuffer.py
View file @
ccf38908
...
...
@@ -8,6 +8,7 @@ def balanceQueue(buffer, refillLevel=1):
numInQueue
=
len
(
objectQueue
)
print
'-'
*
50
print
'at time='
,
G
.
env
.
now
# check if the buffer is empty and if yes fill it with 5 parts
if
numInQueue
==
0
:
print
'buffer is starving, I will bring 5 parts'
for
i
in
range
(
refillLevel
):
...
...
@@ -19,8 +20,7 @@ def balanceQueue(buffer, refillLevel=1):
# set the part as WIP
setWIP
([
P
])
G
.
numOfParts
+=
1
# send a signal to the buffer that it can dispose an Entity
buffer
.
canDispose
.
succeed
(
G
.
env
.
now
)
# else do nothing
else
:
print
'buffer has'
,
numInQueue
,
'parts. No need to bring more'
...
...
dream/simulation/Globals.py
View file @
ccf38908
...
...
@@ -280,7 +280,6 @@ def setWIP(entityList):
if
issubclass
(
entity
.
currentStation
.
__class__
,
Queue
):
# send the signal only if it is not already triggered
if
not
entity
.
currentStation
.
canDispose
.
triggered
:
# print 'sending canDispose to', entity.currentStation.id
entity
.
currentStation
.
canDispose
.
succeed
(
G
.
env
.
now
)
# if we are in the start of the simulation the object is of server type then we should send initialWIP signal
# TODO, maybe use 'class_family attribute here'
...
...
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