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
b84a9fd4
Commit
b84a9fd4
authored
May 16, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CoreObject clean-up
parent
e8cef93c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
54 deletions
+11
-54
dream/simulation/ConditionalBuffer.py
dream/simulation/ConditionalBuffer.py
+1
-2
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+7
-46
dream/simulation/Machine.py
dream/simulation/Machine.py
+1
-2
dream/simulation/MouldAssemblyBuffer.py
dream/simulation/MouldAssemblyBuffer.py
+1
-2
dream/simulation/Queue.py
dream/simulation/Queue.py
+1
-2
No files found.
dream/simulation/ConditionalBuffer.py
View file @
b84a9fd4
...
...
@@ -162,8 +162,7 @@ class ConditionalBuffer(QueueManagedJob):
#===========================================================================
def
canEntityProceed
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
assert
entity
in
activeObjectQueue
,
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
# for entities of type OrderComponent, if they reside at a conditionalBuffer,
...
...
dream/simulation/CoreObject.py
View file @
b84a9fd4
...
...
@@ -587,45 +587,6 @@ class CoreObject(Process):
# =======================================================================
def
getReceiverObjectQueue
(
self
):
return
self
.
getReceiverObject
().
getActiveObjectQueue
()
# # =======================================================================
# # get the giver object queue in a getEntity transaction.
# # =======================================================================
# def updateGiverObject(self):
# activeObject=self
# # dummy variables that help prioritize the objects requesting to give objects to the Machine (activeObject)
# maxTimeWaiting=0 # dummy variable counting the time a predecessor is blocked
# giver=None
#
# # loop through the possible givers to see which have to dispose and which is the one blocked for longer
# for object in activeObject.previous:
# if(object.haveToDispose(activeObject) and object.receiver==self):
# if(object.downTimeInTryingToReleaseCurrentEntity>0):# and the predecessor has been down while trying to give away the Entity
# timeWaiting=now()-object.timeLastFailureEnded # the timeWaiting dummy variable counts the time end of the last failure of the giver object
# else:
# timeWaiting=now()-object.timeLastEntityEnded # in any other case, it holds the time since the end of the Entity processing
#
# #if more than one predecessor have to dispose take the part from the one that is blocked longer
# if(timeWaiting>=maxTimeWaiting):
# giver=object # the object to deliver the Entity to the activeObject is set to the ith member of the previous list
# maxTimeWaiting=timeWaiting
# return giver
# # =======================================================================
# # get the receiver object
# # =======================================================================
# def updateReceiverObject(self):
# activeObject=self
# # dummy variables that help prioritize the objects requesting to give objects to the Machine (activeObject)
# maxTimeWaiting=0 # dummy variable counting the time a successor is waiting
# receiver=None
# for object in activeObject.next:
# if(object.canAccept(activeObject)): # if a successor can accept an object
# timeWaiting=now()-object.timeLastEntityLeft # the time it has been waiting is updated and stored in dummy variable timeWaiting
# if(timeWaiting>maxTimeWaiting or maxTimeWaiting==0):# if the timeWaiting is the maximum among the ones of the successors
# maxTimeWaiting=timeWaiting
# receiver=object # set the receiver as the longest waiting possible receiver
# return receiver
# =======================================================================
# calculates the processing time
...
...
@@ -699,13 +660,13 @@ class CoreObject(Process):
def
activeQueueIsEmpty
(
self
):
return
len
(
self
.
Res
.
activeQ
)
==
0
# =======================================================================
# checks if the object is ready to receive an Entity
# =======================================================================
def
isReadyToGet
(
self
):
return
True
# set to true since this control was not needed until now.
# to return canAcceptAndIsRequested() would be more logical, but also computationally expensive
#return self.canAcceptAndIsRequested()
#
# =======================================================================
#
# checks if the object is ready to receive an Entity
#
# =======================================================================
#
def isReadyToGet(self):
#
return True # set to true since this control was not needed until now.
#
# to return canAcceptAndIsRequested() would be more logical, but also computationally expensive
#
#return self.canAcceptAndIsRequested()
# =======================================================================
# actions to be carried out when the processing of an Entity ends
...
...
dream/simulation/Machine.py
View file @
b84a9fd4
...
...
@@ -803,8 +803,7 @@ class Machine(CoreObject):
#===========================================================================
def
canEntityProceed
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
assert
entity
in
activeObjectQueue
,
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
from
Globals
import
G
...
...
dream/simulation/MouldAssemblyBuffer.py
View file @
b84a9fd4
...
...
@@ -186,8 +186,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
#===========================================================================
def
canEntityProceed
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
assert
entity
in
activeObjectQueue
,
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
# unassembled components of a mould must wait at a MouldAssemblyBuffer till the componentsReadyForAssembly flag is raised
...
...
dream/simulation/Queue.py
View file @
b84a9fd4
...
...
@@ -203,8 +203,7 @@ class Queue(CoreObject):
#===========================================================================
def
canEntityProceed
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
assert
entity
in
activeObjectQueue
,
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
mayProceed
=
False
...
...
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