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
7f1f952b
Commit
7f1f952b
authored
Jul 17, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Sep 01, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RoutingQueue clean-up
parent
66e11605
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
40 deletions
+4
-40
dream/simulation/RoutingQueue.py
dream/simulation/RoutingQueue.py
+4
-40
No files found.
dream/simulation/RoutingQueue.py
View file @
7f1f952b
...
@@ -33,20 +33,11 @@ from Queue import Queue
...
@@ -33,20 +33,11 @@ from Queue import Queue
# the Queue object
# the Queue object
# ===========================================================================
# ===========================================================================
class
RoutingQueue
(
Queue
):
class
RoutingQueue
(
Queue
):
# #===========================================================================
# # the __init__ method of the Queue
# #===========================================================================
# def __init__(self, id, name, capacity=1, isDummy=False, schedulingRule="FIFO", gatherWipStat=False,level=None):
# Queue.__init__(self, id, name,capacity,isDummy,schedulingRule,gatherWipStat)
# if level:
# assert level<=self.capacity, "the level cannot be bigger than the capacity of the queue"
# self.level=level
# =======================================================================
# =======================================================================
#
checks if the Queue can dispose an entity to the following object
# checks if the Queue can dispose an entity to the following object
#
it checks also who called it and returns TRUE
# it checks also who called it and returns TRUE
#
only to the receiver that will give the entity.
# only to the receiver that will give the entity.
#
this is kind of slow I think got to check
# this is kind of slow I think got to check
# TODO: check which route the entities of the same parent entity have picked and route them the same way
# TODO: check which route the entities of the same parent entity have picked and route them the same way
# =======================================================================
# =======================================================================
def
haveToDispose
(
self
,
callerObject
=
None
):
def
haveToDispose
(
self
,
callerObject
=
None
):
...
@@ -83,23 +74,6 @@ class RoutingQueue(Queue):
...
@@ -83,23 +74,6 @@ class RoutingQueue(Queue):
entity
.
receiver
=
receiver
entity
.
receiver
=
receiver
activeObjectQueue
.
sort
(
key
=
lambda
x
:
x
.
receiver
==
receiver
,
reverse
=
True
)
activeObjectQueue
.
sort
(
key
=
lambda
x
:
x
.
receiver
==
receiver
,
reverse
=
True
)
# # =======================================================================
# # removes an entity from the Object
# # =======================================================================
# def removeEntity(self, entity=None):
# activeEntity=Queue.removeEntity(self, entity) #run the default method
# # check if the queue is empty, if yes then try to signal the router, operators may need reallocation
# try:
# if self.level:
# if not len(self.getActiveObjectQueue()):
# from Globals import G
# if not G.Router.invoked:
# G.Router.invoked=True
# G.Router.isCalled.succeed(G.env.now)
# except:
# pass
# return activeEntity
# =======================================================================
# =======================================================================
# gets an entity from the predecessor that
# gets an entity from the predecessor that
# the predecessor index points to
# the predecessor index points to
...
@@ -117,16 +91,6 @@ class RoutingQueue(Queue):
...
@@ -117,16 +91,6 @@ class RoutingQueue(Queue):
# if none of the siblings (same parentBatch) has gone through the buffer then the receiver should remain None
# if none of the siblings (same parentBatch) has gone through the buffer then the receiver should remain None
except
:
except
:
pass
pass
# # if the level is reached then try to signal the Router to reallocate the operators
# try:
# if self.level:
# if len(self.getActiveObjectQueue())==self.level:
# from Globals import G
# if not G.Router.invoked:
# G.Router.invoked=True
# G.Router.isCalled.succeed(G.env.now)
# except:
# pass
return
activeEntity
return
activeEntity
# =======================================================================
# =======================================================================
...
...
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