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
a468d6ac
Commit
a468d6ac
authored
Nov 11, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
batchReassembly to be able to output the final WIP
parent
091ef4da
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+18
-2
dream/simulation/Examples/GUI_models/BatchesStochasticACO.json
.../simulation/Examples/GUI_models/BatchesStochasticACO.json
+4
-2
No files found.
dream/simulation/BatchReassembly.py
View file @
a468d6ac
...
@@ -45,7 +45,8 @@ class BatchReassembly(CoreObject):
...
@@ -45,7 +45,8 @@ class BatchReassembly(CoreObject):
# =======================================================================
# =======================================================================
#initialize the id, the capacity of the object and the distribution
#initialize the id, the capacity of the object and the distribution
# =======================================================================
# =======================================================================
def
__init__
(
self
,
id
,
name
,
numberOfSubBatches
=
1
,
processingTime
=
None
,
operator
=
'None'
,
outputResults
=
False
,
**
kw
):
def
__init__
(
self
,
id
,
name
,
numberOfSubBatches
=
1
,
processingTime
=
None
,
operator
=
'None'
,
outputResults
=
False
,
outputFinalWIP
=
False
,
**
kw
):
CoreObject
.
__init__
(
self
,
id
,
name
)
CoreObject
.
__init__
(
self
,
id
,
name
)
self
.
type
=
"BatchRassembly"
#String that shows the type of object
self
.
type
=
"BatchRassembly"
#String that shows the type of object
if
not
processingTime
:
if
not
processingTime
:
...
@@ -64,6 +65,8 @@ class BatchReassembly(CoreObject):
...
@@ -64,6 +65,8 @@ class BatchReassembly(CoreObject):
G
.
BatchReassemblyList
.
append
(
self
)
G
.
BatchReassemblyList
.
append
(
self
)
# flag to show if the objects outputs results
# flag to show if the objects outputs results
self
.
outputResults
=
bool
(
int
(
outputResults
))
self
.
outputResults
=
bool
(
int
(
outputResults
))
self
.
outputFinalWIP
=
bool
(
int
(
outputFinalWIP
))
self
.
finalWIP
=
[]
# =======================================================================
# =======================================================================
# initialize the internal resource of the object
# initialize the internal resource of the object
...
@@ -330,6 +333,16 @@ class BatchReassembly(CoreObject):
...
@@ -330,6 +333,16 @@ class BatchReassembly(CoreObject):
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
giverObjectQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
and
giverObjectQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
# =======================================================================
# actions to be taken after the simulation ends
# =======================================================================
def
postProcessing
(
self
,
MaxSimtime
=
None
):
CoreObject
.
postProcessing
(
self
,
MaxSimtime
)
currentWIP
=
0
for
subBatch
in
self
.
getActiveObjectQueue
():
currentWIP
+=
subBatch
.
numberOfUnits
self
.
finalWIP
.
append
(
currentWIP
)
# =======================================================================
# =======================================================================
# outputs results to JSON File
# outputs results to JSON File
# =======================================================================
# =======================================================================
...
@@ -345,7 +358,10 @@ class BatchReassembly(CoreObject):
...
@@ -345,7 +358,10 @@ class BatchReassembly(CoreObject):
json
[
'results'
][
'blockage_ratio'
]
=
self
.
Blockage
json
[
'results'
][
'blockage_ratio'
]
=
self
.
Blockage
json
[
'results'
][
'waiting_ratio'
]
=
self
.
Waiting
json
[
'results'
][
'waiting_ratio'
]
=
self
.
Waiting
json
[
'results'
][
'off_shift_ratio'
]
=
self
.
OffShift
json
[
'results'
][
'off_shift_ratio'
]
=
self
.
OffShift
if
self
.
outputFinalWIP
:
json
[
'results'
][
'final_WIP'
]
=
self
.
finalWIP
G
.
outputJSON
[
'elementList'
].
append
(
json
)
G
.
outputJSON
[
'elementList'
].
append
(
json
)
\ No newline at end of file
dream/simulation/Examples/GUI_models/BatchesStochasticACO.json
View file @
a468d6ac
...
@@ -2170,7 +2170,8 @@
...
@@ -2170,7 +2170,8 @@
"top"
:
0.5350013587825962
"top"
:
0.5350013587825962
},
},
"id"
:
"St8RA"
,
"id"
:
"St8RA"
,
"numberOfSubBatches"
:
8
"numberOfSubBatches"
:
8
,
"outputFinalWIP"
:
1
},
},
"St8RB"
:
{
"St8RB"
:
{
"_class"
:
"Dream.BatchReassembly"
,
"_class"
:
"Dream.BatchReassembly"
,
...
@@ -2178,7 +2179,8 @@
...
@@ -2178,7 +2179,8 @@
"left"
:
0.9770689321903234
,
"left"
:
0.9770689321903234
,
"top"
:
0.960991679081057
"top"
:
0.960991679081057
},
},
"numberOfSubBatches"
:
8
"numberOfSubBatches"
:
8
,
"outputFinalWIP"
:
1
}
}
}
}
},
},
...
...
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