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
Show 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):
...
@@ -319,7 +319,7 @@ class CoreObject(object):
#if the receiver does not hold an Entity that is also critical
#if the receiver does not hold an Entity that is also critical
if
not
receiver
.
Res
.
users
[
0
].
isCritical
:
if
not
receiver
.
Res
.
users
[
0
].
isCritical
:
receiver
.
shouldPreempt
=
True
receiver
.
shouldPreempt
=
True
#
self.printTrace(self.id, preempt=receiver.id)
self
.
printTrace
(
self
.
id
,
preempt
=
receiver
.
id
)
receiver
.
preempt
()
receiver
.
preempt
()
receiver
.
timeLastEntityEnded
=
self
.
env
.
now
#required to count blockage correctly in the preemptied station
receiver
.
timeLastEntityEnded
=
self
.
env
.
now
#required to count blockage correctly in the preemptied station
# sort so that the critical entity is placed in front
# 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
...
@@ -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
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
OperatedPoolBroker
import
Broker
from
OperatorPool
import
OperatorPool
from
OperatorPool
import
OperatorPool
...
@@ -54,13 +55,15 @@ class MachineManagedJob(MachineJobShop):
...
@@ -54,13 +55,15 @@ class MachineManagedJob(MachineJobShop):
self
.
operatorPool
.
operators
=
[]
self
.
operatorPool
.
operators
=
[]
#create a Broker
#create a Broker
self
.
broker
=
Broker
(
self
)
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
#create a Router
# TODO: this is already performed in __init__ of Machine
# TODO: this is already performed in __init__ of Machine
from
Globals
import
G
from
Globals
import
G
if
not
G
.
Router
:
if
not
G
.
Router
:
self
.
router
=
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
G
.
Router
=
self
.
router
# otherwise set the already existing router as the machines Router
# otherwise set the already existing router as the machines Router
else
:
else
:
...
@@ -189,4 +192,3 @@ class MachineManagedJob(MachineJobShop):
...
@@ -189,4 +192,3 @@ class MachineManagedJob(MachineJobShop):
# maybe we should work this way in all CoreObjects???
# maybe we should work this way in all CoreObjects???
return
self
.
entityToGet
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
...
@@ -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
TODOs: check the case when a mould is already in the WIP by the beginning of the simulation
'''
'''
from
MachineManagedJob
import
MachineManagedJob
from
MachineManagedJob
import
MachineManagedJob
from
SimPy.Simulation
import
Resource
,
reactivate
,
now
# from SimPy.Simulation import Resource, reactivate, now
import
simpy
from
Globals
import
G
from
Globals
import
G
# =======================================================================
# =======================================================================
...
@@ -151,7 +152,7 @@ class MouldAssembly(MachineManagedJob):
...
@@ -151,7 +152,7 @@ class MouldAssembly(MachineManagedJob):
def
updateCapacity
(
self
,
capacity
):
def
updateCapacity
(
self
,
capacity
):
activeObject
=
self
.
getActiveObject
()
activeObject
=
self
.
getActiveObject
()
self
.
capacity
=
capacity
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
# assemble method that assembles the components together to a mould (order
...
@@ -271,6 +272,6 @@ class MouldAssembly(MachineManagedJob):
...
@@ -271,6 +272,6 @@ class MouldAssembly(MachineManagedJob):
M
.
initialize
()
M
.
initialize
()
except
:
except
:
# added for testing
# 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
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