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
c34ed730
Commit
c34ed730
authored
Mar 10, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BatchDecomposition/Reassembly set to read distribution in the new style
parent
f11bf8f5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
26 deletions
+23
-26
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+10
-9
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+9
-9
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+4
-8
No files found.
dream/simulation/BatchDecomposition.py
View file @
c34ed730
...
...
@@ -44,22 +44,23 @@ class BatchDecomposition(CoreObject):
# =======================================================================
#initialize the id, the capacity of the object and the distribution
# =======================================================================
def
__init__
(
self
,
id
,
name
,
numberOfSubBatches
=
1
,
distribution
=
'Fixed'
,
\
mean
=
1
,
stdev
=
0
,
min
=
0
,
max
=
10
,
operator
=
'None'
):
def
__init__
(
self
,
id
,
name
,
processingTime
=
None
,
numberOfSubBatches
=
1
,
operator
=
'None'
):
CoreObject
.
__init__
(
self
,
id
,
name
)
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'
]
=
processingTime
[
'mean'
]
+
5
*
processingTime
[
'stdev'
]
# holds the capacity of the object
self
.
numberOfSubBatches
=
numberOfSubBatches
# define the distribution types of the processing and failure times respectively
self
.
distType
=
distribution
#the distribution that the procTime follows
# sets the operator resource of the Machine
self
.
operator
=
operator
# Sets the attributes of the processing (and failure) time(s)
self
.
rng
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rng
.
mean
=
mean
self
.
rng
.
stdev
=
stdev
self
.
rng
.
min
=
min
self
.
rng
.
max
=
max
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
# =======================================================================
# initialize the internal resource of the object
...
...
dream/simulation/BatchReassembly.py
View file @
c34ed730
...
...
@@ -44,25 +44,25 @@ class BatchReassembly(CoreObject):
# =======================================================================
#initialize the id, the capacity of the object and the distribution
# =======================================================================
def
__init__
(
self
,
id
,
name
,
numberOfSubBatches
=
1
,
distribution
=
'Fixed'
,
\
mean
=
1
,
stdev
=
0
,
min
=
0
,
max
=
10
,
operator
=
'None'
):
def
__init__
(
self
,
id
,
name
,
numberOfSubBatches
=
1
,
processingTime
=
None
,
operator
=
'None'
):
Process
.
__init__
(
self
)
# hold the id, name, and type of the Machine instance
self
.
id
=
id
self
.
objName
=
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'
]
=
processingTime
[
'mean'
]
+
5
*
processingTime
[
'stdev'
]
# holds the capacity of the object
self
.
numberOfSubBatches
=
numberOfSubBatches
# define the distribution types of the processing and failure times respectively
self
.
distType
=
distribution
#the distribution that the procTime follows
# sets the operator resource of the Machine
self
.
operator
=
operator
# Sets the attributes of the processing (and failure) time(s)
self
.
rng
=
RandomNumberGenerator
(
self
,
self
.
distType
)
self
.
rng
.
mean
=
mean
self
.
rng
.
stdev
=
stdev
self
.
rng
.
min
=
min
self
.
rng
.
max
=
max
self
.
rng
=
RandomNumberGenerator
(
self
,
**
processingTime
)
# for routing purposes
self
.
next
=
[]
#list with the next objects in the flow
self
.
previous
=
[]
#list with the previous objects in the flow
...
...
dream/simulation/LineGenerationJSON.py
View file @
c34ed730
...
...
@@ -620,8 +620,7 @@ def createObjects():
min
=
float
(
processingTime
.
get
(
'min'
)
or
0
)
max
=
float
(
processingTime
.
get
(
'max'
)
or
mean
+
5
*
stdev
)
numberOfSubBatches
=
int
(
element
.
get
(
'numberOfSubBatches'
)
or
0
)
BD
=
BatchDecomposition
(
id
,
name
,
distribution
=
distributionType
,
numberOfSubBatches
=
numberOfSubBatches
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
)
BD
=
BatchDecomposition
(
id
,
name
,
processingTime
=
processingTime
,
numberOfSubBatches
=
numberOfSubBatches
)
BD
.
nextIds
=
getSuccessorList
(
id
)
G
.
BatchDecompositionList
.
append
(
BD
)
G
.
ObjList
.
append
(
BD
)
...
...
@@ -636,13 +635,11 @@ def createObjects():
min
=
float
(
processingTime
.
get
(
'min'
)
or
0
)
max
=
float
(
processingTime
.
get
(
'max'
)
or
mean
+
5
*
stdev
)
numberOfSubBatches
=
int
(
element
.
get
(
'numberOfSubBatches'
)
or
0
)
BD
=
BatchDecompositionStartTime
(
id
,
name
,
distribution
=
distributionType
,
numberOfSubBatches
=
numberOfSubBatches
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
)
BD
=
BatchDecompositionStartTime
(
id
,
name
,
processingTime
=
processingTime
,
numberOfSubBatches
=
numberOfSubBatches
)
BD
.
nextIds
=
getSuccessorList
(
id
)
G
.
BatchDecompositionList
.
append
(
BD
)
G
.
ObjList
.
append
(
BD
)
elif
objClass
==
'Dream.BatchReassembly'
:
id
=
element
.
get
(
'id'
,
'not found'
)
name
=
element
.
get
(
'name'
,
'not found'
)
...
...
@@ -653,8 +650,7 @@ def createObjects():
min
=
float
(
processingTime
.
get
(
'min'
)
or
0
)
max
=
float
(
processingTime
.
get
(
'max'
)
or
0
)
numberOfSubBatches
=
int
(
element
.
get
(
'numberOfSubBatches'
)
or
0
)
BR
=
BatchReassembly
(
id
,
name
,
distribution
=
distributionType
,
numberOfSubBatches
=
numberOfSubBatches
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
)
BR
=
BatchReassembly
(
id
,
name
,
processingTime
=
processingTime
,
numberOfSubBatches
=
numberOfSubBatches
)
BR
.
nextIds
=
getSuccessorList
(
id
)
G
.
BatchReassemblyList
.
append
(
BR
)
G
.
ObjList
.
append
(
BR
)
...
...
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