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
b5814f12
Commit
b5814f12
authored
May 23, 2013
by
Georgios Dagkakis
Committed by
Sebastien Robin
Jun 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exit object updated to count takt time
parent
ea1511f7
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
51 additions
and
28 deletions
+51
-28
DREAM/dream/simulation/src/Exit.py
DREAM/dream/simulation/src/Exit.py
+32
-11
DREAM/dream/simulation/src/JSONInputs/Topology01.json
DREAM/dream/simulation/src/JSONInputs/Topology01.json
+2
-2
DREAM/dream/simulation/src/JSONInputs/Topology03.json
DREAM/dream/simulation/src/JSONInputs/Topology03.json
+1
-1
DREAM/dream/simulation/src/JSONInputs/Topology04.json
DREAM/dream/simulation/src/JSONInputs/Topology04.json
+2
-2
DREAM/dream/simulation/src/JSONInputs/Topology05.json
DREAM/dream/simulation/src/JSONInputs/Topology05.json
+1
-1
DREAM/dream/simulation/src/JSONInputs/Topology06.json
DREAM/dream/simulation/src/JSONInputs/Topology06.json
+2
-2
DREAM/dream/simulation/src/JSONInputs/Topology07.json
DREAM/dream/simulation/src/JSONInputs/Topology07.json
+1
-1
DREAM/dream/simulation/src/JSONInputs/Topology08.json
DREAM/dream/simulation/src/JSONInputs/Topology08.json
+1
-1
DREAM/dream/simulation/src/JSONInputs/Topology10.json
DREAM/dream/simulation/src/JSONInputs/Topology10.json
+1
-1
DREAM/dream/simulation/src/JSONInputs/Topology11.json
DREAM/dream/simulation/src/JSONInputs/Topology11.json
+2
-2
DREAM/dream/simulation/src/JSONInputs/Topology12.json
DREAM/dream/simulation/src/JSONInputs/Topology12.json
+2
-2
DREAM/dream/simulation/src/LineGenerationJSON.py
DREAM/dream/simulation/src/LineGenerationJSON.py
+2
-2
DREAM/dream/simulation/src/Source.py
DREAM/dream/simulation/src/Source.py
+2
-0
DREAM/dream/simulation/src/output.xls
DREAM/dream/simulation/src/output.xls
+0
-0
DREAM/dream/simulation/src/trace1.xls
DREAM/dream/simulation/src/trace1.xls
+0
-0
No files found.
DREAM/dream/simulation/src/Exit.py
View file @
b5814f12
...
...
@@ -55,7 +55,10 @@ class Exit(Process):
self
.
downTimeInCurrentEntity
=
0
#holds the total time that the object was down while holding current entity
self
.
timeLastEntityLeft
=
0
#holds the last time that an entity left the object
self
.
processingTimeOfCurrentEntity
=
0
#holds the total processing time that the current entity required
self
.
processingTimeOfCurrentEntity
=
0
#holds the total processing time that the current entity required
self
.
totalTaktTime
=
0
#the total time between to consecutive exits
self
.
TaktTime
=
[]
#list that holds the avg time between to consecutive exits
self
.
waitToDispose
=
False
#shows if the object waits to dispose an entity
...
...
@@ -65,6 +68,8 @@ class Exit(Process):
#and one predecessor requests it
self
.
getEntity
()
self
.
numOfExits
+=
1
#increase the exits by one
self
.
totalTaktTime
+=
now
()
-
self
.
timeLastEntityLeft
#add the takt time
self
.
timeLastEntityLeft
=
now
()
#update the time that the last entity left from the Exit
#sets the routing in element for the Exit
def
defineRouting
(
self
,
p
):
...
...
@@ -88,13 +93,6 @@ class Exit(Process):
#gets an entity from the predecessor
def
getEntity
(
self
):
'''
#A=self.previous[0].Res.activeQ[0]
name=self.previous[0].Res.activeQ[0].name #get the name of the entity for the trace
self.totalLifespan+=now()-self.previous[0].Res.activeQ[0].startTime #Add the entity's lifespan to the total one.
self.previous[0].removeEntity() #remove the entity from the previous object
#del A
'''
name
=
self
.
previous
[
self
.
predecessorIndex
].
Res
.
activeQ
[
0
].
name
#get the name of the entity for the trace
self
.
totalLifespan
+=
now
()
-
self
.
previous
[
self
.
predecessorIndex
].
Res
.
activeQ
[
0
].
startTime
#Add the entity's lifespan to the total one.
self
.
previous
[
self
.
predecessorIndex
].
removeEntity
()
#remove the entity from the previous object
...
...
@@ -108,6 +106,10 @@ class Exit(Process):
self
.
Lifespan
.
append
(((
self
.
totalLifespan
)
/
self
.
numOfExits
)
/
G
.
Base
)
except
ZeroDivisionError
:
self
.
Lifespan
.
append
(
0
)
try
:
self
.
TaktTime
.
append
(((
self
.
totalTaktTime
)
/
self
.
numOfExits
)
/
G
.
Base
)
except
ZeroDivisionError
:
self
.
TaktTime
.
append
(
0
)
#outputs message to the trace.xls. Format is (Simulation Time | Entity Name | "generated")
...
...
@@ -133,8 +135,17 @@ class Exit(Process):
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
self
.
numOfExits
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The average lifespan of an entity that exited from "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,((
self
.
totalLifespan
)
/
self
.
numOfExits
)
/
G
.
Base
)
try
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,((
self
.
totalLifespan
)
/
self
.
numOfExits
)
/
G
.
Base
)
except
ZeroDivisionError
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
0
)
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The average tatk time in "
+
self
.
objName
+
" is:"
)
try
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,((
self
.
totalTaktTime
)
/
self
.
numOfExits
)
/
G
.
Base
)
except
ZeroDivisionError
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
0
)
G
.
outputIndex
+=
1
else
:
#if we had multiple replications we output confidence intervals to excel
#for some outputs the results may be the same for each run (eg model is stochastic but failures fixed
#so failurePortion will be exactly the same in each run). That will give 0 variability and errors.
...
...
@@ -160,9 +171,19 @@ class Exit(Process):
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
self
.
Lifespan
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
self
.
Lifespan
[
0
])
G
.
outputIndex
+=
1
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"CI "
+
str
(
G
.
confidenceLevel
*
100
)
+
"% for the avg takt time in "
+
self
.
objName
+
" is:"
)
if
self
.
checkIfArrayHasDifValues
(
self
.
TaktTime
):
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
stat
.
bayes_mvs
(
self
.
TaktTime
,
G
.
confidenceLevel
)[
0
][
1
][
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
stat
.
bayes_mvs
(
self
.
TaktTime
,
G
.
confidenceLevel
)[
0
][
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
stat
.
bayes_mvs
(
self
.
TaktTime
,
G
.
confidenceLevel
)[
0
][
1
][
1
])
else
:
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
self
.
TaktTime
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
2
,
self
.
TaktTime
[
0
])
G
.
outputSheet
.
write
(
G
.
outputIndex
,
3
,
self
.
TaktTime
[
0
])
G
.
outputIndex
+=
1
G
.
outputIndex
+=
1
#takes the array and checks if all its values are identical (returns false) or not (returns true)
#needed because if somebody runs multiple runs in deterministic case it would crash!
def
checkIfArrayHasDifValues
(
self
,
array
):
...
...
DREAM/dream/simulation/src/JSONInputs/Topology01.json
View file @
b5814f12
...
...
@@ -60,7 +60,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"DummyQ"
,
"name"
:
"DummyQ"
,
"isDummy"
:
"
True
"
,
"isDummy"
:
"
1
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"S1"
],
"successorList"
:
[
"M1"
]
...
...
@@ -68,7 +68,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M1"
],
"successorList"
:
[
"M2"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology03.json
View file @
b5814f12
...
...
@@ -60,7 +60,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"DummyQ"
,
"name"
:
"DummyQ"
,
"isDummy"
:
"
True
"
,
"isDummy"
:
"
1
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"S1"
],
"successorList"
:
[
"M1"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology04.json
View file @
b5814f12
...
...
@@ -60,7 +60,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"DummyQ"
,
"name"
:
"DummyQ"
,
"isDummy"
:
"
True
"
,
"isDummy"
:
"
1
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"S1"
],
"successorList"
:
[
"M2"
]
...
...
@@ -68,7 +68,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M2"
],
"successorList"
:
[
"M1"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology05.json
View file @
b5814f12
...
...
@@ -77,7 +77,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M1"
],
"successorList"
:
[
"M2"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology06.json
View file @
b5814f12
...
...
@@ -73,7 +73,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"DummyQ"
,
"name"
:
"DummyQ"
,
"isDummy"
:
"
True
"
,
"isDummy"
:
"
1
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"S1"
],
"successorList"
:
[
"M1"
]
...
...
@@ -81,7 +81,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M1"
],
"successorList"
:
[
"M2"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology07.json
View file @
b5814f12
...
...
@@ -79,7 +79,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M1"
,
"M2"
],
"successorList"
:
[
"M3"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology08.json
View file @
b5814f12
...
...
@@ -97,7 +97,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M1"
,
"M2"
,
"M3"
],
"successorList"
:
[
"M4"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology10.json
View file @
b5814f12
...
...
@@ -86,7 +86,7 @@
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"M1"
,
"M2"
],
"successorList"
:
[
"M3"
,
"M4"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology11.json
View file @
b5814f12
...
...
@@ -79,7 +79,7 @@
"_class"
:
"Dream.Queue"
,
"id"
:
"DummyQ"
,
"name"
:
"DummyQ"
,
"isDummy"
:
"
True
"
,
"isDummy"
:
"
1
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"S1"
],
"successorList"
:
[
"Q1"
]
...
...
@@ -88,7 +88,7 @@
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"DummyQ"
],
"successorList"
:
[
"M1"
,
"M2"
]
...
...
DREAM/dream/simulation/src/JSONInputs/Topology12.json
View file @
b5814f12
...
...
@@ -93,7 +93,7 @@
"_class"
:
"Dream.Queue"
,
"id"
:
"DummyQ"
,
"name"
:
"DummyQ"
,
"isDummy"
:
"
True
"
,
"isDummy"
:
"
1
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"S1"
],
"successorList"
:
[
"Q1"
]
...
...
@@ -102,7 +102,7 @@
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Q1"
,
"isDummy"
:
"
False
"
,
"isDummy"
:
"
0
"
,
"capacity"
:
"1"
,
"predecessorList"
:
[
"DummyQ"
],
"successorList"
:
[
"M1"
,
"M2"
]
...
...
DREAM/dream/simulation/src/LineGenerationJSON.py
View file @
b5814f12
...
...
@@ -123,7 +123,7 @@ def createObjects():
successorList
=
coreObject
[
i
].
get
(
'successorList'
,
'not found'
)
predecessorList
=
coreObject
[
i
].
get
(
'predecessorList'
,
'not found'
)
capacity
=
int
(
coreObject
[
i
].
get
(
'capacity'
,
'1'
))
isDummy
=
bool
(
coreObject
[
i
].
get
(
'isDummy'
,
'False'
))
isDummy
=
bool
(
int
(
coreObject
[
i
].
get
(
'isDummy'
,
'0'
)
))
Q
=
Queue
(
id
,
name
,
capacity
,
isDummy
)
Q
.
previousIds
=
predecessorList
Q
.
nextIds
=
successorList
...
...
@@ -298,5 +298,5 @@ def main():
G
.
outputFile
.
save
(
"output.xls"
)
print
"execution time="
+
str
(
time
.
time
()
-
start
)
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
DREAM/dream/simulation/src/Source.py
View file @
b5814f12
...
...
@@ -75,6 +75,7 @@ class Source(Process):
#entity=Entity("Ent"+str(i))
entity
=
self
.
item
(
self
.
item
.
type
+
"_"
+
self
.
objName
+
"_"
+
str
(
i
))
#create the Entity object and assign its name
entity
.
creationTime
=
now
()
#assign the current simulation time as the Entity's creation time
entity
.
startTime
=
now
()
#assign the current simulation time as the Entity's start time
self
.
outputTrace
(
self
.
item
.
type
+
"_"
+
self
.
objName
+
"_"
+
str
(
i
))
#output the trace
self
.
Res
.
activeQ
.
append
(
entity
)
#append the entity to the resource
i
+=
1
...
...
@@ -88,6 +89,7 @@ class Source(Process):
#entity=Entity("Ent"+str(i)) #create the Entity object and assign its name
entity
=
self
.
item
(
self
.
item
.
type
+
str
(
i
))
#create the Entity object and assign its name
entity
.
creationTime
=
now
()
#assign the current simulation time as the Entity's creation time
entity
.
startTime
=
now
()
#assign the current simulation time as the Entity's start time
self
.
outputTrace
(
self
.
item
.
type
+
str
(
i
))
#output the trace
i
+=
1
self
.
Res
.
activeQ
.
append
(
entity
)
#append the entity to the resource
...
...
DREAM/dream/simulation/src/output.xls
View file @
b5814f12
No preview for this file type
DREAM/dream/simulation/src/trace1.xls
View file @
b5814f12
No preview for this file type
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