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
34210375
Commit
34210375
authored
Dec 22, 2014
by
Georgios Dagkakis
Committed by
Ioannis Papagiannopoulos
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
objects updated to read distributions newstyle
parent
7b9ab64a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
47 deletions
+32
-47
dream/simulation/Assembly.py
dream/simulation/Assembly.py
+15
-24
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+5
-6
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+5
-6
dream/simulation/BatchSource.py
dream/simulation/BatchSource.py
+2
-2
dream/simulation/Dismantle.py
dream/simulation/Dismantle.py
+5
-9
No files found.
dream/simulation/Assembly.py
View file @
34210375
...
...
@@ -55,23 +55,14 @@ class Assembly(CoreObject):
self
.
Working
=
[]
self
.
Blockage
=
[]
# if input is given in a dictionary
if
inputsDict
:
CoreObject
.
__init__
(
self
,
inputsDict
=
inputsDict
)
# else read the separate ones
else
:
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
'stdev'
:
0
,
'min'
:
0
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
processingTime
=
{
'Fixed'
:{
'mean'
:
0
}}
if
'Normal'
in
processingTime
.
keys
()
and
\
processingTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
processingTime
[
'Normal'
][
'max'
]
=
float
(
processingTime
[
'Normal'
][
'mean'
])
+
5
*
float
(
processingTime
[
'Normal'
][
'stdev'
])
CoreObject
.
__init__
(
self
,
id
,
name
)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
processingTime
)
# ============================== variable that is used for the loading of machines =============
self
.
exitAssignedToReceiver
=
False
# by default the objects are not blocked
...
...
dream/simulation/BatchDecomposition.py
View file @
34210375
...
...
@@ -50,18 +50,17 @@ class BatchDecomposition(CoreObject):
self
.
type
=
"BatchDecomposition"
#String that shows the type of object
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
processingTime
=
{
'Fixed'
:{
'mean'
:
0
}}
if
'Normal'
in
processingTime
.
keys
()
and
\
processingTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
processingTime
[
'Normal'
][
'max'
]
=
float
(
processingTime
[
'Normal'
][
'mean'
])
+
5
*
float
(
processingTime
[
'Normal'
][
'stdev'
])
# holds the capacity of the object
self
.
numberOfSubBatches
=
int
(
numberOfSubBatches
)
# sets the operator resource of the Machine
self
.
operator
=
operator
# Sets the attributes of the processing (and failure) time(s)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
processingTime
)
from
Globals
import
G
G
.
BatchDecompositionList
.
append
(
self
)
...
...
dream/simulation/BatchReassembly.py
View file @
34210375
...
...
@@ -49,18 +49,17 @@ class BatchReassembly(CoreObject):
CoreObject
.
__init__
(
self
,
id
,
name
)
self
.
type
=
"BatchRassembly"
#String that shows the type of object
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
processingTime
=
{
'Fixed'
:{
'mean'
:
0
}}
if
'Normal'
in
processingTime
.
keys
()
and
\
processingTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
processingTime
[
'Normal'
][
'max'
]
=
float
(
processingTime
[
'Normal'
][
'mean'
])
+
5
*
float
(
processingTime
[
'Normal'
][
'stdev'
])
# holds the capacity of the object
self
.
numberOfSubBatches
=
numberOfSubBatches
# sets the operator resource of the Machine
self
.
operator
=
operator
# Sets the attributes of the processing (and failure) time(s)
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
self
.
rng
=
RandomNumberGenerator
(
self
,
processingTime
)
from
Globals
import
G
G
.
BatchReassemblyList
.
append
(
self
)
# flag to show if the objects outputs results
...
...
dream/simulation/BatchSource.py
View file @
34210375
...
...
@@ -31,10 +31,10 @@ import simpy
from
RandomNumberGenerator
import
RandomNumberGenerator
class
BatchSource
(
Source
):
def
__init__
(
self
,
id
,
name
,
inter
a
rrivalTime
=
None
,
def
__init__
(
self
,
id
,
name
,
inter
A
rrivalTime
=
None
,
entity
=
'Dream.Batch'
,
batchNumberOfUnits
=
1
,
**
kw
):
Source
.
__init__
(
self
,
id
=
id
,
name
=
name
,
inter
arrivalTime
=
intera
rrivalTime
,
entity
=
entity
)
inter
ArrivalTime
=
interA
rrivalTime
,
entity
=
entity
)
self
.
numberOfUnits
=
int
(
batchNumberOfUnits
)
from
Globals
import
G
G
.
BatchSourceList
.
append
(
self
)
...
...
dream/simulation/Dismantle.py
View file @
34210375
...
...
@@ -67,16 +67,12 @@ class Dismantle(CoreObject):
CoreObject
.
__init__
(
self
,
id
,
name
)
from
Globals
import
G
if
not
processingTime
:
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0
,
'stdev'
:
0
,
'min'
:
0
,
}
if
processingTime
[
'distributionType'
]
==
'Normal'
and
\
processingTime
.
get
(
'max'
,
None
)
is
None
:
processingTime
[
'max'
]
=
float
(
processingTime
[
'mean'
])
+
5
*
float
(
processingTime
[
'stdev'
])
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
processingTime
=
{
'Fixed'
:{
'mean'
:
0
}}
if
'Normal'
in
processingTime
.
keys
()
and
\
processingTime
[
'Normal'
].
get
(
'max'
,
None
)
is
None
:
processingTime
[
'Normal'
][
'max'
]
=
float
(
processingTime
[
'Normal'
][
'mean'
])
+
5
*
float
(
processingTime
[
'Normal'
][
'stdev'
])
self
.
rng
=
RandomNumberGenerator
(
self
,
processingTime
)
#===========================================================================
# the initialize method
...
...
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