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
a3cf7124
Commit
a3cf7124
authored
Sep 04, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
getProcessing/load/setupTime simplified - one method instead getOparationTime
parent
97c04005
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
66 deletions
+24
-66
dream/simulation/Machine.py
dream/simulation/Machine.py
+12
-34
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+12
-32
No files found.
dream/simulation/Machine.py
View file @
a3cf7124
...
...
@@ -59,11 +59,11 @@ class Machine(CoreObject):
CoreObject
.
__init__
(
self
,
id
,
name
)
from
Globals
import
G
processingTime
=
self
.
get
ProcessingTime
(
processingT
ime
=
processingTime
)
processingTime
=
self
.
get
OperationTime
(
t
ime
=
processingTime
)
setupTime
=
self
.
get
SetupTime
(
setupT
ime
=
setupTime
)
setupTime
=
self
.
get
OperationTime
(
t
ime
=
setupTime
)
loadTime
=
self
.
get
LoadTime
(
loadT
ime
=
loadTime
)
loadTime
=
self
.
get
OperationTime
(
t
ime
=
loadTime
)
# holds the capacity of the machine
self
.
capacity
=
capacity
...
...
@@ -191,38 +191,16 @@ class Machine(CoreObject):
self
.
processOperatorUnavailable
=
self
.
env
.
event
()
@
staticmethod
def
get
ProcessingTime
(
processingT
ime
):
'''returns the
processingTime
dictionary updated'''
if
not
processingT
ime
:
processingT
ime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
}
if
processingT
ime
[
'distributionType'
]
==
'Normal'
and
\
processingT
ime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingT
ime
[
'stdev'
])
return
processingT
ime
def
get
OperationTime
(
t
ime
):
'''returns the dictionary updated'''
if
not
t
ime
:
t
ime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
}
if
t
ime
[
'distributionType'
]
==
'Normal'
and
\
t
ime
.
get
(
'max'
,
None
)
is
None
:
time
[
'max'
]
=
float
(
time
[
'mean'
])
+
5
*
float
(
t
ime
[
'stdev'
])
return
t
ime
@
staticmethod
def
getSetupTime
(
setupTime
):
'''returns the setupTime dictionary updated'''
if
not
setupTime
:
setupTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
}
if
setupTime
[
'distributionType'
]
==
'Normal'
and
\
setupTime
.
get
(
'max'
,
None
)
is
None
:
setupTime
[
'max'
]
=
float
(
setupTime
[
'mean'
])
+
5
*
float
(
setupTime
[
'stdev'
])
return
setupTime
@
staticmethod
def
getLoadTime
(
loadTime
):
'''returns the loadTime dictionary updated'''
if
not
loadTime
:
loadTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
}
if
loadTime
[
'distributionType'
]
==
'Normal'
and
\
loadTime
.
get
(
'max'
,
None
)
is
None
:
loadTime
[
'max'
]
=
float
(
loadTime
[
'mean'
])
+
5
*
float
(
loadTime
[
'stdev'
])
return
loadTime
#===========================================================================
# create an operatorPool if needed
#===========================================================================
...
...
dream/simulation/MachineJobShop.py
View file @
a3cf7124
...
...
@@ -33,35 +33,15 @@ from RandomNumberGenerator import RandomNumberGenerator
# ===========================================================================
class
MachineJobShop
(
Machine
):
@
staticmethod
def
get
ProcessingTime
(
processingT
ime
):
def
get
OperationTime
(
t
ime
):
'''returns the processingTime dictionary updated'''
if
not
processingT
ime
:
processingT
ime
=
{
'distributionType'
:
'Fixed'
,
if
not
t
ime
:
t
ime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
return
processingTime
@
staticmethod
def
getSetupTime
(
setupTime
):
'''returns the setupTime dictionary updated'''
if
not
setupTime
:
setupTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
}
if
setupTime
[
'distributionType'
]
==
'Normal'
and
\
setupTime
.
get
(
'max'
,
None
)
is
None
:
setupTime
[
'max'
]
=
float
(
setupTime
[
'mean'
])
+
5
*
float
(
setupTime
[
'stdev'
])
return
setupTime
@
staticmethod
def
getLoadTime
(
loadTime
):
'''returns the loadTime dictionary updated'''
if
not
loadTime
:
loadTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
}
if
loadTime
[
'distributionType'
]
==
'Normal'
and
\
loadTime
.
get
(
'max'
,
None
)
is
None
:
loadTime
[
'max'
]
=
float
(
loadTime
[
'mean'
])
+
5
*
float
(
loadTime
[
'stdev'
])
return
loadTime
if
time
[
'distributionType'
]
==
'Normal'
and
\
time
.
get
(
'max'
,
None
)
is
None
:
time
[
'max'
]
=
float
(
time
[
'mean'
])
+
5
*
float
(
time
[
'stdev'
])
return
time
# =======================================================================
# set all the objects in previous and next
...
...
@@ -145,12 +125,12 @@ class MachineJobShop(Machine):
# read the processing/setup/load times from the corresponding remainingRoute entry
processingTime
=
activeEntity
.
remainingRoute
[
0
].
get
(
'processingTime'
,{})
processingTime
=
self
.
get
Processing
Time
(
processingTime
)
processingTime
=
self
.
get
Operation
Time
(
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
procTime
=
self
.
rng
.
generateNumber
()
setupTime
=
activeEntity
.
remainingRoute
[
0
].
get
(
'setupTime'
,{})
setupTime
=
self
.
get
Setup
Time
(
setupTime
)
setupTime
=
self
.
get
Operation
Time
(
setupTime
)
self
.
stpRng
=
RandomNumberGenerator
(
self
,
**
setupTime
)
removedStep
=
activeEntity
.
remainingRoute
.
pop
(
0
)
#remove data from the remaining route of the entity
...
...
@@ -189,12 +169,12 @@ class MachineJobShop(Machine):
# read the processing/setup/load times from the first entry of the full route
activeEntity
=
self
.
getActiveObjectQueue
()[
0
]
processingTime
=
activeEntity
.
route
[
0
].
get
(
'processingTime'
,{})
processingTime
=
self
.
get
Processing
Time
(
processingTime
)
processingTime
=
self
.
get
Operation
Time
(
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
procTime
=
self
.
rng
.
generateNumber
()
setupTime
=
activeEntity
.
route
[
0
].
get
(
'setupTime'
,{})
setupTime
=
self
.
get
Setup
Time
(
setupTime
)
setupTime
=
self
.
get
Operation
Time
(
setupTime
)
self
.
stpRng
=
RandomNumberGenerator
(
self
,
**
setupTime
)
return
self
.
procTime
#this is the processing time for this unique entity
...
...
@@ -320,7 +300,7 @@ class MachineJobShop(Machine):
thecaller
.
sortEntities
()
activeEntity
=
thecaller
.
Res
.
users
[
0
]
loadTime
=
activeEntity
.
remainingRoute
[
0
].
get
(
'loadTime'
,{})
loadTime
=
self
.
get
Load
Time
(
loadTime
)
loadTime
=
self
.
get
Operation
Time
(
loadTime
)
self
.
loadRng
=
RandomNumberGenerator
(
self
,
**
loadTime
)
# =======================================================================
...
...
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