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
3846fd2a
Commit
3846fd2a
authored
Oct 30, 2013
by
Ioannis Papagiannopoulos
Committed by
Sebastien Robin
Nov 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BatchReassembly class added
parent
5cea27e3
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
212 additions
and
6 deletions
+212
-6
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+6
-6
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+206
-0
No files found.
dream/simulation/BatchDecomposition.py
View file @
3846fd2a
...
...
@@ -28,17 +28,16 @@ BatchDecomposition is a Core Object that takes a batch and decomposes to sub-bat
from
SimPy.Simulation
import
Process
,
Resource
from
SimPy.Simulation
import
activate
,
waituntil
,
now
,
hold
import
scipy.stats
as
stat
from
Globals
import
G
from
CoreObject
import
CoreObject
from
RandomNumberGenerator
import
RandomNumberGenerator
import
scipy.stats
as
stat
from
Entity
import
Entity
from
SubBatch
import
SubBatch
from
Batch
import
Batch
from
Globals
import
G
# ===========================================================================
# the Batch-Decomposition Object
...
...
@@ -88,7 +87,7 @@ class BatchDecomposition(CoreObject):
while
1
:
yield
waituntil
,
self
,
self
.
canAcceptAndIsRequested
#wait until the Queue can accept an entity
#and one predecessor requests it
ent
=
self
.
getEntity
()
self
.
getEntity
()
# self.outputTrace("got into "+self.objName)
...
...
@@ -109,6 +108,7 @@ class BatchDecomposition(CoreObject):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
#get the internal queue of the active core object
activeEntity
=
activeObjectQueue
.
pop
()
G
.
BatchWaitingList
.
append
(
activeEntity
)
# this batch has to be reassembled by the method reassemble
numberOfSubBatchUnits
=
activeEntity
.
numberOfUnits
/
self
.
numberOfSubBatches
for
i
in
range
(
self
.
numberOfSubBatches
):
...
...
@@ -169,7 +169,7 @@ class BatchDecomposition(CoreObject):
#if we have only one predecessor just check if there is a place available and the predecessor has an entity to dispose
if
(
len
(
activeObject
.
previous
)
==
1
):
return
self
.
canAccept
(
self
)
and
giverObject
.
haveToDispose
(
activeObject
)
return
self
.
canAccept
()
and
giverObject
.
haveToDispose
(
activeObject
)
isRequested
=
False
# dummy boolean variable to check if any predecessor has something to hand in
maxTimeWaiting
=
0
# dummy timer to check which predecessor has been waiting the most
...
...
dream/simulation/BatchReassembly.py
0 → 100644
View file @
3846fd2a
This diff is collapsed.
Click to expand it.
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