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
d729090c
Commit
d729090c
authored
Feb 24, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
entitiesFinishedMoving tracks entities that have to move in zero simulation time
parent
2133028f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+28
-24
No files found.
dream/simulation/OperatorRouter.py
View file @
d729090c
...
...
@@ -51,6 +51,7 @@ class Router(ObjectInterruption):
# the run method
# =======================================================================
def
run
(
self
):
from
Globals
import
G
while
1
:
# wait until the router is called
yield
waituntil
,
self
,
self
.
routerIsCalled
...
...
@@ -59,7 +60,6 @@ class Router(ObjectInterruption):
# before they can enter again a type-Machine object
yield
waituntil
,
self
,
self
.
entitiesFinishedMoving
from
Globals
import
G
for
object
in
G
.
MachineList
:
if
object
.
inPositionToGet
:
object
.
canProceedWithGetEntity
=
True
...
...
@@ -90,29 +90,33 @@ class Router(ObjectInterruption):
# check if the entities waiting to be disposed from different Machines
# the first time the Router is called, have reached the last queue (if any)
# before the next Machine in their route
# from Globals import G
# # pending entities are entities about to enter an other machine, updated by endProcessingActions()
# # if there are any pending entities
# if len(G.pendingEntities):
# # for each one of them
# for entity in G.pendingEntities:
# # if they are residing in a machine which waits to dispose and is functional
# if entity.currentStation in G.MachineList:
# if entity.currentStation.checkIfMachineIsUp()\
# and entity.currentStation.waitToDispose:
# # if the next step in the entity's route is machine with Load operationType then continue
# if (not (entity.currentStation.receiver.type in G.MachineList)\
# and entity.currentStation.receiver.canAccept()\
# or\
# ((entity.currentStation.receiver.type in G.MachineList)\
# and not any(type=='Load' for type in entity.currentStation.receiver.multOperationTypeList))):
# return False
# elif entity.currentStation in G.QueueList:
# pass
# elif entity.currentStation in G.LineClearanceList:
# pass
# # this list can check all the available object in G.objList
from
Globals
import
G
# pending entities are entities about to enter an other machine, updated by endProcessingActions()
# if there are any pending entities
if
len
(
G
.
pendingEntities
):
# for each one of them
for
entity
in
G
.
pendingEntities
:
# if they are residing in a machine which waits to dispose and is functional
if
entity
.
currentStation
in
G
.
MachineList
:
if
entity
.
currentStation
.
checkIfMachineIsUp
()
\
and
entity
.
currentStation
.
waitToDispose
:
# if the next step in the entity's route is machine with Load operationType then continue
if
(
not
(
entity
.
currentStation
.
receiver
in
G
.
MachineList
)
\
and
entity
.
currentStation
.
receiver
.
canAccept
()
\
or
\
((
entity
.
currentStation
.
receiver
.
type
in
G
.
MachineList
)
\
and
not
any
(
type
==
'Load'
for
type
in
entity
.
currentStation
.
receiver
.
multOperationTypeList
))):
return
False
# if the entity is in a Queue
elif
entity
.
currentStation
in
G
.
QueueList
:
# if the hot flag of the entity is raised
if
entity
.
hot
:
return
True
else
:
return
False
elif
entity
.
currentStation
in
G
.
OrderDecompositionList
:
return
False
# TODO: this list can check all the available object in G.objList
return
True
# =======================================================================
...
...
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