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
c501105b
Commit
c501105b
authored
Sep 04, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first version of nonStarvingEntry. Also one test and its dump
parent
1f979770
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
160 additions
and
0 deletions
+160
-0
dream/simulation/JSONInputs/NonStarvingEntry.json
dream/simulation/JSONInputs/NonStarvingEntry.json
+52
-0
dream/simulation/NonStarvingEntry.py
dream/simulation/NonStarvingEntry.py
+73
-0
dream/tests/dump/NonStarvingEntry.json.result
dream/tests/dump/NonStarvingEntry.json.result
+35
-0
No files found.
dream/simulation/JSONInputs/NonStarvingEntry.json
0 → 100644
View file @
c501105b
{
"_class"
:
"Dream.Simulation"
,
"edges"
:
{
"0"
:
[
"NS1"
,
"M1"
,
{}
],
"1"
:
[
"M1"
,
"E1"
,
{}
]
},
"general"
:
{
"_class"
:
"Dream.Configuration"
,
"confidenceLevel"
:
"0.95"
,
"maxSimTime"
:
"10"
,
"numberOfReplications"
:
"1"
,
"trace"
:
"No"
},
"nodes"
:
{
"E1"
:
{
"_class"
:
"Dream.Exit"
,
"left"
:
0.5
,
"name"
:
"Stock"
,
"top"
:
0.10215053763440862
},
"M1"
:
{
"_class"
:
"Dream.Machine"
,
"failures"
:
{
"failureDistribution"
:
"No"
},
"left"
:
0.5
,
"name"
:
"Moulding"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
1
},
"top"
:
0.5
},
"NS1"
:
{
"_class"
:
"Dream.NonStarvingEntry"
,
"entityData"
:
{
"_class"
:
"Dream.Part"
},
"left"
:
0.5
,
"name"
:
"Raw Material"
,
"top"
:
0.8978494623655914
}
}
}
\ No newline at end of file
dream/simulation/NonStarvingEntry.py
0 → 100644
View file @
c501105b
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 8 Nov 2012
@author: George
'''
'''
Models an intro element that is never starved.
In removeEntity, each time it falls below a specific level it creates new Entities
'''
import
simpy
from
Queue
import
Queue
# ===========================================================================
# the Queue object
# ===========================================================================
class
NonStarvingEntry
(
Queue
):
family
=
'Entry'
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
)
self
.
threshold
=
int
(
threshold
)
self
.
initialWIPLevel
=
int
(
initialWIPLevel
)
self
.
entityData
=
dict
(
entityData
)
def
initialize
(
self
):
Queue
.
initialize
(
self
)
from
Globals
import
G
import
Globals
for
i
in
range
(
self
.
initialWIPLevel
):
self
.
createEntity
()
def
removeEntity
(
self
,
entity
=
None
):
activeEntity
=
Queue
.
removeEntity
(
self
,
entity
)
#run the default method
activeObjectQueue
=
self
.
getActiveObjectQueue
()
entityType
=
self
.
entityData
.
get
(
'_class'
,
None
)
if
len
(
activeObjectQueue
)
<
self
.
threshold
:
self
.
createEntity
()
return
activeEntity
def
createEntity
(
self
):
from
Globals
import
G
import
Globals
entityType
=
self
.
entityData
.
get
(
'_class'
,
None
)
assert
entityType
,
'the entity type of the non starving buffer could not be identified'
entityType
=
Globals
.
getClassFromName
(
entityType
)
Eargs
=
{
'id'
:
G
.
numberOfEntities
,
'name'
:
str
(
entityType
)
+
str
(
G
.
numberOfEntities
),
'currentStation'
:
self
}
E
=
entityType
(
**
Eargs
)
Globals
.
setWIP
([
E
])
G
.
numberOfEntities
+=
1
if
not
self
.
canDispose
.
triggered
:
self
.
canDispose
.
succeed
(
self
.
env
.
now
)
\ No newline at end of file
dream/tests/dump/NonStarvingEntry.json.result
0 → 100644
View file @
c501105b
{
"_class": "Dream.Simulation",
"elementList": [
{
"_class": "Dream.Exit",
"family": "Exit",
"id": "E1",
"results": {
"lifespan": 5.0,
"takt_time": 1.0,
"throughput": 9
}
},
{
"_class": "Dream.Machine",
"family": "Server",
"id": "M1",
"results": {
"blockage_ratio": 0.0,
"failure_ratio": 0.0,
"waiting_ratio": 0.0,
"working_ratio": 100.0
}
},
{
"_class": "Dream.NonStarvingEntry",
"family": "Entry",
"id": "NS1",
"results": {}
}
],
"general": {
"_class": "Dream.Configuration"
}
}
\ No newline at end of file
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