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
31a1b69c
Commit
31a1b69c
authored
May 19, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CoreObject getEntity() clean-up
parent
a2ecb7e4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
54 deletions
+5
-54
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-37
dream/simulation/Machine.py
dream/simulation/Machine.py
+0
-10
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+2
-7
No files found.
dream/simulation/CoreObject.py
View file @
31a1b69c
...
...
@@ -245,6 +245,9 @@ class CoreObject(Process):
receiverOperated
=
False
# perform preemption when required
# if the object is not Exit
# TODO this has to be performed after updating the next list
# TODO: create a method that should check if preemption should be performed
# this should be done after the update of the next list
if
activeObject
.
receiver
:
# if the receiver has an operatorPool and its operationType is Load
try
:
...
...
@@ -269,44 +272,7 @@ class CoreObject(Process):
self
.
printTrace
(
self
.
id
,
'preempting receiver'
+
self
.
receiver
.
id
+
'.. '
*
6
)
self
.
receiver
.
preempt
()
self
.
receiver
.
timeLastEntityEnded
=
now
()
#required to count blockage correctly in the preemptied station
# TODO have to clear the activeCallersList of the operator to start working in the machine
# consider the case where the operator is already released after loading, the getEntity is invoked after that
# if the object receiving an entity has an OperatorPool
try
:
if
self
.
operatorPool
!=
'None'
and
any
(
type
==
'Load'
for
type
in
self
.
multOperationTypeList
):
if
self
.
currentOperator
:
self
.
currentOperator
.
activeCallersList
=
[]
except
:
pass
# # activeCallersList of an operator holds the CoreObjects that have called him
# # when an Entity is obtained that has the operator as manager we need to reset this list
# if activeEntity.manager and (self.type=='MachineManagedJob' or self.type=='MFStation'):
# if activeEntity.manager.activeCallersList:
# activeEntity.manager.activeCallersList=[]
self
.
outputTrace
(
activeEntity
.
name
,
"got into "
+
self
.
objName
)
# TODO: if the successor of the object is a machine that is operated with operationType 'Load'
# then the flag hot of the activeEntity must be set to True
# to signalize that the entity has reached its final destination before the next Machine
# if the entity is not of type Job
if
activeEntity
.
family
==
'Entity'
:
from
Globals
import
G
successorsAreMachines
=
True
# for all the objects in the next list
for
object
in
activeObject
.
next
:
# if the object is not in the MachineList
# TODO: We must consider also the case that entities can be blocked before they can reach
# the heating point. In such a case they must be removed from the G.pendingEntities list
# and added again after they are unblocked
if
not
object
in
G
.
MachineList
:
successorsAreMachines
=
False
break
# the hot flag should not be raised
if
successorsAreMachines
:
activeEntity
.
hot
=
True
self
.
printTrace
(
activeEntity
.
name
,
"got into "
+
self
.
id
)
# update wipStatList
if
self
.
gatherWipStat
:
...
...
dream/simulation/Machine.py
View file @
31a1b69c
...
...
@@ -334,18 +334,8 @@ class Machine(CoreObject):
# but setupTime is given for the entity to be processed
# try:
# if self.setupTime and not any(type=="Setup" for type in self.multOperationTypeList):
# #===============================================================
# # testing
# if self.id=='MILL1' or self.id=='MILL2':
# print ' ', now(), self.id, 'auto-setup'
# #===============================================================
# self.timeSetupStarted = now()
# yield hold,self,self.calculateSetupTime()
# #===========================================================
# # testing
# if self.id=='MILL1' or self.id=='MILL2':
# print ' ', now()
# #===========================================================
# # TODO: if self.interrupted(): There is the issue of failure during the setup
# self.timeSetupEnded = now()
# self.setupTimeCurrentEntity = self.timeSetupEnded-self.timeSetupStarted
...
...
dream/simulation/MachineJobShop.py
View file @
31a1b69c
...
...
@@ -227,10 +227,7 @@ class MachineJobShop(Machine):
# method to execute preemption
# =======================================================================
def
preempt
(
self
):
#=======================================================================
# testing
# print now(), self.id, 'preempting', ' .'*7
#=======================================================================
self
.
printTrace
(
self
.
id
,
'preempting'
+
' .'
*
7
)
activeObject
=
self
.
getActiveObject
()
activeEntity
=
self
.
getActiveObjectQueue
()[
0
]
#get the active Entity
#calculate the remaining processing time
...
...
@@ -246,12 +243,10 @@ class MachineJobShop(Machine):
'processingTime'
:
\
{
'distributionType'
:
'Fixed'
,
\
'mean'
:
str
(
remainingProcessingTime
)}})
# activeEntity.remainingRoute.insert(0, [self.id, remainingProcessingTime])
activeEntity
.
remainingRoute
.
insert
(
0
,
{
'stationIdsList'
:[
str
(
self
.
lastGiver
.
id
)],
\
'processingTime'
:
\
{
'distributionType'
:
'Fixed'
,
\
'mean'
:
'0'
}})
# activeEntity.remainingRoute.insert(0, [self.lastGiver.id, 0])
'mean'
:
'0'
}})
#set the receiver as the object where the active entity was preempted from
self
.
receiver
=
self
.
lastGiver
self
.
next
=
[
self
.
receiver
]
...
...
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