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
d0dc5334
Commit
d0dc5334
authored
May 20, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
naming conventions changed, minor clean-up
parent
7096353c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
12 deletions
+18
-12
dream/simulation/ConditionalBuffer.py
dream/simulation/ConditionalBuffer.py
+2
-2
dream/simulation/Entity.py
dream/simulation/Entity.py
+8
-1
dream/simulation/Machine.py
dream/simulation/Machine.py
+2
-2
dream/simulation/MouldAssemblyBuffer.py
dream/simulation/MouldAssemblyBuffer.py
+2
-2
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+2
-3
dream/simulation/Queue.py
dream/simulation/Queue.py
+2
-2
No files found.
dream/simulation/ConditionalBuffer.py
View file @
d0dc5334
...
...
@@ -160,7 +160,7 @@ class ConditionalBuffer(QueueManagedJob):
#===========================================================================
# checks whether the entity can proceed to a successor object
#===========================================================================
def
can
EntityProceed
(
self
,
entity
=
None
):
def
can
Deliver
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
...
...
@@ -175,7 +175,7 @@ class ConditionalBuffer(QueueManagedJob):
mayProceed
=
False
# for all the possible receivers of an entity check whether they can accept and then set accordingly the canProceed flag of the entity
for
nextObject
in
[
object
for
object
in
activeObject
.
next
if
object
.
canAcceptEntity
(
activeEntity
)]:
activeEntity
.
canP
roceed
=
True
activeEntity
.
p
roceed
=
True
activeEntity
.
candidateReceivers
.
append
(
nextObject
)
mayProceed
=
True
return
mayProceed
\ No newline at end of file
dream/simulation/Entity.py
View file @
d0dc5334
...
...
@@ -64,7 +64,7 @@ class Entity(object):
self
.
family
=
'Entity'
# variables to be used by OperatorRouter
self
.
canP
roceed
=
False
# boolean that is used to check weather the entity can proceed to the candidateReceiver
self
.
p
roceed
=
False
# boolean that is used to check weather the entity can proceed to the candidateReceiver
self
.
candidateReceivers
=
[]
# list of candidateReceivers of the entity (those stations that can receive the entity
self
.
candidateReceiver
=
None
# the station that is finaly chosen to receive the entity
...
...
@@ -72,6 +72,13 @@ class Entity(object):
self
.
receiver
=
None
self
.
timeOfAssignement
=
0
#===========================================================================
# check if the entity can proceed to an operated machine, for use by Router
#===========================================================================
def
canProceed
(
self
):
activeObject
=
self
.
currentStation
return
activeObject
.
canDeliver
(
self
)
#===========================================================================
# method that finds a receiver for a candidate entity
#===========================================================================
...
...
dream/simulation/Machine.py
View file @
d0dc5334
...
...
@@ -765,7 +765,7 @@ class Machine(CoreObject):
#===========================================================================
# checks whether the entity can proceed to a successor object
#===========================================================================
def
can
EntityProceed
(
self
,
entity
=
None
):
def
can
Deliver
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
...
...
@@ -774,7 +774,7 @@ class Machine(CoreObject):
router
=
G
.
Router
# if the entity is in a machines who's broker waits for operator then
if
activeObject
in
router
.
pendingMachines
:
activeEntity
.
canP
roceed
=
True
activeEntity
.
p
roceed
=
True
activeEntity
.
candidateReceivers
.
append
(
activeObject
)
return
True
return
False
...
...
dream/simulation/MouldAssemblyBuffer.py
View file @
d0dc5334
...
...
@@ -184,7 +184,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
#===========================================================================
# checks whether the entity can proceed to a successor object
#===========================================================================
def
can
EntityProceed
(
self
,
entity
=
None
):
def
can
Deliver
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
...
...
@@ -195,7 +195,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
mayProceed
=
False
# for all the possible receivers of an entity check whether they can accept and then set accordingly the canProceed flag of the entity
for
nextObject
in
[
object
for
object
in
activeObject
.
next
if
object
.
canAcceptEntity
(
activeEntity
)]:
activeEntity
.
canP
roceed
=
True
activeEntity
.
p
roceed
=
True
activeEntity
.
candidateReceivers
.
append
(
nextObject
)
mayProceed
=
True
return
mayProceed
dream/simulation/OperatorRouter.py
View file @
d0dc5334
...
...
@@ -235,7 +235,7 @@ class Router(ObjectInterruption):
operator
.
candidateStation
=
None
operator
.
candidateEntity
=
None
for
entity
in
G
.
pendingEntities
:
entity
.
canP
roceed
=
False
entity
.
p
roceed
=
False
entity
.
candidateReceivers
=
[]
entity
.
candidateReceiver
=
None
del
self
.
candidateOperators
[:]
...
...
@@ -424,8 +424,7 @@ class Router(ObjectInterruption):
# if the entity is ready to move to a machine and its manager is available
if
entity
.
manager
.
checkIfResourceIsAvailable
():
# check whether the entity canProceed and update the its candidateReceivers
# if entity.canEntityProceed()\
if
entity
.
currentStation
.
canEntityProceed
(
entity
)
\
if
entity
.
canProceed
()
\
and
not
entity
.
manager
in
self
.
candidateOperators
:
self
.
candidateOperators
.
append
(
entity
.
manager
)
# TODO: check if preemption can be implemented for the managed case
...
...
dream/simulation/Queue.py
View file @
d0dc5334
...
...
@@ -201,7 +201,7 @@ class Queue(CoreObject):
#===========================================================================
# checks whether the entity can proceed to a successor object
#===========================================================================
def
can
EntityProceed
(
self
,
entity
=
None
):
def
can
Deliver
(
self
,
entity
=
None
):
activeObject
=
self
.
getActiveObject
()
assert
activeObject
.
isInActiveQueue
(
entity
),
entity
.
id
+
' not in the internalQueue of'
+
activeObject
.
id
activeEntity
=
entity
...
...
@@ -209,7 +209,7 @@ class Queue(CoreObject):
mayProceed
=
False
# for all the possible receivers of an entity check whether they can accept and then set accordingly the canProceed flag of the entity
for
nextObject
in
[
object
for
object
in
activeObject
.
next
if
object
.
canAcceptEntity
(
activeEntity
)]:
activeEntity
.
canP
roceed
=
True
activeEntity
.
p
roceed
=
True
activeEntity
.
candidateReceivers
.
append
(
nextObject
)
mayProceed
=
True
return
mayProceed
...
...
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