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
06b7c16e
Commit
06b7c16e
authored
May 15, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
global variable Router instead of RoutersList
parent
09cf6663
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
17 deletions
+20
-17
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+3
-3
dream/simulation/Globals.py
dream/simulation/Globals.py
+4
-1
dream/simulation/Machine.py
dream/simulation/Machine.py
+4
-4
dream/simulation/MachineManagedJob.py
dream/simulation/MachineManagedJob.py
+3
-3
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+3
-3
dream/simulation/QueueManagedJob.py
dream/simulation/QueueManagedJob.py
+3
-3
No files found.
dream/simulation/CoreObject.py
View file @
06b7c16e
...
...
@@ -355,13 +355,13 @@ class CoreObject(Process):
if
not
receiver
.
assignedOperator
:
if
any
(
type
==
'Load'
or
type
==
'Setup'
for
type
in
receiver
.
multOperationTypeList
):
from
Globals
import
G
if
not
G
.
Router
sList
[
0
]
.
invoked
:
if
not
G
.
Router
.
invoked
:
#===================================================================
# # TESTING
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G
.
Router
sList
[
0
]
.
invoked
=
True
G
.
Router
sList
[
0
]
.
isCalled
.
signal
(
now
())
G
.
Router
.
invoked
=
True
G
.
Router
.
isCalled
.
signal
(
now
())
return
False
except
:
pass
...
...
dream/simulation/Globals.py
View file @
06b7c16e
...
...
@@ -73,6 +73,10 @@ class G:
numberOfEntities
=
0
#object that routes the operators in the model
#------------------------------------------------------------------------
Router
=
None
# -----------------------------------------------------------------------
# define the lists of each object type
# -----------------------------------------------------------------------
...
...
@@ -96,7 +100,6 @@ class G:
OperatorManagedJobsList
=
[]
OperatorPoolsList
=
[]
BrokersList
=
[]
RoutersList
=
[]
OperatedMachineList
=
[]
BatchScrapMachineList
=
[]
OrderDecompositionList
=
[]
...
...
dream/simulation/Machine.py
View file @
06b7c16e
...
...
@@ -134,13 +134,13 @@ class Machine(CoreObject):
if
(
self
.
operatorPool
!=
'None'
):
self
.
broker
=
Broker
(
self
)
from
Globals
import
G
# if there is no router
in G.RouterList
if
len
(
G
.
RoutersList
)
==
0
:
# if there is no router
if
not
G
.
Router
:
self
.
router
=
Router
()
G
.
Router
sList
.
append
(
self
.
router
)
G
.
Router
=
self
.
router
# otherwise set the already existing router as the machines Router
else
:
self
.
router
=
G
.
Router
sList
[
0
]
self
.
router
=
G
.
Router
# lists to hold statistics of multiple runs
self
.
WaitingForOperator
=
[]
self
.
WaitingForLoadOperator
=
[]
...
...
dream/simulation/MachineManagedJob.py
View file @
06b7c16e
...
...
@@ -58,13 +58,13 @@ class MachineManagedJob(MachineJobShop):
#create a Router
# TODO: this is already performed in __init__ of Machine
from
Globals
import
G
if
len
(
G
.
RoutersList
)
==
0
:
if
not
G
.
Router
:
self
.
router
=
Router
()
activate
(
self
.
router
,
self
.
router
.
run
())
G
.
Router
sList
.
append
(
self
.
router
)
G
.
Router
=
self
.
router
# otherwise set the already existing router as the machines Router
else
:
self
.
router
=
G
.
Router
sList
[
0
]
self
.
router
=
G
.
Router
# holds the Entity that is to be obtained and will be updated by canAcceptAndIsRequested
self
.
entityToGet
=
None
...
...
dream/simulation/OperatedPoolBroker.py
View file @
06b7c16e
...
...
@@ -87,13 +87,13 @@ class Broker(ObjectInterruption):
# add the currentEntity to the pendingEntities
if
not
self
.
victim
.
currentEntity
in
G
.
pendingEntities
:
G
.
pendingEntities
.
append
(
self
.
victim
.
currentEntity
)
if
not
G
.
Router
sList
[
0
]
.
invoked
:
if
not
G
.
Router
.
invoked
:
#===========================================================
# testing
# print now(), self.victim.id, 'broker', ' '*50, 'signalling router'
#===========================================================
G
.
Router
sList
[
0
]
.
invoked
=
True
G
.
Router
sList
[
0
]
.
isCalled
.
signal
(
now
())
G
.
Router
.
invoked
=
True
G
.
Router
.
isCalled
.
signal
(
now
())
self
.
waitForOperator
=
True
# print now(), self.victim.id, 'broker waits till resource is available1'
...
...
dream/simulation/QueueManagedJob.py
View file @
06b7c16e
...
...
@@ -139,13 +139,13 @@ class QueueManagedJob(QueueJobShop):
if
any
(
type
==
'Load'
or
type
==
'Setup'
for
type
in
receiver
.
multOperationTypeList
):
if
receiver
.
identifyEntityToGet
().
manager
.
isAssignedTo
()
!=
receiver
:
from
Globals
import
G
if
not
G
.
Router
sList
[
0
]
.
invoked
:
if
not
G
.
Router
.
invoked
:
#===================================================================
# # TESTING
# print now(), self.id,' '*50, 'signalling router'
#===================================================================
G
.
Router
sList
[
0
]
.
invoked
=
True
G
.
Router
sList
[
0
]
.
isCalled
.
signal
(
now
())
G
.
Router
.
invoked
=
True
G
.
Router
.
isCalled
.
signal
(
now
())
return
False
except
:
pass
...
...
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