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
6365cc75
Commit
6365cc75
authored
Jul 15, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
canAccept method of BatchReassembly corrected
parent
ceee1158
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+10
-3
No files found.
dream/simulation/BatchReassembly.py
View file @
6365cc75
...
@@ -173,8 +173,6 @@ class BatchReassembly(CoreObject):
...
@@ -173,8 +173,6 @@ class BatchReassembly(CoreObject):
def
canAccept
(
self
,
callerObject
=
None
):
def
canAccept
(
self
,
callerObject
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
if
len
(
activeObject
.
previous
)
!=
1
:
assert
callerObject
!=
None
,
'the callerObject cannot be None for canAccept of BatchReassembly'
# if there is only one predecessor
# if there is only one predecessor
if
(
len
(
activeObject
.
previous
)
==
1
):
if
(
len
(
activeObject
.
previous
)
==
1
):
# find the predecessor object and its queue
# find the predecessor object and its queue
...
@@ -189,11 +187,20 @@ class BatchReassembly(CoreObject):
...
@@ -189,11 +187,20 @@ class BatchReassembly(CoreObject):
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
and
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
and
predecessorQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
and
predecessorQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
# if there is no caller defined - self.canAccept from getEntity
if
not
callerObject
:
return
activeObject
.
Up
\
and
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
thecaller
=
callerObject
thecaller
=
callerObject
# return True ONLY if the length of the activeOjbectQueue is smaller than
# return True ONLY if the length of the activeOjbectQueue is smaller than
# the object capacity, and the callerObject is not None but the giverObject
# the object capacity, and the callerObject is not None but the giverObject
return
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
if
len
(
activeObjectQueue
)
==
0
:
return
activeObject
.
Up
\
and
(
thecaller
in
activeObject
.
previous
)
else
:
return
activeObject
.
Up
\
and
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
and
(
thecaller
in
activeObject
.
previous
)
\
and
(
thecaller
in
activeObject
.
previous
)
\
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
thecaller
.
getActiveObjectQueue
()[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
and
thecaller
.
getActiveObjectQueue
()[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
...
...
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