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
d32d1371
Commit
d32d1371
authored
May 29, 2014
by
Ioannis Papagiannopoulos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MachineManagedJob and MouldAssembly updated
parent
3cacf8ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+1
-1
dream/simulation/MachineManagedJob.py
dream/simulation/MachineManagedJob.py
+6
-4
dream/simulation/MouldAssembly.py
dream/simulation/MouldAssembly.py
+4
-3
No files found.
dream/simulation/CoreObject.py
View file @
d32d1371
...
...
@@ -319,7 +319,7 @@ class CoreObject(object):
#if the receiver does not hold an Entity that is also critical
if
not
receiver
.
Res
.
users
[
0
].
isCritical
:
receiver
.
shouldPreempt
=
True
#
self.printTrace(self.id, preempt=receiver.id)
self
.
printTrace
(
self
.
id
,
preempt
=
receiver
.
id
)
receiver
.
preempt
()
receiver
.
timeLastEntityEnded
=
self
.
env
.
now
#required to count blockage correctly in the preemptied station
# sort so that the critical entity is placed in front
...
...
dream/simulation/MachineManagedJob.py
View file @
d32d1371
...
...
@@ -26,7 +26,8 @@ inherits from MachineJobShop. The difference is that it reads the operator from
checks if he is available before it takes it
'''
from
SimPy.Simulation
import
Process
,
Resource
,
activate
,
now
# from SimPy.Simulation import Process, Resource, activate, now
import
simpy
from
OperatedPoolBroker
import
Broker
from
OperatorPool
import
OperatorPool
...
...
@@ -54,13 +55,15 @@ class MachineManagedJob(MachineJobShop):
self
.
operatorPool
.
operators
=
[]
#create a Broker
self
.
broker
=
Broker
(
self
)
activate
(
self
.
broker
,
self
.
broker
.
run
())
self
.
env
.
process
(
self
.
broker
.
run
())
# activate(self.broker,self.broker.run())
#create a Router
# TODO: this is already performed in __init__ of Machine
from
Globals
import
G
if
not
G
.
Router
:
self
.
router
=
Router
()
activate
(
self
.
router
,
self
.
router
.
run
())
self
.
env
.
process
(
self
.
router
.
run
())
# activate(self.router,self.router.run())
G
.
Router
=
self
.
router
# otherwise set the already existing router as the machines Router
else
:
...
...
@@ -188,5 +191,4 @@ class MachineManagedJob(MachineJobShop):
# ToDecide
# maybe we should work this way in all CoreObjects???
return
self
.
entityToGet
dream/simulation/MouldAssembly.py
View file @
d32d1371
...
...
@@ -62,7 +62,8 @@ There is no need to assign an exit, exit is assigned automatically by the create
TODOs: check the case when a mould is already in the WIP by the beginning of the simulation
'''
from
MachineManagedJob
import
MachineManagedJob
from
SimPy.Simulation
import
Resource
,
reactivate
,
now
# from SimPy.Simulation import Resource, reactivate, now
import
simpy
from
Globals
import
G
# =======================================================================
...
...
@@ -151,7 +152,7 @@ class MouldAssembly(MachineManagedJob):
def
updateCapacity
(
self
,
capacity
):
activeObject
=
self
.
getActiveObject
()
self
.
capacity
=
capacity
self
.
Res
=
Resource
(
self
.
capacity
)
self
.
Res
=
simpy
.
Resource
(
self
.
env
,
self
.
capacity
)
# =======================================================================
# assemble method that assembles the components together to a mould (order
...
...
@@ -271,6 +272,6 @@ class MouldAssembly(MachineManagedJob):
M
.
initialize
()
except
:
# added for testing
print
'the mould to be created'
,
component
.
get
(
'name'
,
'not found'
),
'cannot be created'
,
'time'
,
now
()
print
'the mould to be created'
,
component
.
get
(
'name'
,
'not found'
),
'cannot be created'
,
'time'
,
self
.
env
.
now
raise
\ No newline at end of file
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