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
26b40df0
Commit
26b40df0
authored
Nov 07, 2013
by
Ioannis Papagiannopoulos
Committed by
Jérome Perrin
Dec 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new examples added to the documentation - corresponding .py examples
parent
bb280018
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
174 additions
and
0 deletions
+174
-0
ManPy_documentation.pdf
ManPy_documentation.pdf
+0
-0
dream/simulation/Examples/BatchDecomposition.py
dream/simulation/Examples/BatchDecomposition.py
+44
-0
dream/simulation/Examples/ClearBatchLines.py
dream/simulation/Examples/ClearBatchLines.py
+66
-0
dream/simulation/Examples/SerialBatchProcessing.py
dream/simulation/Examples/SerialBatchProcessing.py
+64
-0
No files found.
ManPy_documentation.pdf
View file @
26b40df0
No preview for this file type
dream/simulation/Examples/BatchDecomposition.py
0 → 100644
View file @
26b40df0
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
Batch
import
Batch
from
BatchDecomposition
import
BatchDecomposition
from
BatchSource
import
BatchSource
from
Machine
import
Machine
from
Exit
import
Exit
from
Queue
import
Queue
from
Globals
import
G
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Batch
,
batchNumberOfUnits
=
4
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
M
=
Machine
(
'M'
,
'Machine'
,
mean
=
0.5
)
E
=
Exit
(
'E'
,
'Exit'
)
# add all the objects in the G.ObjList so that they can be easier accessed later
G
.
ObjList
=
[
S
,
Q
,
BD
,
M
,
E
]
# define the predecessors and successors for the objects
S
.
defineRouting
([
Q
])
Q
.
defineRouting
([
S
],[
BD
])
BD
.
defineRouting
([
Q
],[
M
])
M
.
defineRouting
([
BD
],[
E
])
E
.
defineRouting
([
M
])
# initialize the simulation (SimPy method)
initialize
()
# initialize all the objects
for
object
in
G
.
ObjList
:
object
.
initialize
()
# activate all the objects
for
object
in
G
.
ObjList
:
activate
(
object
,
object
.
run
())
# set G.maxSimTime 1440.0 minutes (1 day)
G
.
maxSimTime
=
1440.0
# run the simulation
simulate
(
until
=
G
.
maxSimTime
)
# carry on the post processing operations for every object in the topology
for
object
in
G
.
ObjList
:
object
.
postProcessing
()
# print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the working ratio of"
,
M
.
objName
,
"is"
,
(
M
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M
.
objName
,
'is'
,
(
M
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M
.
objName
,
'is'
,
(
M
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
\ No newline at end of file
dream/simulation/Examples/ClearBatchLines.py
0 → 100644
View file @
26b40df0
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
Globals
import
G
from
Machine
import
Machine
from
Exit
import
Exit
from
Queue
import
Queue
from
Batch
import
Batch
from
BatchDecomposition
import
BatchDecomposition
from
BatchReassembly
import
BatchReassembly
from
BatchSource
import
BatchSource
from
LineClearance
import
LineClearance
import
ExcelHandler
# choose to output trace or not
G
.
trace
=
'Yes'
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
item
=
Batch
,
batchNumberOfUnits
=
100
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.5
)
Q1
=
LineClearance
(
'Q1'
,
'Queue1'
,
capacity
=
2
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
4
)
BRA
=
BatchReassembly
(
'BRA'
,
'BatchReassembly'
,
numberOfSubBatches
=
4
,
mean
=
0
)
M3
=
Machine
(
'M3'
,
'Machine3'
,
mean
=
1
)
E
=
Exit
(
'E'
,
'Exit'
)
# add all the objects in the G.ObjList so that they can be easier accessed later
G
.
ObjList
=
[
S
,
Q
,
BD
,
M1
,
Q1
,
M2
,
BRA
,
M3
,
E
]
# define the predecessors and successors for the objects
S
.
defineRouting
([
Q
])
Q
.
defineRouting
([
S
],[
BD
])
BD
.
defineRouting
([
Q
],[
M1
])
M1
.
defineRouting
([
BD
],[
Q1
])
Q1
.
defineRouting
([
M1
],[
M2
])
M2
.
defineRouting
([
Q1
],[
BRA
])
BRA
.
defineRouting
([
M2
],[
M3
])
M3
.
defineRouting
([
BRA
],[
E
])
E
.
defineRouting
([
M3
])
# initialize the simulation (SimPy method)
initialize
()
# initialize all the objects
for
object
in
G
.
ObjList
:
object
.
initialize
()
# activate all the objects
for
object
in
G
.
ObjList
:
activate
(
object
,
object
.
run
())
# set G.maxSimTime 1440.0 minutes (1 day)
G
.
maxSimTime
=
1440.0
# run the simulation
simulate
(
until
=
G
.
maxSimTime
)
# carry on the post processing operations for every object in the topology
for
object
in
G
.
ObjList
:
object
.
postProcessing
()
# print trace
ExcelHandler
.
outputTrace
(
'Topology23'
)
# print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the working ratio of"
,
M1
.
objName
,
"is"
,
(
M1
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M1
.
objName
,
'is'
,
(
M1
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M1
.
objName
,
'is'
,
(
M1
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
print
"the working ratio of"
,
M2
.
objName
,
"is"
,
(
M2
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M2
.
objName
,
'is'
,
(
M2
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M2
.
objName
,
'is'
,
(
M2
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
print
"the working ratio of"
,
M3
.
objName
,
"is"
,
(
M3
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M3
.
objName
,
'is'
,
(
M3
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M3
.
objName
,
'is'
,
(
M3
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
dream/simulation/Examples/SerialBatchProcessing.py
0 → 100644
View file @
26b40df0
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
Globals
import
G
from
Machine
import
Machine
from
Exit
import
Exit
from
Queue
import
Queue
from
Batch
import
Batch
from
BatchDecomposition
import
BatchDecomposition
from
BatchReassembly
import
BatchReassembly
from
BatchSource
import
BatchSource
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
item
=
Batch
,
batchNumberOfUnits
=
100
)
Q
=
Queue
(
'Q'
,
'StartQueue'
,
capacity
=
100000
)
BD
=
BatchDecomposition
(
'BC'
,
'BatchDecomposition'
,
numberOfSubBatches
=
4
,
mean
=
1
)
M1
=
Machine
(
'M1'
,
'Machine1'
,
mean
=
0.5
)
Q1
=
Queue
(
'Q1'
,
'Queue1'
,
capacity
=
2
)
M2
=
Machine
(
'M2'
,
'Machine2'
,
mean
=
1
)
BRA
=
BatchReassembly
(
'BRA'
,
'BatchReassembly'
,
numberOfSubBatches
=
4
,
mean
=
0
)
M3
=
Machine
(
'M3'
,
'Machine3'
,
mean
=
1
)
E
=
Exit
(
'E'
,
'Exit'
)
# add all the objects in the G.ObjList so that they can be easier accessed later
G
.
ObjList
=
[
S
,
Q
,
BD
,
M1
,
Q1
,
M2
,
BRA
,
M3
,
E
]
# define the predecessors and successors for the objects
S
.
defineRouting
([
Q
])
Q
.
defineRouting
([
S
],[
BD
])
BD
.
defineRouting
([
Q
],[
M1
])
M1
.
defineRouting
([
BD
],[
Q1
])
Q1
.
defineRouting
([
M1
],[
M2
])
M2
.
defineRouting
([
Q1
],[
BRA
])
BRA
.
defineRouting
([
M2
],[
M3
])
M3
.
defineRouting
([
BRA
],[
E
])
E
.
defineRouting
([
M3
])
# initialize the simulation (SimPy method)
initialize
()
# initialize all the objects
for
object
in
G
.
ObjList
:
object
.
initialize
()
# activate all the objects
for
object
in
G
.
ObjList
:
activate
(
object
,
object
.
run
())
# set G.maxSimTime 1440.0 minutes (1 day)
G
.
maxSimTime
=
1440.0
# run the simulation
simulate
(
until
=
G
.
maxSimTime
)
# carry on the post processing operations for every object in the topology
for
object
in
G
.
ObjList
:
object
.
postProcessing
()
# print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
# for object in G.MachineList:
# print "the working ratio of", object.objName, "is", (object.totalWorkingTime/G.maxSimTime)*100
# print "the blockage ratio of", object.objName, "is", (object.totalBlockageTime/G.maxSimTime)*100
# print "the waiting ratio of", object.objName, "is", (object.totalWaitingTime/G.maxSimTime)*100
print
"the working ratio of"
,
M1
.
objName
,
"is"
,
(
M1
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M1
.
objName
,
'is'
,
(
M1
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M1
.
objName
,
'is'
,
(
M1
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
print
"the working ratio of"
,
M2
.
objName
,
"is"
,
(
M2
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M2
.
objName
,
'is'
,
(
M2
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M2
.
objName
,
'is'
,
(
M2
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
print
"the working ratio of"
,
M3
.
objName
,
"is"
,
(
M3
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the blockage ratio of"
,
M3
.
objName
,
'is'
,
(
M3
.
totalBlockageTime
/
G
.
maxSimTime
)
*
100
print
"the waiting ratio of"
,
M3
.
objName
,
'is'
,
(
M3
.
totalWaitingTime
/
G
.
maxSimTime
)
*
100
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