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
59b20ed5
Commit
59b20ed5
authored
Aug 14, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
other objects to use any_of, test time dropped from 70-75 to 60-65
parent
2f553e34
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+1
-1
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+2
-2
dream/simulation/Conveyer.py
dream/simulation/Conveyer.py
+1
-1
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+1
-1
No files found.
dream/simulation/BatchDecomposition.py
View file @
59b20ed5
...
@@ -81,7 +81,7 @@ class BatchDecomposition(CoreObject):
...
@@ -81,7 +81,7 @@ class BatchDecomposition(CoreObject):
while
1
:
while
1
:
# wait for an event or an interruption
# wait for an event or an interruption
while
1
:
while
1
:
receivedEvent
=
yield
self
.
isRequested
|
self
.
interruptionStart
|
self
.
initialWIP
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
interruptionStart
,
self
.
initialWIP
])
# if an interruption has occurred
# if an interruption has occurred
if
self
.
interruptionStart
in
receivedEvent
:
if
self
.
interruptionStart
in
receivedEvent
:
assert
self
.
interruptionStart
.
value
==
self
.
env
.
now
,
'the interruption received by batchDecomposition was created earlier'
assert
self
.
interruptionStart
.
value
==
self
.
env
.
now
,
'the interruption received by batchDecomposition was created earlier'
...
...
dream/simulation/BatchReassembly.py
View file @
59b20ed5
...
@@ -77,7 +77,7 @@ class BatchReassembly(CoreObject):
...
@@ -77,7 +77,7 @@ class BatchReassembly(CoreObject):
self
.
initialSignalReceiver
()
self
.
initialSignalReceiver
()
while
1
:
while
1
:
while
1
:
while
1
:
receivedEvent
=
yield
self
.
isRequested
|
self
.
interruptionStart
|
self
.
initialWIP
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
interruptionStart
,
self
.
initialWIP
])
if
self
.
interruptionStart
in
receivedEvent
:
if
self
.
interruptionStart
in
receivedEvent
:
assert
self
.
interruptionStart
.
value
==
self
.
env
.
now
,
'the interruptionStart received by BatchReassembly later than created'
assert
self
.
interruptionStart
.
value
==
self
.
env
.
now
,
'the interruptionStart received by BatchReassembly later than created'
self
.
interruptionStart
=
self
.
env
.
event
()
self
.
interruptionStart
=
self
.
env
.
event
()
...
@@ -117,7 +117,7 @@ class BatchReassembly(CoreObject):
...
@@ -117,7 +117,7 @@ class BatchReassembly(CoreObject):
self
.
isProcessingInitialWIP
=
False
self
.
isProcessingInitialWIP
=
False
if
not
self
.
signalReceiver
():
if
not
self
.
signalReceiver
():
while
1
:
while
1
:
receivedEvent
=
yield
self
.
canDispose
|
self
.
interruptionStart
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
canDispose
,
self
.
interruptionStart
])
if
self
.
canDispose
in
receivedEvent
:
if
self
.
canDispose
in
receivedEvent
:
self
.
canDispose
=
self
.
env
.
event
()
self
.
canDispose
=
self
.
env
.
event
()
if
self
.
interruptionStart
in
receivedEvent
:
if
self
.
interruptionStart
in
receivedEvent
:
...
...
dream/simulation/Conveyer.py
View file @
59b20ed5
...
@@ -104,7 +104,7 @@ class Conveyer(CoreObject):
...
@@ -104,7 +104,7 @@ class Conveyer(CoreObject):
self
.
conveyerMover
.
canMove
.
succeed
(
self
.
env
.
now
)
self
.
conveyerMover
.
canMove
.
succeed
(
self
.
env
.
now
)
self
.
printTrace
(
self
.
id
,
waitEvent
=
''
)
self
.
printTrace
(
self
.
id
,
waitEvent
=
''
)
receivedEvent
=
yield
self
.
isRequested
|
self
.
canDispose
|
self
.
moveEnd
# , self.loadOperatorAvailable]
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
canDispose
,
self
.
moveEnd
])
# , self.loadOperatorAvailable]
# if the event that activated the thread is isRequested then getEntity
# if the event that activated the thread is isRequested then getEntity
if
self
.
isRequested
in
receivedEvent
:
if
self
.
isRequested
in
receivedEvent
:
self
.
printTrace
(
self
.
id
,
isRequested
=
''
)
self
.
printTrace
(
self
.
id
,
isRequested
=
''
)
...
...
dream/simulation/OrderDecomposition.py
View file @
59b20ed5
...
@@ -72,7 +72,7 @@ class OrderDecomposition(CoreObject):
...
@@ -72,7 +72,7 @@ class OrderDecomposition(CoreObject):
self
.
initialSignalReceiver
()
self
.
initialSignalReceiver
()
while
1
:
while
1
:
#wait until the Queue can accept an entity and one predecessor requests it
#wait until the Queue can accept an entity and one predecessor requests it
receivedEvent
=
yield
self
.
isRequested
|
self
.
canDispose
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
canDispose
])
# if the event that activated the thread is isRequested then getEntity
# if the event that activated the thread is isRequested then getEntity
if
self
.
isRequested
in
receivedEvent
:
if
self
.
isRequested
in
receivedEvent
:
self
.
isRequested
=
self
.
env
.
event
()
self
.
isRequested
=
self
.
env
.
event
()
...
...
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