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
efe93f63
Commit
efe93f63
authored
May 23, 2013
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exit object updated to count takt time
parent
4b470bb7
Changes
15
Show 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 @
efe93f63
...
...
@@ -57,6 +57,9 @@ class Exit(Process):
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
def
run
(
self
):
...
...
@@ -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,7 +135,16 @@ 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:"
)
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
...
...
@@ -160,8 +171,18 @@ 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
.
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!
...
...
DREAM/dream/simulation/src/JSONInputs/Topology01.json
View file @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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 @
efe93f63
...
...
@@ -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
...
...
DREAM/dream/simulation/src/Source.py
View file @
efe93f63
...
...
@@ -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 @
efe93f63
No preview for this file type
DREAM/dream/simulation/src/trace1.xls
View file @
efe93f63
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