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
354c1b08
Commit
354c1b08
authored
Sep 25, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Oct 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isInRoute method renamed; isInRouteOf
parent
d9c8ac69
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
23 additions
and
35 deletions
+23
-35
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+1
-1
dream/simulation/ExitJobShop.py
dream/simulation/ExitJobShop.py
+1
-1
dream/simulation/Machine.py
dream/simulation/Machine.py
+3
-3
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+5
-5
dream/simulation/MouldAssemblyBufferManaged.py
dream/simulation/MouldAssemblyBufferManaged.py
+3
-3
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+1
-1
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+2
-2
dream/simulation/Queue.py
dream/simulation/Queue.py
+2
-2
dream/simulation/QueueJobShop.py
dream/simulation/QueueJobShop.py
+4
-4
dream/simulation/QueueManagedJob.py
dream/simulation/QueueManagedJob.py
+0
-12
dream/simulation/RoutingQueue.py
dream/simulation/RoutingQueue.py
+1
-1
No files found.
dream/simulation/CoreObject.py
View file @
354c1b08
...
...
@@ -673,7 +673,7 @@ class CoreObject(ManPyObject):
#===========================================================================
# method used to check whether the station is a successor of the caller
#===========================================================================
def
isInRoute
(
self
,
callerObject
=
None
):
def
isInRoute
Of
(
self
,
callerObject
=
None
):
thecaller
=
callerObject
# if the caller is not defined then return True. We are only interested in checking whether
# the station can accept whatever entity from whichever giver
...
...
dream/simulation/ExitJobShop.py
View file @
354c1b08
...
...
@@ -47,7 +47,7 @@ class ExitJobShop(Exit):
# method used to check whether the station is in the entity-to-be-received route
# TODO: consider giving the activeEntity as attribute
#===========================================================================
def
isInRoute
(
self
,
callerObject
=
None
):
def
isInRoute
Of
(
self
,
callerObject
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
thecaller
=
callerObject
...
...
dream/simulation/Machine.py
View file @
354c1b08
...
...
@@ -965,14 +965,14 @@ class Machine(CoreObject):
return
self
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
self
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
self
.
isInRoute
(
thecaller
)
\
and
self
.
isInRoute
Of
(
thecaller
)
\
and
not
self
.
entryIsAssignedTo
()
else
:
# the operator doesn't have to be present for the loading of the machine as the load operation
# is not assigned to operators
return
self
.
checkIfMachineIsUp
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
self
.
isInRoute
(
thecaller
)
\
and
self
.
isInRoute
Of
(
thecaller
)
\
and
not
self
.
entryIsAssignedTo
()
# =======================================================================
...
...
@@ -1079,7 +1079,7 @@ class Machine(CoreObject):
thecaller
=
callerObject
return
len
(
activeObjectQueue
)
>
0
\
and
self
.
waitToDispose
\
and
thecaller
.
isInRoute
(
self
)
\
and
thecaller
.
isInRoute
Of
(
self
)
\
and
(
self
.
canDeliverOnInterruption
or
self
.
timeLastEntityEnded
==
self
.
env
.
now
or
self
.
checkIfActive
())
...
...
dream/simulation/MachineJobShop.py
View file @
354c1b08
...
...
@@ -117,18 +117,18 @@ class MachineJobShop(Machine):
return
self
.
operatorPool
.
checkIfResourceIsAvailable
()
\
and
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
self
.
checkIfMachineIsUp
()
\
and
self
.
isInRoute
(
thecaller
)
\
and
self
.
isInRoute
Of
(
thecaller
)
\
and
not
self
.
entryIsAssignedTo
()
else
:
return
len
(
activeObjectQueue
)
<
self
.
capacity
\
and
self
.
checkIfMachineIsUp
()
\
and
self
.
isInRoute
(
thecaller
)
\
and
self
.
isInRoute
Of
(
thecaller
)
\
and
not
self
.
entryIsAssignedTo
()
#===========================================================================
# method used to check whether the station is in the entity-to-be-received route
#===========================================================================
def
isInRoute
(
self
,
callerObject
=
None
):
def
isInRoute
Of
(
self
,
callerObject
=
None
):
activeObjectQueue
=
self
.
Res
.
users
thecaller
=
callerObject
# if the caller is not defined then return True. We are only interested in checking whether
...
...
@@ -161,7 +161,7 @@ class MachineJobShop(Machine):
return
len
(
activeObjectQueue
)
>
0
\
and
self
.
waitToDispose
\
and
self
.
checkIfActive
()
\
and
thecaller
.
isInRoute
(
self
)
and
thecaller
.
isInRoute
Of
(
self
)
# =======================================================================
# method to execute preemption
...
...
@@ -205,7 +205,7 @@ class MachineJobShop(Machine):
def
canAcceptAndIsRequested
(
self
,
callerObject
):
giverObject
=
callerObject
assert
giverObject
,
'there must be a caller for canAcceptAndIsRequested'
if
self
.
isInRoute
(
giverObject
):
if
self
.
isInRoute
Of
(
giverObject
):
if
Machine
.
canAcceptAndIsRequested
(
self
,
giverObject
):
self
.
readLoadTime
(
giverObject
)
return
True
...
...
dream/simulation/MouldAssemblyBufferManaged.py
View file @
354c1b08
...
...
@@ -171,15 +171,15 @@ class MouldAssemblyBufferManaged(QueueManagedJob):
# TODO: the activeEntity is already checked for the flag componentsReadyForAssembly
if
len
(
thecaller
.
getActiveObjectQueue
())
==
0
:
if
activeEntity
.
type
==
'Mould'
:
return
thecaller
.
isInRoute
(
activeObject
)
return
thecaller
.
isInRoute
Of
(
activeObject
)
else
:
return
thecaller
.
isInRoute
(
activeObject
)
\
return
thecaller
.
isInRoute
Of
(
activeObject
)
\
and
activeEntity
.
order
.
componentsReadyForAssembly
# otherwise, check additionally if the receiver holds orderComponents of the same order
# TODO: should revise, this check may be redundant, as the receiver (assembler must be empty in order to start receiving
# It is therefore needed that the control is performed by the assembler's getEntity()
else
:
return
thecaller
.
isInRoute
(
activeObject
)
\
return
thecaller
.
isInRoute
Of
(
activeObject
)
\
and
thecaller
.
getActiveObjectQueue
()[
0
].
order
is
activeEntity
.
order
\
and
activeEntity
.
order
.
componentsReadyForAssembly
...
...
dream/simulation/OperatorRouter.py
View file @
354c1b08
...
...
@@ -381,7 +381,7 @@ class Router(ObjectInterruption):
operator
.
candidateEntities
.
append
(
station
.
currentEntity
)
else
:
for
predecessor
in
station
.
previous
:
if
predecessor
in
self
.
pendingQueues
and
not
station
in
occupiedStations
and
station
.
isInRoute
(
predecessor
):
if
predecessor
in
self
.
pendingQueues
and
not
station
in
occupiedStations
and
station
.
isInRoute
Of
(
predecessor
):
if
predecessor
.
getActiveObjectQueue
()[
0
]
in
self
.
pending
\
and
not
predecessor
.
getActiveObjectQueue
()[
0
]
in
occupiedEntities
:
operator
.
candidateEntities
.
append
(
predecessor
.
getActiveObjectQueue
()[
0
])
...
...
dream/simulation/OrderDecomposition.py
View file @
354c1b08
...
...
@@ -157,13 +157,13 @@ class OrderDecomposition(CoreObject):
return
True
#return True if the OrderDecomposition in the state of disposing and the caller is the receiver
return
self
.
Up
and
thecaller
.
isInRoute
(
activeObject
)
return
self
.
Up
and
thecaller
.
isInRoute
Of
(
activeObject
)
#===========================================================================
# method used to check whether the station is in the entity-to-be-received route
# TODO: consider giving the activeEntity as attribute
#===========================================================================
def
isInRoute
(
self
,
callerObject
=
None
):
def
isInRoute
Of
(
self
,
callerObject
=
None
):
activeObject
=
self
.
getActiveObject
()
activeObjectQueue
=
activeObject
.
getActiveObjectQueue
()
thecaller
=
callerObject
...
...
dream/simulation/Queue.py
View file @
354c1b08
...
...
@@ -148,7 +148,7 @@ class Queue(CoreObject):
if
(
callerObject
==
None
):
return
len
(
activeObjectQueue
)
<
self
.
capacity
thecaller
=
callerObject
return
len
(
activeObjectQueue
)
<
self
.
capacity
and
(
self
.
isInRoute
(
thecaller
))
return
len
(
activeObjectQueue
)
<
self
.
capacity
and
(
self
.
isInRoute
Of
(
thecaller
))
# =======================================================================
# checks if the Queue can dispose an entity to the following object
...
...
@@ -162,7 +162,7 @@ class Queue(CoreObject):
if
(
callerObject
==
None
):
return
len
(
activeObjectQueue
)
>
0
thecaller
=
callerObject
return
len
(
activeObjectQueue
)
>
0
and
thecaller
.
isInRoute
(
self
)
return
len
(
activeObjectQueue
)
>
0
and
thecaller
.
isInRoute
Of
(
self
)
# =======================================================================
# removes an entity from the Object
...
...
dream/simulation/QueueJobShop.py
View file @
354c1b08
...
...
@@ -53,13 +53,13 @@ class QueueJobShop(Queue):
#return according to the state of the Queue
#check it the caller object holds an Entity that requests for current object
return
len
(
self
.
Res
.
users
)
<
self
.
capacity
\
and
self
.
isInRoute
(
callerObject
)
and
self
.
isInRoute
Of
(
callerObject
)
#===========================================================================
# method used to check whether the station is in the entity-to-be-received route
# TODO: consider giving the activeEntity as attribute
#===========================================================================
def
isInRoute
(
self
,
callerObject
=
None
):
def
isInRoute
Of
(
self
,
callerObject
=
None
):
activeObjectQueue
=
self
.
Res
.
users
thecaller
=
callerObject
# if the caller is not defined then return True. We are only interested in checking whether
...
...
@@ -88,7 +88,7 @@ class QueueJobShop(Queue):
#return True if the Queue has Entities and the caller is in the self.next list
return
len
(
activeObjectQueue
)
>
0
\
and
thecaller
.
isInRoute
(
self
)
and
thecaller
.
isInRoute
Of
(
self
)
#===========================================================================
# extend the default behaviour to check if whether the station
...
...
@@ -97,7 +97,7 @@ class QueueJobShop(Queue):
def
canAcceptAndIsRequested
(
self
,
callerObject
=
None
):
giverObject
=
callerObject
assert
giverObject
,
'there must be a caller for canAcceptAndIsRequested'
if
self
.
isInRoute
(
giverObject
):
if
self
.
isInRoute
Of
(
giverObject
):
return
Queue
.
canAcceptAndIsRequested
(
self
,
giverObject
)
# =======================================================================
...
...
dream/simulation/QueueManagedJob.py
View file @
354c1b08
...
...
@@ -80,10 +80,6 @@ class QueueManagedJob(QueueJobShop):
else
:
haveEntityWithAvailableManager
=
True
break
# for entity in [x for x in activeObjectQueue if x.manager]:
# if entity.manager.checkIfResourceIsAvailable(thecaller):
# haveEntityWithAvailableManager=True
# break
#if none of the Entities has an available manager return False
if
not
haveEntityWithAvailableManager
:
return
False
...
...
@@ -95,14 +91,6 @@ class QueueManagedJob(QueueJobShop):
# and then perform the default behaviour
return
QueueJobShop
.
haveToDispose
(
self
,
thecaller
)
# #if we have only one possible receiver just check if the Queue holds one or more entities
# if(thecaller==None):
# return len(activeObjectQueue)>0
#
# #return True if the Queue has Entities and the caller is the receiver
# return len(activeObjectQueue)>0\
# and (thecaller in activeObject.next)\
# and thecaller.isInRoute(activeObject)
#===========================================================================
# signalRouter method
...
...
dream/simulation/RoutingQueue.py
View file @
354c1b08
...
...
@@ -60,7 +60,7 @@ class RoutingQueue(Queue):
# if yes then that entity can proceed
isInRouting
=
True
break
return
len
(
activeObjectQueue
)
>
0
and
thecaller
.
isInRoute
(
self
)
and
isInRouting
return
len
(
activeObjectQueue
)
>
0
and
thecaller
.
isInRoute
Of
(
self
)
and
isInRouting
#===========================================================================
# sort the entities of the queue for the 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