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
26763833
Commit
26763833
authored
Nov 28, 2013
by
Georgios Dagkakis
Committed by
Jérome Perrin
Dec 02, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JobShop Examples updated so that they follow the new notation. Changes applied in the documentation
parent
53b5caf5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
60 deletions
+43
-60
dream/simulation/Examples/JobShop1.py
dream/simulation/Examples/JobShop1.py
+1
-1
dream/simulation/Examples/JobShop1Trace.py
dream/simulation/Examples/JobShop1Trace.py
+14
-14
dream/simulation/Examples/JobShop2EDD.py
dream/simulation/Examples/JobShop2EDD.py
+7
-11
dream/simulation/Examples/JobShop2MC.py
dream/simulation/Examples/JobShop2MC.py
+7
-12
dream/simulation/Examples/JobShop2Priority.py
dream/simulation/Examples/JobShop2Priority.py
+7
-10
dream/simulation/Examples/JobShop2RPC.py
dream/simulation/Examples/JobShop2RPC.py
+7
-12
No files found.
dream/simulation/Examples/JobShop1.py
View file @
26763833
...
...
@@ -20,7 +20,7 @@ G.ObjList=[M1,M2,M3,Q1,Q2,Q3,E] #add all the objects in G.ObjList so that they
#define the Jobs
J
=
Job
(
'J1'
,
'Job1'
,
route
=
[[
'Q1'
,
0
],[
'M1'
,
1
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'Q2'
,
0
],[
'M2'
,
2
],[
'E'
,
0
]])
G
.
EntityList
=
[
J
]
G
.
EntityList
=
[
J
]
#a list to hold all the jobs
initialize
()
#initialize the simulation (SimPy method)
...
...
dream/simulation/Examples/JobShop1Trace.py
View file @
26763833
...
...
@@ -8,6 +8,15 @@ import simulation.ExcelHandler
G
.
trace
=
"Yes"
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
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
)
Q2
=
QueueJobShop
(
'Q2'
,
'Queue2'
,
capacity
=
infinity
)
...
...
@@ -19,16 +28,9 @@ E=ExitJobShop('E','Exit')
G
.
ObjList
=
[
M1
,
M2
,
M3
,
Q1
,
Q2
,
Q3
,
E
]
#add all the objects in G.ObjList so that they can be easier accessed later
#define predecessors and successors for the objects
Q1
.
defineRouting
(
successorList
=
[
M1
])
Q2
.
defineRouting
(
successorList
=
[
M2
])
Q3
.
defineRouting
(
successorList
=
[
M3
])
M1
.
defineRouting
(
predecessorList
=
[
Q1
])
M2
.
defineRouting
(
predecessorList
=
[
Q2
])
M3
.
defineRouting
(
predecessorList
=
[
Q3
])
#define the Jobs
J
=
Job
(
'J1'
,
'Job1'
,
route
=
[[
'Q1'
,
1
],[
'Q3'
,
3
],[
'Q2'
,
2
],[
'E'
,
0
]])
J
=
Job
(
'J1'
,
'Job1'
,
route
=
[[
'Q1'
,
0
],[
'M1'
,
1
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'Q2'
,
0
],[
'M2'
,
2
],[
'E'
,
0
]])
G
.
EntityList
=
[
J
]
#a list to hold all the jobs
initialize
()
#initialize the simulation (SimPy method)
...
...
@@ -38,10 +40,7 @@ for object in G.ObjList:
J
.
initialize
()
#set the WIP
Q1
.
getActiveObjectQueue
().
append
(
J
)
#place the Job at 'Q1'
J
.
remainingRoute
[
0
][
0
]
=
''
#remove data from the remaining route since it is already added in Q1.
#this is to make sure that the Job will not get again into Queue1 while it waits in Queue1
J
.
schedule
.
append
([
'Q1'
,
now
()])
#add the data in the schedule that the Job entered Q1 at time=0
Globals
.
setWIP
(
G
.
EntityList
)
#activate all the objects
for
object
in
G
.
ObjList
:
...
...
@@ -56,9 +55,10 @@ for record in J.schedule:
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
name
=
None
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
record
[
0
]:
if
obj
is
record
[
0
]:
name
=
obj
.
objName
print
J
.
name
,
"got into"
,
name
,
"at"
,
record
[
1
]
simulation
.
ExcelHandler
.
outputTrace
(
'TRACE'
)
dream/simulation/Examples/JobShop2EDD.py
View file @
26763833
...
...
@@ -4,6 +4,7 @@ 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
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"EDD"
)
...
...
@@ -25,11 +26,10 @@ M2.defineRouting(predecessorList=[Q2])
M3
.
defineRouting
(
predecessorList
=
[
Q3
])
#define the Jobs
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
1
],[
'Q3'
,
3
],[
'Q2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
2
],[
'Q2'
,
4
],[
'Q3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
10
],[
'Q3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
0
],[
'M1'
,
1
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'Q2'
,
0
],[
'M2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
0
],[
'M1'
,
2
],[
'Q2'
,
0
],[
'M2'
,
4
],[
'Q3'
,
0
],[
'M3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
0
],[
'M1'
,
10
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
#a list to hold all the jobs
G
.
maxSimTime
=
1440.0
#set G.maxSimTime 1440.0 minutes (1 day)
...
...
@@ -44,10 +44,7 @@ for job in G.JobList:
job
.
initialize
()
#set the WIP for all the jobs
for
job
in
G
.
JobList
:
Q1
.
getActiveObjectQueue
().
append
(
job
)
job
.
remainingRoute
[
0
][
0
]
=
''
#remove data from the remaining route.
job
.
schedule
.
append
([
'Q1'
,
now
()])
#add the data in the schedule that the Job entered Q1 at time=0
Globals
.
setWIP
(
G
.
JobList
)
#activate all the objects
for
object
in
G
.
ObjList
:
...
...
@@ -62,8 +59,7 @@ for job in G.JobList:
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
name
=
None
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
record
[
0
]:
if
obj
is
record
[
0
]:
name
=
obj
.
objName
print
job
.
name
,
"got into"
,
name
,
"at"
,
record
[
1
]
print
"-"
*
30
dream/simulation/Examples/JobShop2MC.py
View file @
26763833
...
...
@@ -4,6 +4,7 @@ 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
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"MC-Priority-EDD"
)
...
...
@@ -25,11 +26,10 @@ M2.defineRouting(predecessorList=[Q2])
M3
.
defineRouting
(
predecessorList
=
[
Q3
])
#define the Jobs
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
1
],[
'Q3'
,
3
],[
'Q2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
2
],[
'Q2'
,
4
],[
'Q3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
10
],[
'Q3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
0
],[
'M1'
,
1
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'Q2'
,
0
],[
'M2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
0
],[
'M1'
,
2
],[
'Q2'
,
0
],[
'M2'
,
4
],[
'Q3'
,
0
],[
'M3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
0
],[
'M1'
,
10
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
#a list to hold all the jobs
G
.
maxSimTime
=
1440.0
#set G.maxSimTime 1440.0 minutes (1 day)
...
...
@@ -44,10 +44,7 @@ for job in G.JobList:
job
.
initialize
()
#set the WIP for all the jobs
for
job
in
G
.
JobList
:
Q1
.
getActiveObjectQueue
().
append
(
job
)
job
.
remainingRoute
[
0
][
0
]
=
''
#remove data from the remaining route.
job
.
schedule
.
append
([
'Q1'
,
now
()])
#add the data in the schedule that the Job entered Q1 at time=0
Globals
.
setWIP
(
G
.
JobList
)
#activate all the objects
for
object
in
G
.
ObjList
:
...
...
@@ -62,9 +59,7 @@ for job in G.JobList:
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
name
=
None
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
record
[
0
]:
if
obj
is
record
[
0
]:
name
=
obj
.
objName
print
job
.
name
,
"got into"
,
name
,
"at"
,
record
[
1
]
print
"-"
*
30
dream/simulation/Examples/JobShop2Priority.py
View file @
26763833
...
...
@@ -4,6 +4,7 @@ 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
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"Priority"
)
...
...
@@ -25,11 +26,10 @@ M2.defineRouting(predecessorList=[Q2])
M3
.
defineRouting
(
predecessorList
=
[
Q3
])
#define the Jobs
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
1
],[
'Q3'
,
3
],[
'Q2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
2
],[
'Q2'
,
4
],[
'Q3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
10
],[
'Q3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
0
],[
'M1'
,
1
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'Q2'
,
0
],[
'M2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
0
],[
'M1'
,
2
],[
'Q2'
,
0
],[
'M2'
,
4
],[
'Q3'
,
0
],[
'M3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
0
],[
'M1'
,
10
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
#a list to hold all the jobs
G
.
maxSimTime
=
1440.0
#set G.maxSimTime 1440.0 minutes (1 day)
...
...
@@ -44,10 +44,7 @@ for job in G.JobList:
job
.
initialize
()
#set the WIP for all the jobs
for
job
in
G
.
JobList
:
Q1
.
getActiveObjectQueue
().
append
(
job
)
job
.
remainingRoute
[
0
][
0
]
=
''
#remove data from the remaining route.
job
.
schedule
.
append
([
'Q1'
,
now
()])
#add the data in the schedule that the Job entered Q1 at time=0
Globals
.
setWIP
(
G
.
JobList
)
#activate all the objects
for
object
in
G
.
ObjList
:
...
...
@@ -62,7 +59,7 @@ for job in G.JobList:
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
name
=
None
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
record
[
0
]:
if
obj
is
record
[
0
]:
name
=
obj
.
objName
print
job
.
name
,
"got into"
,
name
,
"at"
,
record
[
1
]
print
"-"
*
30
dream/simulation/Examples/JobShop2RPC.py
View file @
26763833
...
...
@@ -4,6 +4,7 @@ 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
#define the objects of the model
Q1
=
QueueJobShop
(
'Q1'
,
'Queue1'
,
capacity
=
infinity
,
schedulingRule
=
"RPC"
)
...
...
@@ -25,11 +26,10 @@ M2.defineRouting(predecessorList=[Q2])
M3
.
defineRouting
(
predecessorList
=
[
Q3
])
#define the Jobs
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
1
],[
'Q3'
,
3
],[
'Q2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
2
],[
'Q2'
,
4
],[
'Q3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
10
],[
'Q3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
J1
=
Job
(
'J1'
,
'Job1'
,[[
'Q1'
,
0
],[
'M1'
,
1
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'Q2'
,
0
],[
'M2'
,
2
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
100
)
J2
=
Job
(
'J2'
,
'Job2'
,[[
'Q1'
,
0
],[
'M1'
,
2
],[
'Q2'
,
0
],[
'M2'
,
4
],[
'Q3'
,
0
],[
'M3'
,
6
],[
'E'
,
0
]],
priority
=
1
,
dueDate
=
90
)
J3
=
Job
(
'J3'
,
'Job3'
,[[
'Q1'
,
0
],[
'M1'
,
10
],[
'Q3'
,
0
],[
'M3'
,
3
],[
'E'
,
0
]],
priority
=
0
,
dueDate
=
110
)
G
.
JobList
=
[
J1
,
J2
,
J3
]
#a list to hold all the jobs
G
.
maxSimTime
=
1440.0
#set G.maxSimTime 1440.0 minutes (1 day)
...
...
@@ -44,10 +44,7 @@ for job in G.JobList:
job
.
initialize
()
#set the WIP for all the jobs
for
job
in
G
.
JobList
:
Q1
.
getActiveObjectQueue
().
append
(
job
)
job
.
remainingRoute
[
0
][
0
]
=
''
#remove data from the remaining route.
job
.
schedule
.
append
([
'Q1'
,
now
()])
#add the data in the schedule that the Job entered Q1 at time=0
Globals
.
setWIP
(
G
.
JobList
)
#activate all the objects
for
object
in
G
.
ObjList
:
...
...
@@ -62,9 +59,7 @@ for job in G.JobList:
#schedule holds ids of objects. The following loop will identify the name of the CoreObject with the given id
name
=
None
for
obj
in
G
.
ObjList
:
if
obj
.
id
==
record
[
0
]:
if
obj
is
record
[
0
]:
name
=
obj
.
objName
print
job
.
name
,
"got into"
,
name
,
"at"
,
record
[
1
]
print
"-"
*
30
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