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
f0eae342
Commit
f0eae342
authored
Feb 14, 2014
by
Georgios Dagkakis
Committed by
Jérome Perrin
Feb 19, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Examples updated to import from the root
parent
456a194f
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
128 additions
and
126 deletions
+128
-126
dream/simulation/Examples/AssemblyLine.py
dream/simulation/Examples/AssemblyLine.py
+7
-7
dream/simulation/Examples/BatchDecomposition.py
dream/simulation/Examples/BatchDecomposition.py
+7
-7
dream/simulation/Examples/ClearBatchLines.py
dream/simulation/Examples/ClearBatchLines.py
+11
-11
dream/simulation/Examples/JobShop1.py
dream/simulation/Examples/JobShop1.py
+6
-6
dream/simulation/Examples/JobShop1Trace.py
dream/simulation/Examples/JobShop1Trace.py
+8
-8
dream/simulation/Examples/JobShop2EDD.py
dream/simulation/Examples/JobShop2EDD.py
+6
-6
dream/simulation/Examples/JobShop2MC.py
dream/simulation/Examples/JobShop2MC.py
+6
-6
dream/simulation/Examples/JobShop2Priority.py
dream/simulation/Examples/JobShop2Priority.py
+6
-6
dream/simulation/Examples/JobShop2RPC.py
dream/simulation/Examples/JobShop2RPC.py
+6
-6
dream/simulation/Examples/ParallelServers1.py
dream/simulation/Examples/ParallelServers1.py
+6
-6
dream/simulation/Examples/ParallelServers2.py
dream/simulation/Examples/ParallelServers2.py
+6
-6
dream/simulation/Examples/ParallelServers3.py
dream/simulation/Examples/ParallelServers3.py
+20
-18
dream/simulation/Examples/SerialBatchProcessing.py
dream/simulation/Examples/SerialBatchProcessing.py
+8
-8
dream/simulation/Examples/SingleServer.py
dream/simulation/Examples/SingleServer.py
+1
-1
dream/simulation/Examples/TwoServers.py
dream/simulation/Examples/TwoServers.py
+8
-8
dream/simulation/Examples/TwoServersPlots.py
dream/simulation/Examples/TwoServersPlots.py
+8
-8
dream/simulation/Examples/TwoServersStochastic.py
dream/simulation/Examples/TwoServersStochastic.py
+8
-8
No files found.
dream/simulation/Examples/AssemblyLine.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Machine
import
Machine
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Frame
import
Frame
from
simulation.Assembly
import
Assembly
from
simulation.Globals
import
G
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Source
import
Source
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Part
import
Part
from
dream.
simulation.Frame
import
Frame
from
dream.
simulation.Assembly
import
Assembly
from
dream.
simulation.Globals
import
G
#define the objects of the model
Frame
.
capacity
=
4
...
...
dream/simulation/Examples/BatchDecomposition.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Batch
import
Batch
from
simulation.BatchDecomposition
import
BatchDecomposition
from
simulation.BatchSource
import
BatchSource
from
simulation.Machine
import
Machine
from
simulation.Exit
import
Exit
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
dream.
simulation.Batch
import
Batch
from
dream.
simulation.BatchDecomposition
import
BatchDecomposition
from
dream.
simulation.BatchSource
import
BatchSource
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Queue
import
Queue
from
dream.
simulation.Globals
import
G
# define the objects of the model
...
...
dream/simulation/Examples/ClearBatchLines.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Globals
import
G
from
simulation.Machine
import
Machine
from
simulation.Exit
import
Exit
from
simulation.Queue
import
Queue
from
dream.
simulation.Globals
import
G
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Queue
import
Queue
from
simulation.Batch
import
Batch
from
simulation.BatchDecomposition
import
BatchDecomposition
from
simulation.BatchReassembly
import
BatchReassembly
from
simulation.BatchSource
import
BatchSource
from
simulation.LineClearance
import
LineClearance
import
simulation.ExcelHandler
from
dream.
simulation.Batch
import
Batch
from
dream.
simulation.BatchDecomposition
import
BatchDecomposition
from
dream.
simulation.BatchReassembly
import
BatchReassembly
from
dream.
simulation.BatchSource
import
BatchSource
from
dream.
simulation.LineClearance
import
LineClearance
import
dream.
simulation.ExcelHandler
# choose to output trace or not
G
.
trace
=
'Yes'
...
...
@@ -52,7 +52,7 @@ simulate(until=G.maxSimTime)
for
object
in
G
.
ObjList
:
object
.
postProcessing
()
# print trace
simulation
.
ExcelHandler
.
outputTrace
(
'Trace'
)
dream
.
simulation
.
ExcelHandler
.
outputTrace
(
'Trace'
)
# print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
print
"the working ratio of"
,
M1
.
objName
,
"is"
,
(
M1
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
...
...
dream/simulation/Examples/JobShop1.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.MachineJobShop
import
MachineJobShop
from
simulation.QueueJobShop
import
QueueJobShop
from
simulation.ExitJobShop
import
ExitJobShop
from
simulation.Job
import
Job
from
simulation.Globals
import
G
import
simulation.Globals
as
Globals
from
dream.
simulation.MachineJobShop
import
MachineJobShop
from
dream.
simulation.QueueJobShop
import
QueueJobShop
from
dream.
simulation.ExitJobShop
import
ExitJobShop
from
dream.
simulation.Job
import
Job
from
dream.
simulation.Globals
import
G
import
dream.
simulation.Globals
as
Globals
#define the objects of the model
...
...
dream/simulation/Examples/JobShop1Trace.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.MachineJobShop
import
MachineJobShop
from
simulation.QueueJobShop
import
QueueJobShop
from
simulation.ExitJobShop
import
ExitJobShop
from
simulation.Job
import
Job
from
simulation.Globals
import
G
import
simulation.ExcelHandler
import
simulation.Globals
as
Globals
from
dream.
simulation.MachineJobShop
import
MachineJobShop
from
dream.
simulation.QueueJobShop
import
QueueJobShop
from
dream.
simulation.ExitJobShop
import
ExitJobShop
from
dream.
simulation.Job
import
Job
from
dream.
simulation.Globals
import
G
import
dream.
simulation.ExcelHandler
import
dream.
simulation.Globals
as
Globals
G
.
trace
=
"Yes"
...
...
@@ -60,5 +60,5 @@ for record in J.schedule:
print
J
.
name
,
"got into"
,
name
,
"at"
,
record
[
1
]
simulation
.
ExcelHandler
.
outputTrace
(
'TRACE'
)
dream
.
simulation
.
ExcelHandler
.
outputTrace
(
'TRACE'
)
dream/simulation/Examples/JobShop2EDD.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.MachineJobShop
import
MachineJobShop
from
simulation.QueueJobShop
import
QueueJobShop
from
simulation.ExitJobShop
import
ExitJobShop
from
simulation.Job
import
Job
from
simulation.Globals
import
G
import
simulation.Globals
as
Globals
from
dream.
simulation.MachineJobShop
import
MachineJobShop
from
dream.
simulation.QueueJobShop
import
QueueJobShop
from
dream.
simulation.ExitJobShop
import
ExitJobShop
from
dream.
simulation.Job
import
Job
from
dream.
simulation.Globals
import
G
import
dream.
simulation.Globals
as
Globals
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"EDD"
)
...
...
dream/simulation/Examples/JobShop2MC.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.MachineJobShop
import
MachineJobShop
from
simulation.QueueJobShop
import
QueueJobShop
from
simulation.ExitJobShop
import
ExitJobShop
from
simulation.Job
import
Job
from
simulation.Globals
import
G
import
simulation.Globals
as
Globals
from
dream.
simulation.MachineJobShop
import
MachineJobShop
from
dream.
simulation.QueueJobShop
import
QueueJobShop
from
dream.
simulation.ExitJobShop
import
ExitJobShop
from
dream.
simulation.Job
import
Job
from
dream.
simulation.Globals
import
G
import
dream.
simulation.Globals
as
Globals
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"MC-Priority-EDD"
)
...
...
dream/simulation/Examples/JobShop2Priority.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.MachineJobShop
import
MachineJobShop
from
simulation.QueueJobShop
import
QueueJobShop
from
simulation.ExitJobShop
import
ExitJobShop
from
simulation.Job
import
Job
from
simulation.Globals
import
G
import
simulation.Globals
as
Globals
from
dream.
simulation.MachineJobShop
import
MachineJobShop
from
dream.
simulation.QueueJobShop
import
QueueJobShop
from
dream.
simulation.ExitJobShop
import
ExitJobShop
from
dream.
simulation.Job
import
Job
from
dream.
simulation.Globals
import
G
import
dream.
simulation.Globals
as
Globals
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"Priority"
)
...
...
dream/simulation/Examples/JobShop2RPC.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.MachineJobShop
import
MachineJobShop
from
simulation.QueueJobShop
import
QueueJobShop
from
simulation.ExitJobShop
import
ExitJobShop
from
simulation.Job
import
Job
from
simulation.Globals
import
G
import
simulation.Globals
as
Globals
from
dream.
simulation.MachineJobShop
import
MachineJobShop
from
dream.
simulation.QueueJobShop
import
QueueJobShop
from
dream.
simulation.ExitJobShop
import
ExitJobShop
from
dream.
simulation.Job
import
Job
from
dream.
simulation.Globals
import
G
import
dream.
simulation.Globals
as
Globals
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"LPT"
)
...
...
dream/simulation/Examples/ParallelServers1.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
from
simulation.Machine
import
Machine
from
simulation.Queue
import
Queue
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Globals
import
G
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Queue
import
Queue
from
dream.
simulation.Source
import
Source
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Part
import
Part
from
dream.
simulation.Globals
import
G
#define the objects of the model
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
...
...
dream/simulation/Examples/ParallelServers2.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
from
simulation.Machine
import
Machine
from
simulation.Queue
import
Queue
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Globals
import
G
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Queue
import
Queue
from
dream.
simulation.Source
import
Source
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Part
import
Part
from
dream.
simulation.Globals
import
G
#the custom queue
class
SelectiveQueue
(
Queue
):
...
...
dream/simulation/Examples/ParallelServers3.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
,
infinity
,
now
from
simulation.Machine
import
Machine
from
simulation.Queue
import
Queue
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Globals
import
G
from
dream.simulation.Machine
import
Machine
from
dream.simulation.Queue
import
Queue
from
dream.simulation.Source
import
Source
from
dream.simulation.Exit
import
Exit
from
dream.simulation.Part
import
Part
from
dream.simulation.Globals
import
G
import
dream.simulation.Globals
as
Globals
#the custom queue
class
SelectiveQueue
(
Queue
):
def
haveToDispose
(
self
,
callerObject
=
None
):
caller
=
callerObject
# if the caller is M1 then return true if there is an Entity to give
if
caller
.
id
==
'M1'
:
return
len
(
self
.
getActiveObjectQueue
())
>
0
self
.
M1
=
None
# else return true only if M1 cannot accept the Entity
if
caller
.
id
==
'M2'
:
for
object
in
G
.
ObjList
:
if
object
.
id
==
'M1'
:
self
.
M1
=
object
return
len
(
self
.
getActiveObjectQueue
())
>
0
and
(
not
(
self
.
M1
.
canAccept
()))
# find M1
M1
=
Globals
.
findObjectById
(
'M1'
)
# global method to obtain an object from the id
return
len
(
self
.
getActiveObjectQueue
())
>
0
and
(
not
(
M1
.
canAccept
()))
#the custom machine
class
Milling
(
Machine
):
def
getEntity
(
self
):
Machine
.
getEntity
(
self
)
#call the parent method to get the entity
part
=
self
.
getActiveObjectQueue
()[
0
]
#retrieve the obtained part
part
.
machineId
=
self
.
id
#create an attribute to the obtained part and give it the value of the object's id
activeEntity
=
Machine
.
getEntity
(
self
)
#call the parent method to get the entity
part
=
self
.
getActiveObjectQueue
()[
0
]
#retrieve the obtained part
part
.
machineId
=
self
.
id
#create an attribute to the obtained part and give it the value of the object's id
return
activeEntity
#return the entity obtained
#the custom exit
class
CountingExit
(
Exit
):
def
getEntity
(
self
):
part
=
self
.
getGiverObjectQueue
()[
0
]
#find the part to be obtained
Exit
.
getEntity
(
self
)
#call the parent method to get the entity
activeEntity
=
Exit
.
getEntity
(
self
)
#call the parent method to get the entity
#check the attribute and update the counters accordingly
if
part
.
machineId
==
'M1'
:
if
activeEntity
.
machineId
==
'M1'
:
G
.
NumM1
+=
1
elif
part
.
machineId
==
'M2'
:
elif
activeEntity
.
machineId
==
'M2'
:
G
.
NumM2
+=
1
return
activeEntity
#return the entity obtained
#define the objects of the model
S
=
Source
(
'S'
,
'Source'
,
mean
=
0.5
,
item
=
Part
)
...
...
dream/simulation/Examples/SerialBatchProcessing.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Globals
import
G
from
simulation.Machine
import
Machine
from
simulation.Exit
import
Exit
from
simulation.Queue
import
Queue
from
dream.
simulation.Globals
import
G
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Queue
import
Queue
from
simulation.Batch
import
Batch
from
simulation.BatchDecomposition
import
BatchDecomposition
from
simulation.BatchReassembly
import
BatchReassembly
from
simulation.BatchSource
import
BatchSource
from
dream.
simulation.Batch
import
Batch
from
dream.
simulation.BatchDecomposition
import
BatchDecomposition
from
dream.
simulation.BatchReassembly
import
BatchReassembly
from
dream.
simulation.BatchSource
import
BatchSource
# define the objects of the model
S
=
BatchSource
(
'S'
,
'Source'
,
mean
=
1.5
,
item
=
Batch
,
batchNumberOfUnits
=
100
)
...
...
dream/simulation/Examples/SingleServer.py
View file @
f0eae342
from
simulation.imports
import
Machine
,
Source
,
Exit
,
Part
,
G
,
simulate
,
activate
,
initialize
from
dream.
simulation.imports
import
Machine
,
Source
,
Exit
,
Part
,
G
,
simulate
,
activate
,
initialize
#define the objects of the model
S
=
Source
(
'S1'
,
'Source'
,
distribution
=
'Fixed'
,
mean
=
0.5
,
item
=
Part
)
...
...
dream/simulation/Examples/TwoServers.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Machine
import
Machine
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Repairman
import
Repairman
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
simulation.Failure
import
Failure
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Source
import
Source
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Part
import
Part
from
dream.
simulation.Repairman
import
Repairman
from
dream.
simulation.Queue
import
Queue
from
dream.
simulation.Globals
import
G
from
dream.
simulation.Failure
import
Failure
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
...
...
dream/simulation/Examples/TwoServersPlots.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Machine
import
Machine
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Repairman
import
Repairman
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
simulation.Failure
import
Failure
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Source
import
Source
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Part
import
Part
from
dream.
simulation.Repairman
import
Repairman
from
dream.
simulation.Queue
import
Queue
from
dream.
simulation.Globals
import
G
from
dream.
simulation.Failure
import
Failure
#import Graphs
from
outputanalysis.Plots
import
Graphs
...
...
dream/simulation/Examples/TwoServersStochastic.py
View file @
f0eae342
from
SimPy.Simulation
import
simulate
,
activate
,
initialize
from
simulation.Machine
import
Machine
from
simulation.Source
import
Source
from
simulation.Exit
import
Exit
from
simulation.Part
import
Part
from
simulation.Repairman
import
Repairman
from
simulation.Queue
import
Queue
from
simulation.Globals
import
G
from
simulation.Failure
import
Failure
from
dream.
simulation.Machine
import
Machine
from
dream.
simulation.Source
import
Source
from
dream.
simulation.Exit
import
Exit
from
dream.
simulation.Part
import
Part
from
dream.
simulation.Repairman
import
Repairman
from
dream.
simulation.Queue
import
Queue
from
dream.
simulation.Globals
import
G
from
dream.
simulation.Failure
import
Failure
#define the objects of the model
R
=
Repairman
(
'R1'
,
'Bob'
)
...
...
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