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
4afee363
Commit
4afee363
authored
Sep 04, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments added
parent
37b0f07a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
dream/simulation/NonStarvingEntry.py
dream/simulation/NonStarvingEntry.py
+8
-0
No files found.
dream/simulation/NonStarvingEntry.py
View file @
4afee363
...
...
@@ -36,10 +36,14 @@ class NonStarvingEntry(Queue):
def
__init__
(
self
,
id
,
name
,
capacity
=
float
(
'inf'
),
entityData
=
{
'_class'
:
'Dream.Part'
},
threshold
=
2
,
initialWIPLevel
=
2
,
**
kw
):
Queue
.
__init__
(
self
,
id
=
id
,
name
=
name
,
capacity
=
capacity
)
# the threshold under which a new Entity will be created
self
.
threshold
=
int
(
threshold
)
# the number of Entities in the start of simulation
self
.
initialWIPLevel
=
int
(
initialWIPLevel
)
# the data of the Entities (dictionary)
self
.
entityData
=
dict
(
entityData
)
# extend to create the initial WIP in the given level
def
initialize
(
self
):
Queue
.
initialize
(
self
)
from
Globals
import
G
...
...
@@ -47,6 +51,7 @@ class NonStarvingEntry(Queue):
for
i
in
range
(
self
.
initialWIPLevel
):
self
.
createEntity
()
# extend to check if we are below the Threshold and create WIP if yes
def
removeEntity
(
self
,
entity
=
None
):
activeEntity
=
Queue
.
removeEntity
(
self
,
entity
)
#run the default method
activeObjectQueue
=
self
.
getActiveObjectQueue
()
...
...
@@ -55,6 +60,9 @@ class NonStarvingEntry(Queue):
self
.
createEntity
()
return
activeEntity
# create the Entity
# ToDo we could apply similar methodology to source.CreateEntity.
# Source JSON schema may change though.
def
createEntity
(
self
):
from
Globals
import
G
import
Globals
...
...
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