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
1181d837
Commit
1181d837
authored
Apr 15, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Broker now operates with events
parent
96b330f0
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
137 additions
and
44 deletions
+137
-44
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+4
-4
dream/simulation/ObjectInterruption.py
dream/simulation/ObjectInterruption.py
+21
-19
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+112
-21
No files found.
dream/simulation/CoreObject.py
View file @
1181d837
...
...
@@ -318,8 +318,8 @@ class CoreObject(Process):
activeObject
.
receiver
=
activeObject
.
selectReceiver
(
possibleReceivers
)
activeObject
.
receiver
.
giver
=
activeObject
#===================================================================
# TESTING
# print now(), self.id, 'signaling receiver', self.receiver.id
#
# TESTING
# print now(), self.id,
' '*50,
'signaling receiver', self.receiver.id
#===================================================================
activeObject
.
receiver
.
isRequested
.
signal
(
activeObject
)
return
True
...
...
@@ -360,8 +360,8 @@ class CoreObject(Process):
activeObject
.
giver
=
activeObject
.
selectGiver
(
possibleGivers
)
activeObject
.
giver
.
receiver
=
activeObject
#===================================================================
# TESTING
# print now(), self.id, 'signaling giver', self.giver.id
#
# TESTING
# print now(), self.id,
' '*50,
'signaling giver', self.giver.id
#===================================================================
activeObject
.
giver
.
canDispose
.
signal
(
activeObject
)
return
True
...
...
dream/simulation/ObjectInterruption.py
View file @
1181d837
...
...
@@ -53,29 +53,31 @@ class ObjectInterruption(Process):
# =======================================================================
# hand in the control to the objectIterruption.run
# to be called by the machine
# TODO: consider removing this method,
# signalling can be done via Machine request/releaseOperator
# =======================================================================
def
invoke
(
self
):
self
.
call
=
True
# =======================================================================
# return control to the Machine.run
# =======================================================================
def
exit
(
self
):
self
.
call
=
False
# =======================================================================
# call the objectInterruption
# filter for object interruption - yield waituntil isCalled
# =======================================================================
def
isCalled
(
self
):
return
self
.
call
# =======================================================================
# the objectIterruption returns control to machine.Run
# filter for Machine - yield request/release operator
# =======================================================================
def
isSet
(
self
):
return
not
self
.
call
self
.
brokerIsCalled
.
signal
(
now
())
#
# =======================================================================
#
# return control to the Machine.run
#
# =======================================================================
#
def exit(self):
#
self.call=False
#
# =======================================================================
#
# call the objectInterruption
#
# filter for object interruption - yield waituntil isCalled
#
# =======================================================================
#
def isCalled(self):
#
return self.call
#
# =======================================================================
#
# the objectIterruption returns control to machine.Run
#
# filter for Machine - yield request/release operator
#
# =======================================================================
#
def isSet(self):
#
return not self.call
#===========================================================================
# outputs data to "output.xls"
...
...
@@ -110,7 +112,7 @@ class ObjectInterruption(Process):
# reactivate the victim
#===========================================================================
def
reactivateVictim
(
self
):
self
.
victim
.
interruptionEnd
.
signal
(
self
.
victim
)
self
.
victim
.
interruptionEnd
.
signal
(
now
()
)
# reactivate(self.victim)
#===========================================================================
...
...
dream/simulation/OperatedPoolBroker.py
View file @
1181d837
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