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
bb621d9c
Commit
bb621d9c
authored
11 years ago
by
Georgios Dagkakis
Committed by
Sebastien Robin
11 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
postprocessing and outputresultsxls updated so that maxSimTime is optional
parent
635f593b
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
50 additions
and
19 deletions
+50
-19
dream/simulation/Assembly.py
dream/simulation/Assembly.py
+7
-2
dream/simulation/Conveyer.py
dream/simulation/Conveyer.py
+7
-2
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+2
-2
dream/simulation/Dismantle.py
dream/simulation/Dismantle.py
+7
-2
dream/simulation/Examples/SingleServer.py
dream/simulation/Examples/SingleServer.py
+1
-1
dream/simulation/Exit.py
dream/simulation/Exit.py
+6
-2
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+2
-2
dream/simulation/Machine.py
dream/simulation/Machine.py
+9
-2
dream/simulation/ObjectResource.py
dream/simulation/ObjectResource.py
+2
-2
dream/simulation/Repairman.py
dream/simulation/Repairman.py
+7
-2
No files found.
dream/simulation/Assembly.py
View file @
bb621d9c
...
...
@@ -211,7 +211,10 @@ class Assembly(CoreObject):
self
.
timeLastEntityEntered
=
now
()
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
if
MaxSimtime
==
None
:
from
Globals
import
G
MaxSimtime
=
G
.
maxSimTime
activeObjectQueue
=
self
.
getActiveObjectQueue
()
#checks all the successors. If no one can accept an Entity then the machine might be blocked
...
...
@@ -253,8 +256,10 @@ class Assembly(CoreObject):
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/Conveyer.py
View file @
bb621d9c
...
...
@@ -272,7 +272,10 @@ class Conveyer(CoreObject):
return
self
.
canAcceptAndIsRequested
()
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
if
MaxSimtime
==
None
:
from
Globals
import
G
MaxSimtime
=
G
.
maxSimTime
self
.
moveEntities
()
#move the entities to count the working time
#if the conveyer is full count the blockage time
if
self
.
isFull
():
...
...
@@ -303,8 +306,10 @@ class Conveyer(CoreObject):
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/CoreObject.py
View file @
bb621d9c
...
...
@@ -90,7 +90,7 @@ class CoreObject(Process):
activeEntity
.
schedule
.
append
([
activeObject
.
id
,
now
()])
#append the time to schedule so that it can be read in the result
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
pass
#outputs message to the trace.xls
...
...
@@ -98,7 +98,7 @@ class CoreObject(Process):
pass
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
pass
#outputs results to JSON File
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/Dismantle.py
View file @
bb621d9c
...
...
@@ -214,7 +214,10 @@ class Dismantle(CoreObject):
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
if
MaxSimtime
==
None
:
from
Globals
import
G
MaxSimtime
=
G
.
maxSimTime
#if there is an entity that finished processing in Dismantle but did not get to reach
#the following Object
...
...
@@ -251,8 +254,10 @@ class Dismantle(CoreObject):
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/Examples/SingleServer.py
View file @
bb621d9c
...
...
@@ -33,7 +33,7 @@ simulate(until=G.maxSimTime) #run the simulation
#carry on the post processing operations for every object in the topology
for
object
in
G
.
ObjList
:
object
.
postProcessing
(
G
.
maxSimTime
)
object
.
postProcessing
()
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/Exit.py
View file @
bb621d9c
...
...
@@ -139,8 +139,10 @@ class Exit(CoreObject):
self
.
outputTrace
(
name
)
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
self
.
Exits
.
append
(
self
.
numOfExits
)
try
:
self
.
Lifespan
.
append
(((
self
.
totalLifespan
)
/
self
.
numOfExits
)
/
G
.
Base
)
...
...
@@ -168,8 +170,10 @@ class Exit(CoreObject):
G
.
traceSheet
=
G
.
traceFile
.
add_sheet
(
'sheet '
+
str
(
G
.
sheetIndex
),
cell_overwrite_ok
=
True
)
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The Throughput in "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
self
.
numOfExits
)
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/LineGenerationJSON.py
View file @
bb621d9c
...
...
@@ -450,11 +450,11 @@ def main(argv=[], input_data=None):
#carry on the post processing operations for every object in the topology
for
element
in
G
.
ObjList
:
element
.
postProcessing
(
G
.
maxSimTime
)
element
.
postProcessing
()
#carry on the post processing operations for every model resource in the topology
for
model_resource
in
G
.
RepairmanList
:
model_resource
.
postProcessing
(
G
.
maxSimTime
)
model_resource
.
postProcessing
()
#output trace to excel
if
(
G
.
trace
==
"Yes"
):
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/Machine.py
View file @
bb621d9c
...
...
@@ -295,7 +295,11 @@ class Machine(CoreObject):
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
if
MaxSimtime
==
None
:
from
Globals
import
G
MaxSimtime
=
G
.
maxSimTime
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
...
...
@@ -365,8 +369,11 @@ class Machine(CoreObject):
G
.
traceSheet
=
G
.
traceFile
.
add_sheet
(
'sheet '
+
str
(
G
.
sheetIndex
),
cell_overwrite_ok
=
True
)
#outputs the the "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of Failure of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalFailureTime
/
MaxSimtime
)
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/ObjectResource.py
View file @
bb621d9c
...
...
@@ -40,7 +40,7 @@ class ObjectResource(object):
return
len
(
self
.
Res
.
activeQ
)
<
self
.
capacity
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
pass
#outputs message to the trace.xls
...
...
@@ -48,7 +48,7 @@ class ObjectResource(object):
pass
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
pass
#outputs results to JSON File
...
...
This diff is collapsed.
Click to expand it.
dream/simulation/Repairman.py
View file @
bb621d9c
...
...
@@ -49,7 +49,10 @@ class Repairman(ObjectResource):
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
=
None
):
if
MaxSimtime
==
None
:
from
Globals
import
G
MaxSimtime
=
G
.
maxSimTime
#if the repairman is currently working we have to count the time of this work
if
len
(
self
.
getResourceQueue
())
>
0
:
self
.
totalWorkingTime
+=
now
()
-
self
.
timeLastRepairStarted
...
...
@@ -61,8 +64,10 @@ class Repairman(ObjectResource):
self
.
Working
.
append
(
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
#outputs data to "output.xls"
def
outputResultsXL
(
self
,
MaxSimtime
):
def
outputResultsXL
(
self
,
MaxSimtime
=
None
):
from
Globals
import
G
if
MaxSimtime
==
None
:
MaxSimtime
=
G
.
maxSimTime
if
(
G
.
numberOfReplications
==
1
):
#if we had just one replication output the results to excel
G
.
outputSheet
.
write
(
G
.
outputIndex
,
0
,
"The percentage of working of "
+
self
.
objName
+
" is:"
)
G
.
outputSheet
.
write
(
G
.
outputIndex
,
1
,
100
*
self
.
totalWorkingTime
/
MaxSimtime
)
...
...
This diff is collapsed.
Click to expand it.
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