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
65c71d9d
Commit
65c71d9d
authored
Nov 04, 2013
by
Ioannis Papagiannopoulos
Committed by
Sebastien Robin
Nov 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
canAccept method of BatchReassembly corrected
parent
28be9826
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+13
-8
No files found.
dream/simulation/BatchReassembly.py
View file @
65c71d9d
...
@@ -123,21 +123,25 @@ class BatchReassembly(CoreObject):
...
@@ -123,21 +123,25 @@ class BatchReassembly(CoreObject):
activeObject
=
self
.
getActiveObject
()
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
activeObjectQueue
=
self
.
getActiveObjectQueue
()
giverObject
=
self
.
getGiverObject
()
giverObject
=
self
.
getGiverObject
()
giverObjectQueue
=
giverObject
.
getGiverObjectQueue
()
giverObjectQueue
=
self
.
getGiverObjectQueue
()
if
(
len
(
activeObject
.
previous
)
==
1
or
callerObject
==
None
):
if
(
len
(
activeObject
.
previous
)
==
1
or
callerObject
==
None
):
if
len
(
activeObjectQueue
)
==
0
:
if
len
(
activeObjectQueue
)
==
0
:
return
activeObject
.
Up
return
activeObject
.
Up
else
:
else
:
return
activeObject
.
Up
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
return
activeObject
.
Up
\
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
and
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
and
giverObjectQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
and
giverObjectQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
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
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
return
len
(
activeObjectQueue
)
<
self
.
numberOfSubBatches
\
and
giverObjectQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
and
(
thecaller
is
giverObject
)
and
(
thecaller
is
giverObject
)
\
and
activeObjectQueue
[
0
].
type
!=
'Batch'
\
and
giverObjectQueue
[
0
].
batchId
==
activeObjectQueue
[
0
].
batchId
def
haveToDispose
(
self
,
callerObject
=
None
):
def
haveToDispose
(
self
,
callerObject
=
None
):
...
@@ -148,8 +152,8 @@ class BatchReassembly(CoreObject):
...
@@ -148,8 +152,8 @@ class BatchReassembly(CoreObject):
#if we have only one successor just check if object waits to dispose and also is up
#if we have only one successor just check if object waits to dispose and also is up
# this is done to achieve better (cpu) processing time
# this is done to achieve better (cpu) processing time
if
(
len
(
activeObject
.
next
)
==
1
or
callerObject
==
None
):
if
(
len
(
activeObject
.
next
)
==
1
or
callerObject
==
None
):
return
len
(
activeObjectQueue
)
==
1
and
\
return
len
(
activeObjectQueue
)
==
1
\
activeObjectQueue
[
0
].
type
==
"Batch"
# the control of the length of the queue is not needed
and
activeObjectQueue
[
0
].
type
==
"Batch"
# the control of the length of the queue is not needed
thecaller
=
callerObject
thecaller
=
callerObject
#give the entity to the successor that is waiting for the most time.
#give the entity to the successor that is waiting for the most time.
...
@@ -166,8 +170,9 @@ class BatchReassembly(CoreObject):
...
@@ -166,8 +170,9 @@ class BatchReassembly(CoreObject):
#return true only to the predecessor from which the queue will take
#return true only to the predecessor from which the queue will take
receiverObject
=
activeObject
.
getReceiverObject
()
receiverObject
=
activeObject
.
getReceiverObject
()
return
len
(
self
.
Res
.
activeQ
)
==
1
and
\
return
len
(
self
.
Res
.
activeQ
)
==
1
\
(
thecaller
is
receiverObject
)
and
activeObjectQueue
[
0
].
type
!=
"Batch"
# the control of the length of the queue is not needed
and
(
thecaller
is
receiverObject
)
\
and
activeObjectQueue
[
0
].
type
!=
"Batch"
# the control of the length of the queue is not needed
def
canAcceptAndIsRequested
(
self
):
def
canAcceptAndIsRequested
(
self
):
...
...
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