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
1ed31a23
Commit
1ed31a23
authored
Sep 29, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
checkForManualOperation introduced to assemble() to update the multOperationTypeList
parent
128e508b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
20 deletions
+9
-20
dream/simulation/Globals.py
dream/simulation/Globals.py
+0
-8
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+0
-4
dream/simulation/MouldAssembly.py
dream/simulation/MouldAssembly.py
+9
-8
No files found.
dream/simulation/Globals.py
View file @
1ed31a23
...
...
@@ -54,11 +54,9 @@ class G:
maxSimTime
=
0
#the total simulation time
# flag for printing in console
# -----------------------------------------------------------------------
console
=
""
# data for the trace output in excel
# -----------------------------------------------------------------------
trace
=
""
#this is written from input. If it is "Yes" then you write to trace, else we do not
traceIndex
=
0
#index that shows in what row we are
sheetIndex
=
1
#index that shows in what sheet we are
...
...
@@ -67,26 +65,21 @@ class G:
# variables for excel output
# -----------------------------------------------------------------------
outputIndex
=
0
#index that shows in what row we are
sheetIndex
=
1
#index that shows in what sheet we are
outputFile
=
xlwt
.
Workbook
()
#create excel file
outputSheet
=
outputFile
.
add_sheet
(
'sheet '
+
str
(
sheetIndex
),
cell_overwrite_ok
=
True
)
#create excel sheet
#variables for json output
# -----------------------------------------------------------------------
outputJSON
=
{}
outputJSONFile
=
None
numberOfEntities
=
0
#object that routes the operators in the model
#------------------------------------------------------------------------
Router
=
None
# -----------------------------------------------------------------------
# define the lists of each object type
# -----------------------------------------------------------------------
SourceList
=
[]
MachineList
=
[]
ExitList
=
[]
...
...
@@ -205,7 +198,6 @@ class SetWipTypeError(Exception):
# =======================================================================
# method to set-up the entities in the current stations
# as Work In Progress
# -----------------------------------------
# in this case the current station must be defined!
# otherwise there is no current station but a list of possible stations
# although the entity cannot be in more than one stations
...
...
dream/simulation/LineGenerationJSON.py
View file @
1ed31a23
...
...
@@ -218,10 +218,8 @@ def createObjectResourcesAndCoreObjects():
# get the successorList for the 'Frames'
coreObject
.
nextFrameIds
=
getSuccessorList
(
element
[
'id'
],
lambda
source
,
destination
,
edge_data
:
edge_data
.
get
(
'entity'
)
==
'Frame'
)
# -----------------------------------------------------------------------
# loop through all the core objects
# to read predecessors
# -----------------------------------------------------------------------
for
element
in
G
.
ObjList
:
#loop through all the nextIds of the object
for
nextId
in
element
.
nextIds
:
...
...
@@ -244,12 +242,10 @@ def createObjectInterruptions():
#Read the json data
nodes
=
json_data
[
'nodes'
]
# read from the dictionary the dicts with key 'nodes'
# -----------------------------------------------------------------------
# loop through all the nodes to
# search for Event Generator and create them
# this is put last, since the EventGenerator
# may take other objects as argument
# -----------------------------------------------------------------------
for
(
element_id
,
element
)
in
nodes
.
iteritems
():
# use an iterator to go through all the nodes
# the key is the element_id and the second is the
# element itself
...
...
dream/simulation/MouldAssembly.py
View file @
1ed31a23
...
...
@@ -202,6 +202,10 @@ class MouldAssembly(MachineJobShop):
break
# create the mould
self
.
createMould
(
self
.
mouldToBeCreated
)
# check if there is a need for manual processing
self
.
checkForManualOperation
(
type
=
'Processing'
,
entity
=
self
.
mouldToBeCreated
)
# check if there is a need for manual processing
self
.
checkForManualOperation
(
type
=
'Setup'
,
entity
=
self
.
mouldToBeCreated
)
# set the created mould as WIP
import
Globals
Globals
.
setWIP
([
self
.
mouldToBeCreated
])
...
...
@@ -225,7 +229,6 @@ class MouldAssembly(MachineJobShop):
id
=
component
.
get
(
'id'
,
'not found'
)
name
=
component
.
get
(
'name'
,
'not found'
)
try
:
# dummy variable that holds the routes of the jobs the route from the JSON file is a sequence of dictionaries
JSONRoute
=
component
.
get
(
'route'
,
[])
# variable that holds the argument used in the Job initiation hold None for each entry in the 'route' list
...
...
@@ -234,27 +237,25 @@ class MouldAssembly(MachineJobShop):
firstStep
=
route
.
pop
(
0
)
assert
(
self
.
id
in
firstStep
.
get
(
'stationIdsList'
,[])),
\
'the assembler must be in the mould-to-be-created route
\
'
initial step'
# normal processing operation
processingTime
=
firstStep
[
'processingTime'
]
processingTime
=
self
.
getOperationTime
(
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
procTime
=
self
.
rng
.
generateNumber
()
# update the activeObject's processing time according to the readings in the mould's route
processDistType
=
processingTime
.
get
(
'distributionType'
,
'not found'
)
procTime
=
float
(
processingTime
.
get
(
'mean'
,
0
))
processOpType
=
processingTime
.
get
(
'operationType'
,
'not found'
)
# can be manual/automatic
processingTime
=
self
.
getOperationTime
(
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
procTime
=
self
.
rng
.
generateNumber
()
# setup operation
setupTime
=
firstStep
.
get
(
'setupTime'
,
None
)
if
setupTime
:
setupTime
=
self
.
getOperationTime
(
setupTime
)
self
.
stpRng
=
RandomNumberGenerator
(
self
,
**
setupTime
)
# update the activeObject's processing time according to the readings in the mould's route
setupDistType
=
setupTime
.
get
(
'distributionType'
,
'not found'
)
setTime
=
float
(
setupTime
.
get
(
'mean'
,
0
))
setupOpType
=
setupTime
.
get
(
'operationType'
,
'not found'
)
# can be manual/automatic
setupTime
=
self
.
getOperationTime
(
setupTime
)
self
.
stpRng
=
RandomNumberGenerator
(
self
,
**
setupTime
)
# update the first step of the route with the activeObjects id as sole element of the stationIdsList
route
.
insert
(
0
,
{
'stationIdsList'
:[
str
(
self
.
id
)],
'processingTime'
:{
'distributionType'
:
str
(
processDistType
),
\
'mean'
:
str
(
procTime
),
\
...
...
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