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
Hide 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):
...
@@ -51,6 +51,7 @@ class Router(ObjectInterruption):
# the run method
# the run method
# =======================================================================
# =======================================================================
def
run
(
self
):
def
run
(
self
):
from
Globals
import
G
while
1
:
while
1
:
# wait until the router is called
# wait until the router is called
yield
waituntil
,
self
,
self
.
routerIsCalled
yield
waituntil
,
self
,
self
.
routerIsCalled
...
@@ -59,7 +60,6 @@ class Router(ObjectInterruption):
...
@@ -59,7 +60,6 @@ class Router(ObjectInterruption):
# before they can enter again a type-Machine object
# before they can enter again a type-Machine object
yield
waituntil
,
self
,
self
.
entitiesFinishedMoving
yield
waituntil
,
self
,
self
.
entitiesFinishedMoving
from
Globals
import
G
for
object
in
G
.
MachineList
:
for
object
in
G
.
MachineList
:
if
object
.
inPositionToGet
:
if
object
.
inPositionToGet
:
object
.
canProceedWithGetEntity
=
True
object
.
canProceedWithGetEntity
=
True
...
@@ -90,29 +90,33 @@ class Router(ObjectInterruption):
...
@@ -90,29 +90,33 @@ class Router(ObjectInterruption):
# check if the entities waiting to be disposed from different Machines
# 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)
# the first time the Router is called, have reached the last queue (if any)
# before the next Machine in their route
# before the next Machine in their route
from
Globals
import
G
# from Globals import G
# pending entities are entities about to enter an other machine, updated by endProcessingActions()
# # pending entities are entities about to enter an other machine, updated by endProcessingActions()
# if there are any pending entities
# # if there are any pending entities
if
len
(
G
.
pendingEntities
):
# if len(G.pendingEntities):
# for each one of them
# # for each one of them
for
entity
in
G
.
pendingEntities
:
# for entity in G.pendingEntities:
# if they are residing in a machine which waits to dispose and is functional
# # if they are residing in a machine which waits to dispose and is functional
if
entity
.
currentStation
in
G
.
MachineList
:
# if entity.currentStation in G.MachineList:
if
entity
.
currentStation
.
checkIfMachineIsUp
()
\
# if entity.currentStation.checkIfMachineIsUp()\
and
entity
.
currentStation
.
waitToDispose
:
# and entity.currentStation.waitToDispose:
# if the next step in the entity's route is machine with Load operationType then continue
# # if the next step in the entity's route is machine with Load operationType then continue
if
(
not
(
entity
.
currentStation
.
receiver
in
G
.
MachineList
)
\
# if (not (entity.currentStation.receiver.type in G.MachineList)\
and
entity
.
currentStation
.
receiver
.
canAccept
()
\
# and entity.currentStation.receiver.canAccept()\
or
\
# or\
((
entity
.
currentStation
.
receiver
.
type
in
G
.
MachineList
)
\
# ((entity.currentStation.receiver.type in G.MachineList)\
and
not
any
(
type
==
'Load'
for
type
in
entity
.
currentStation
.
receiver
.
multOperationTypeList
))):
# and not any(type=='Load' for type in entity.currentStation.receiver.multOperationTypeList))):
return
False
# return False
# if the entity is in a Queue
# elif entity.currentStation in G.QueueList:
elif
entity
.
currentStation
in
G
.
QueueList
:
# pass
# if the hot flag of the entity is raised
# elif entity.currentStation in G.LineClearanceList:
if
entity
.
hot
:
# pass
return
True
# # this list can check all the available object in G.objList
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
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