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
5b3282e1
Commit
5b3282e1
authored
Oct 01, 2013
by
Georgios Dagkakis
Committed by
Sebastien Robin
Nov 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Job object added and some cleanup in Part and Frame.
parent
e277bbcf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
199 additions
and
32 deletions
+199
-32
dream/simulation/Entity.py
dream/simulation/Entity.py
+1
-1
dream/simulation/Frame.py
dream/simulation/Frame.py
+2
-5
dream/simulation/JSONInputs/Jobshop1.json
dream/simulation/JSONInputs/Jobshop1.json
+127
-0
dream/simulation/Job.py
dream/simulation/Job.py
+48
-0
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+18
-13
dream/simulation/Part.py
dream/simulation/Part.py
+3
-13
No files found.
dream/simulation/Entity.py
View file @
5b3282e1
...
...
@@ -27,9 +27,9 @@ Class that acts as an abstract. It should have no instances. All the Entities sh
#The entity object
class
Entity
(
object
):
type
=
"Entity"
def
__init__
(
self
,
name
):
self
.
type
=
"Entity"
self
.
name
=
name
self
.
currentStop
=
None
#contains the current object that the material is in
self
.
creationTime
=
0
...
...
dream/simulation/Frame.py
View file @
5b3282e1
...
...
@@ -36,11 +36,8 @@ class Frame(Entity):
numOfParts
=
4
#the number of parts that the frame can take
def
__init__
(
self
,
name
):
self
.
type
=
"Frame"
self
.
name
=
name
self
.
currentStop
=
None
#contains the current object that the material is in
self
.
creationTime
=
0
self
.
startTime
=
0
#holds the startTime for the lifespan
Entity
.
__init__
(
self
,
name
)
self
.
Res
=
Resource
(
self
.
numOfParts
)
#dimension data
self
.
width
=
2.0
...
...
dream/simulation/JSONInputs/Jobshop1.json
0 → 100644
View file @
5b3282e1
{
"_class"
:
"Dream.Simulation"
,
"general"
:
{
"_class"
:
"Dream.Configuration"
,
"numberOfReplications"
:
"1"
,
"maxSimTime"
:
"1000"
,
"trace"
:
"Yes"
,
"confidenceLevel"
:
"0.95"
},
"elementList"
:
[
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M1"
,
"name"
:
"Machine1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0.25"
},
"failures"
:
{
"failureDistribution"
:
"No"
,
"MTTF"
:
"60"
,
"MTTR"
:
"5"
},
"successorList"
:
[]
},
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M2"
,
"name"
:
"Machine2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1.5"
},
"failures"
:
{
"failureDistribution"
:
"No"
,
"MTTF"
:
"40"
,
"MTTR"
:
"10"
},
"successorList"
:
[]
},
{
"_class"
:
"Dream.Machine"
,
"id"
:
"M3"
,
"name"
:
"Machine3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1.5"
},
"failures"
:
{
"failureDistribution"
:
"No"
,
"MTTF"
:
"40"
,
"MTTR"
:
"10"
},
"successorList"
:
[]
},
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q1"
,
"name"
:
"Queue1"
,
"isDummy"
:
"0"
,
"capacity"
:
"1000"
,
"successorList"
:
[
"M1"
]
},
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q2"
,
"name"
:
"Queue2"
,
"isDummy"
:
"0"
,
"capacity"
:
"1000"
,
"successorList"
:
[
"M2"
]
},
{
"_class"
:
"Dream.Queue"
,
"id"
:
"Q3"
,
"name"
:
"Queue3"
,
"isDummy"
:
"0"
,
"capacity"
:
"1000"
,
"successorList"
:
[
"M3"
]
},
{
"_class"
:
"Dream.Exit"
,
"id"
:
"E1"
,
"name"
:
"Exit"
},
{
"_class"
:
"Dream.Job"
,
"id"
:
"J1"
,
"name"
:
"Job1"
,
"route"
:
[
{
"stationId"
:
"Q1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"1"
}
},
{
"stationId"
:
"Q3"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"3"
}
},
{
"stationId"
:
"Q2"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"2"
}
},
{
"stationId"
:
"E1"
,
"processingTime"
:
{
"distributionType"
:
"Fixed"
,
"mean"
:
"0"
}
}
]
}
]
}
\ No newline at end of file
dream/simulation/Job.py
0 → 100644
View file @
5b3282e1
# ===========================================================================
# Copyright 2013 University of Limerick
#
# This file is part of DREAM.
#
# DREAM is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# DREAM is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with DREAM. If not, see <http://www.gnu.org/licenses/>.
# ===========================================================================
'''
Created on 01 Oct 2013
@author: George
'''
'''
Job is an Entity that implements the logic of a job shop. Job carries attributes for its route
in the system and also in the processing times at each station
'''
from
Globals
import
G
from
Entity
import
Entity
#The part object
class
Job
(
Entity
):
type
=
"Job"
def
__init__
(
self
,
name
,
id
,
route
):
Entity
.
__init__
(
self
,
name
)
self
.
id
=
id
self
.
fullRoute
=
route
#the route that the job follows, also contains the processing times in each station
self
.
remainingRoute
=
route
#the remaining route. in the beginning this should be the same as the full route
self
.
currentStop
=
route
[
0
][
0
]
#the starting stop should be the first in the route
\ No newline at end of file
dream/simulation/LineGenerationJSON.py
View file @
5b3282e1
...
...
@@ -237,6 +237,23 @@ def createObjects():
G
.
ObjList
.
append
(
C
)
G
.
ConveyerList
.
append
(
C
)
elif
objClass
==
'Dream.Job'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
JSONRoute
=
element
.
get
(
'route'
,
[])
route
=
[]
for
routeElement
in
JSONRoute
:
print
routeElement
nextId
=
routeElement
.
get
(
'stationId'
,
'not found'
)
processingTime
=
routeElement
.
get
(
'processingTime'
,
'not found'
)
distributionType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
mean
=
int
(
processingTime
.
get
(
'mean'
,
'not found'
))
print
nextId
,
distributionType
,
mean
route
.
append
([
nextId
,
mean
])
print
route
[
0
][
0
]
#loop through all the core objects
#to read predecessors
for
element
in
G
.
ObjList
:
...
...
@@ -384,19 +401,7 @@ def main(argv=[], input_data=None):
outputJSONString
=
json
.
dumps
(
G
.
outputJSON
,
indent
=
True
)
G
.
outputJSONFile
.
write
(
outputJSONString
)
'''
#output data to excel for every object in the topology
for core_object in G.ObjList:
core_object.outputResultsXL(G.maxSimTime)
#output data to excel for every resource in the topology
for model_resource in G.RepairmanList:
model_resource.outputResultsXL(G.maxSimTime)
G.outputFile.save("output.xls")
'''
logger
.
info
(
"execution time="
+
str
(
time
.
time
()
-
start
))
if
input_data
:
return
outputJSONString
...
...
dream/simulation/Part.py
View file @
5b3282e1
...
...
@@ -27,25 +27,15 @@ models a part entity that flows through the system
'''
from
SimPy.Simulation
import
*
from
Globals
import
G
from
Entity
import
Entity
#The
entity
object
#The
part
object
class
Part
(
Entity
):
type
=
"Part"
def
__init__
(
self
,
name
):
self
.
name
=
name
self
.
currentStop
=
None
#contains the current object that the material is in
self
.
creationTime
=
0
self
.
startTime
=
0
#holds the startTime for the lifespan
#dimension data
self
.
width
=
1.0
self
.
height
=
1.0
self
.
length
=
1.0
def
__del__
(
self
):
pass
Entity
.
__init__
(
self
,
name
)
#print self.name, now()
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