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
df00aac6
Commit
df00aac6
authored
Feb 21, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BatchDecomposition/Reassembly updated for OperatorRoute object use
parent
18604b90
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+22
-11
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+7
-1
No files found.
dream/simulation/BatchDecomposition.py
View file @
df00aac6
...
...
@@ -73,15 +73,14 @@ class BatchDecomposition(CoreObject):
CoreObject
.
initialize
(
self
)
# using the default CoreObject Functionality
self
.
Res
=
Resource
(
self
.
numberOfSubBatches
)
# initialize the Internal resource (Queue) functionality
# =======================================================================
# the run method of the BatchDecomposition
# =======================================================================
def
run
(
self
):
while
1
:
yield
waituntil
,
self
,
self
.
canAcceptAndIsRequested
#wait until the Queue can accept an entity
#and one predecessor requests it
self
.
getEntity
()
# self.outputTrace("got into "+self.objName)
# set the currentEntity as the Entity just received and initialize the timer timeLastEntityEntered
self
.
currentEntity
=
self
.
getActiveObjectQueue
()[
0
]
# entity is the current entity processed in Machine
self
.
nameLastEntityEntered
=
self
.
currentEntity
.
name
# this holds the name of the last entity that got into Machine
...
...
@@ -91,7 +90,9 @@ class BatchDecomposition(CoreObject):
yield
hold
,
self
,
self
.
totalProcessingTimeInCurrentEntity
self
.
decompose
()
# =======================================================================
# method that decomposes the activeEntity into subBatches
# =======================================================================
def
decompose
(
self
):
#, activeEntity=None):
# maybe I can use as argument the activeEntity passing the getEntity as argument to this function in the run function
# for example
...
...
@@ -123,11 +124,17 @@ class BatchDecomposition(CoreObject):
activeObjectQueue
.
append
(
subBatch
)
#append the sub-batch to the active object Queue
activeEntity
.
subBatchList
.
append
(
subBatch
)
subBatch
.
currentStation
=
self
# if the activeEntity is hot then the subBatches should be also hot
subBatch
.
hot
=
activeEntity
.
hot
# if the activeEntity is in the pendingEntities list then place the subBatches there
if
activeEntity
in
G
.
pendingEntities
:
G
.
pendingEntities
.
append
(
subBatch
)
activeEntity
.
numberOfSubBatches
=
self
.
numberOfSubBatches
self
.
timeLastEntityEnded
=
now
()
# =======================================================================
# canAccept logic
# =======================================================================
def
canAccept
(
self
,
callerObject
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
...
...
@@ -139,7 +146,9 @@ class BatchDecomposition(CoreObject):
# the object capacity, and the callerObject is not None but the giverObject
return
len
(
activeObjectQueue
)
==
0
and
(
thecaller
is
giverObject
)
# =======================================================================
# haveToDispose logic
# =======================================================================
def
haveToDispose
(
self
,
callerObject
=
None
):
# get active and the receiver object
activeObject
=
self
.
getActiveObject
()
...
...
@@ -166,7 +175,9 @@ class BatchDecomposition(CoreObject):
return
len
(
self
.
Res
.
activeQ
)
==
self
.
numberOfSubBatches
and
\
(
thecaller
is
receiverObject
)
and
activeObjectQueue
[
0
].
type
!=
"Batch"
# =======================================================================
# canAcceptAndIsRequested logc
# =======================================================================
def
canAcceptAndIsRequested
(
self
):
# get the active and the giver objects
activeObject
=
self
.
getActiveObject
()
...
...
dream/simulation/BatchReassembly.py
View file @
df00aac6
...
...
@@ -118,8 +118,14 @@ class BatchReassembly(CoreObject):
numberOfUnits
=
0
for
subBatch
in
activeObjectQueue
:
numberOfUnits
+=
subBatch
.
numberOfUnits
# the batch to be reassembled
batchToBeReassembled
=
activeObjectQueue
[
0
].
parentBatch
# if the activeEntity is hot then the subBatches should be also hot
batchToBeReassembled
.
hot
=
activeObjectQueue
[
0
].
hot
# if the activeEntity is in the pendingEntities list then place the subBatches there
if
activeObjectQueue
[
0
]
in
G
.
pendingEntities
:
G
.
pendingEntities
.
append
(
batchToBeReassembled
)
del
activeObjectQueue
[:]
batchToBeReassembled
.
numberOfSubBatches
=
1
batchToBeReassembled
.
numberOfUnits
=
numberOfUnits
...
...
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