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
49fb857e
Commit
49fb857e
authored
Jun 13, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MacnineManagedJob inherits and modifies methods create- and initializeOperatorPool/Broker/Router
parent
4348df01
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
11 deletions
+39
-11
dream/simulation/MachineManagedJob.py
dream/simulation/MachineManagedJob.py
+39
-11
No files found.
dream/simulation/MachineManagedJob.py
View file @
49fb857e
...
...
@@ -45,36 +45,64 @@ class MachineManagedJob(MachineJobShop):
def
initialize
(
self
):
MachineJobShop
.
initialize
(
self
)
self
.
type
=
"MachineManagedJob"
# holds the Entity that is to be obtained and will be updated by canAcceptAndIsRequested
self
.
entityToGet
=
None
#===========================================================================
# create an operatorPool if needed
#===========================================================================
def
createOperatorPool
(
self
,
operatorPool
):
#create an empty Operator Pool. This will be updated by canAcceptAndIsRequested
id
=
self
.
id
+
'_OP'
name
=
self
.
objName
+
'_operatorPool'
self
.
operatorPool
=
OperatorPool
(
id
,
name
,
operatorsList
=
[])
from
Globals
import
G
G
.
OperatorPoolsList
.
append
(
self
.
operatorPool
)
self
.
operatorPool
.
initialize
()
self
.
operatorPool
.
operators
=
[]
#===========================================================================
# create broker if needed
#===========================================================================
def
createBroker
(
self
):
#create a Broker
self
.
broker
=
Broker
(
self
)
self
.
broker
.
initialize
()
self
.
env
.
process
(
self
.
broker
.
run
())
# activate(self.broker,self.broker.run())
#===========================================================================
# create router if needed
#===========================================================================
def
createRouter
(
self
):
#create a Router
# TODO: this is already performed in __init__ of Machine
from
Globals
import
G
if
not
G
.
Router
:
self
.
router
=
Router
()
self
.
router
.
initialize
()
G
.
Router
=
self
.
router
# otherwise set the already existing router as the machines Router
else
:
self
.
router
=
G
.
Router
#===========================================================================
# initialize broker if needed
#===========================================================================
def
initializeOperatorPool
(
self
):
self
.
operatorPool
.
initialize
()
self
.
operatorPool
.
operators
=
[]
#===========================================================================
# initialize broker if needed
#===========================================================================
def
initializeBroker
(
self
):
self
.
broker
.
initialize
()
self
.
env
.
process
(
self
.
broker
.
run
())
#===========================================================================
# initialize router if needed
#===========================================================================
def
initializeRouter
(
self
):
if
not
self
.
router
.
isInitialized
:
self
.
router
.
initialize
()
if
not
self
.
router
.
isActivated
:
self
.
env
.
process
(
self
.
router
.
run
())
self
.
router
.
isActivated
=
True
# holds the Entity that is to be obtained and will be updated by canAcceptAndIsRequested
self
.
entityToGet
=
None
# =======================================================================
# checks if the Queue can accept an entity
# TODO: cannot check here if the station in the route of the entity that will be received (if any)
...
...
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