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
623ed13b
Commit
623ed13b
authored
Sep 09, 2014
by
Ioannis Papagiannopoulos
Committed by
Georgios Dagkakis
Nov 03, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jobShop objects make use of expectedSignals dict
parent
14bb3fc6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
dream/simulation/MachineJobShop.py
dream/simulation/MachineJobShop.py
+3
-2
dream/simulation/MouldAssemblyBuffer.py
dream/simulation/MouldAssemblyBuffer.py
+3
-2
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+8
-0
No files found.
dream/simulation/MachineJobShop.py
View file @
623ed13b
...
@@ -292,8 +292,9 @@ class MachineJobShop(Machine):
...
@@ -292,8 +292,9 @@ class MachineJobShop(Machine):
self
.
receiver
.
timeLastEntityEnded
=
self
.
env
.
now
#required to count blockage correctly in the preemptied station
self
.
receiver
.
timeLastEntityEnded
=
self
.
env
.
now
#required to count blockage correctly in the preemptied station
# TODO: use a signal and wait for it, reactivation is not recognised as interruption
# TODO: use a signal and wait for it, reactivation is not recognised as interruption
# reactivate(self)
# reactivate(self)
succeedTuple
=
(
self
,
self
.
env
.
now
)
if
self
.
expectedSignals
[
'preemptQueue'
]:
self
.
preemptQueue
.
succeed
(
succeedTuple
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
preemptQueue
.
succeed
(
succeedTuple
)
# TODO: consider the case when a failure has the Station down. The event preempt will not be received now()
# TODO: consider the case when a failure has the Station down. The event preempt will not be received now()
# but at a later simulation time.
# but at a later simulation time.
...
...
dream/simulation/MouldAssemblyBuffer.py
View file @
623ed13b
...
@@ -110,8 +110,9 @@ class MouldAssemblyBuffer(QueueManagedJob):
...
@@ -110,8 +110,9 @@ class MouldAssemblyBuffer(QueueManagedJob):
for
secondary
in
[
x
for
x
in
activeEntity
.
order
.
secondaryComponentsList
if
activeEntity
.
order
.
basicsEnded
]:
for
secondary
in
[
x
for
x
in
activeEntity
.
order
.
secondaryComponentsList
if
activeEntity
.
order
.
basicsEnded
]:
if
secondary
.
currentStation
.
__class__
.
__name__
==
'ConditionalBuffer'
:
if
secondary
.
currentStation
.
__class__
.
__name__
==
'ConditionalBuffer'
:
# print now(), self.id, ' signalling conditional buffer'
# print now(), self.id, ' signalling conditional buffer'
succeedTuple
=
(
self
,
self
.
env
.
now
)
if
secondary
.
currentStation
.
expectedSignals
[
'canDispose'
]:
secondary
.
currentStation
.
canDispose
.
succeed
(
succeedTuple
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
secondary
.
currentStation
.
canDispose
.
succeed
(
succeedTuple
)
break
break
# for all the components that have the same parent Order as the activeEntity
# for all the components that have the same parent Order as the activeEntity
activeEntity
.
order
.
componentsReadyForAssembly
=
1
activeEntity
.
order
.
componentsReadyForAssembly
=
1
...
...
dream/simulation/OrderDecomposition.py
View file @
623ed13b
...
@@ -72,6 +72,10 @@ class OrderDecomposition(CoreObject):
...
@@ -72,6 +72,10 @@ class OrderDecomposition(CoreObject):
self
.
initialSignalReceiver
()
self
.
initialSignalReceiver
()
while
1
:
while
1
:
#wait until the Queue can accept an entity and one predecessor requests it
#wait until the Queue can accept an entity and one predecessor requests it
self
.
expectedSignals
[
'isRequested'
]
=
1
self
.
expectedSignals
[
'canDispose'
]
=
1
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
canDispose
])
receivedEvent
=
yield
self
.
env
.
any_of
([
self
.
isRequested
,
self
.
canDispose
])
# if the event that activated the thread is isRequested then getEntity
# if the event that activated the thread is isRequested then getEntity
if
self
.
isRequested
in
receivedEvent
:
if
self
.
isRequested
in
receivedEvent
:
...
@@ -84,6 +88,10 @@ class OrderDecomposition(CoreObject):
...
@@ -84,6 +88,10 @@ class OrderDecomposition(CoreObject):
if
self
.
canDispose
in
receivedEvent
:
if
self
.
canDispose
in
receivedEvent
:
transmitter
,
eventTime
=
self
.
canDispose
.
value
transmitter
,
eventTime
=
self
.
canDispose
.
value
self
.
canDispose
=
self
.
env
.
event
()
self
.
canDispose
=
self
.
env
.
event
()
self
.
expectedSignals
[
'isRequested'
]
=
0
self
.
expectedSignals
[
'canDispose'
]
=
0
# if the event that activated the thread is canDispose then signalReceiver
# if the event that activated the thread is canDispose then signalReceiver
if
self
.
haveToDispose
():
if
self
.
haveToDispose
():
# print now(), self.id, 'will try to signal a receiver from generator'
# print now(), self.id, 'will try to signal a receiver from generator'
...
...
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