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
35007c2a
Commit
35007c2a
authored
Sep 09, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all objects now reset flags of the receiver after they sent the signal. Other resets to be erased
parent
cdd097f6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
1 deletion
+16
-1
dream/simulation/MouldAssemblyBuffer.py
dream/simulation/MouldAssemblyBuffer.py
+1
-0
dream/simulation/NonStarvingEntry.py
dream/simulation/NonStarvingEntry.py
+1
-0
dream/simulation/ObjectInterruption.py
dream/simulation/ObjectInterruption.py
+2
-0
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+2
-0
dream/simulation/OperatorRouterManaged.py
dream/simulation/OperatorRouterManaged.py
+2
-0
dream/simulation/QueueManagedJob.py
dream/simulation/QueueManagedJob.py
+2
-1
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+2
-0
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+2
-0
dream/simulation/Source.py
dream/simulation/Source.py
+2
-0
No files found.
dream/simulation/MouldAssemblyBuffer.py
View file @
35007c2a
...
...
@@ -113,6 +113,7 @@ class MouldAssemblyBuffer(QueueManagedJob):
if
secondary
.
currentStation
.
expectedSignals
[
'canDispose'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
secondary
.
currentStation
.
canDispose
.
succeed
(
succeedTuple
)
secondary
.
currentStation
.
expectedSignals
[
'canDispose'
]
=
0
break
# for all the components that have the same parent Order as the activeEntity
activeEntity
.
order
.
componentsReadyForAssembly
=
1
...
...
dream/simulation/NonStarvingEntry.py
View file @
35007c2a
...
...
@@ -83,4 +83,5 @@ class NonStarvingEntry(Queue):
if
self
.
expectedSignals
[
'canDispose'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
canDispose
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'canDispose'
]
=
0
\ No newline at end of file
dream/simulation/ObjectInterruption.py
View file @
35007c2a
...
...
@@ -97,6 +97,7 @@ class ObjectInterruption(ManPyObject):
if
self
.
expectedSignals
[
'isCalled'
]:
succeedTuple
=
(
self
.
victim
,
self
.
env
.
now
)
self
.
isCalled
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'isCalled'
]
=
0
#===========================================================================
# returns the internal queue of the victim
...
...
@@ -134,6 +135,7 @@ class ObjectInterruption(ManPyObject):
if
self
.
victim
.
expectedSignals
[
'interruptionEnd'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
self
.
victim
.
interruptionEnd
.
succeed
(
succeedTuple
)
self
.
victim
.
expectedSignals
[
'interruptionEnd'
]
=
0
#reset the interruptionStart event of the victim
self
.
victim
.
interruptionStart
=
self
.
env
.
event
()
# TODO: reconsider what happens when failure and ShiftScheduler (e.g.) signal simultaneously
...
...
dream/simulation/OperatorRouter.py
View file @
35007c2a
...
...
@@ -248,6 +248,7 @@ class Router(ObjectInterruption):
self
.
printTrace
(
'router'
,
'signalling broker of'
+
' '
*
50
+
operator
.
isAssignedTo
().
id
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
station
.
broker
.
resourceAvailable
.
succeed
(
succeedTuple
)
station
.
broker
.
expectedSignals
[
'resourceAvailable'
]
=
0
else
:
# signal the queue proceeding the station
if
station
.
canAccept
()
\
...
...
@@ -256,6 +257,7 @@ class Router(ObjectInterruption):
self
.
printTrace
(
'router'
,
'signalling'
+
' '
*
50
+
operator
.
isAssignedTo
().
id
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
station
.
loadOperatorAvailable
.
succeed
(
succeedTuple
)
station
.
expectedSignals
[
'loadOperatorAvailable'
]
=
0
#===========================================================================
# clear the pending lists of the router
...
...
dream/simulation/OperatorRouterManaged.py
View file @
35007c2a
...
...
@@ -202,6 +202,7 @@ class RouterManaged(Router):
if
operator
.
isAssignedTo
().
broker
.
expectedSignals
[
'resourceAvailable'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
operator
.
isAssignedTo
().
broker
.
resourceAvailable
.
succeed
(
succeedTuple
)
operator
.
isAssignedTo
().
broker
.
expectedSignals
[
'resourceAvailable'
]
=
0
elif
(
not
station
in
self
.
pendingMachines
)
or
(
not
station
in
self
.
toBeSignalled
):
# signal the queue proceeding the station
assert
operator
.
candidateEntity
.
currentStation
in
self
.
toBeSignalled
,
'the candidateEntity currentStation is not picked by the Router'
...
...
@@ -214,6 +215,7 @@ class RouterManaged(Router):
if
operator
.
candidateEntity
.
currentStation
.
expectedSignals
[
'loadOperatorAvailable'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
operator
.
candidateEntity
.
currentStation
.
loadOperatorAvailable
.
succeed
(
succeedTuple
)
operator
.
candidateEntity
.
currentStation
.
expectedSignals
[
'loadOperatorAvailable'
]
=
0
#===========================================================================
# clear the pending lists of the router
...
...
dream/simulation/QueueManagedJob.py
View file @
35007c2a
...
...
@@ -117,11 +117,12 @@ class QueueManagedJob(QueueJobShop):
if
receiver
.
identifyEntityToGet
().
manager
.
isAssignedTo
()
!=
receiver
:
try
:
from
Globals
import
G
if
not
G
.
Router
.
invoked
:
if
not
G
.
Router
.
invoked
and
G
.
Router
.
expectedSignals
[
'isCalled'
]
:
# self.printTrace(self.id, signal='router')
G
.
Router
.
invoked
=
True
succeedTuple
=
(
G
.
env
,
G
.
env
.
now
)
G
.
Router
.
isCalled
.
succeed
(
succeedTuple
)
G
.
Router
.
expectedSignals
[
'isCalled'
]
=
0
return
True
except
:
return
False
...
...
dream/simulation/ShiftScheduler.py
View file @
35007c2a
...
...
@@ -101,6 +101,7 @@ class ShiftScheduler(ObjectInterruption):
if
oi
.
expectedSignals
[
'victimOnShift'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
oi
.
victimOnShift
.
succeed
(
succeedTuple
)
oi
.
expectedSignals
[
'victimOnShift'
]
=
0
else
:
timeToEndShift
=
float
(
self
.
remainingShiftPattern
[
0
][
1
]
-
self
.
env
.
now
)
yield
self
.
env
.
timeout
(
timeToEndShift
-
self
.
receiveBeforeEndThreshold
)
# wait until the entry threshold
...
...
@@ -139,6 +140,7 @@ class ShiftScheduler(ObjectInterruption):
if
oi
.
expectedSignals
[
'victimOffShift'
]:
succeedTuple
=
(
self
,
self
.
env
.
now
)
oi
.
victimOffShift
.
succeed
(
succeedTuple
)
oi
.
expectedSignals
[
'victimOnShift'
]
=
0
self
.
victim
.
onShift
=
False
# get the victim off-shift
...
...
dream/simulation/SkilledOperatorRouter.py
View file @
35007c2a
...
...
@@ -257,6 +257,7 @@ class SkilledRouter(Router):
self
.
printTrace
(
'router'
,
'signalling broker of'
+
' '
*
50
+
station
.
id
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
station
.
broker
.
resourceAvailable
.
succeed
(
succeedTuple
)
station
.
broker
.
expectedSignals
[
'resourceAvailable'
]
=
0
else
:
# signal the queue proceeding the station
if
station
.
canAccept
()
\
...
...
@@ -265,6 +266,7 @@ class SkilledRouter(Router):
self
.
printTrace
(
'router'
,
'signalling'
+
' '
*
50
+
station
.
id
)
succeedTuple
=
(
self
,
self
.
env
.
now
)
station
.
loadOperatorAvailable
.
succeed
(
succeedTuple
)
station
.
expectedSignals
[
'loadOperatorAvailable'
]
=
0
#===================================================================
# default behaviour
...
...
dream/simulation/Source.py
View file @
35007c2a
...
...
@@ -66,6 +66,7 @@ class EntityGenerator(object):
if
self
.
victim
.
expectedSignals
[
'entityCreated'
]:
succeedTupple
=
(
entity
,
self
.
env
.
now
)
self
.
victim
.
entityCreated
.
succeed
(
succeedTupple
)
self
.
victim
.
expectedSignals
[
'entityCreated'
]
=
0
# else put it on the time list for scheduled Entities
else
:
entityCounter
=
G
.
numberOfEntities
+
len
(
self
.
victim
.
scheduledEntities
)
# this is used just ot output the trace correctly
...
...
@@ -208,4 +209,5 @@ class Source(CoreObject):
if
self
.
expectedSignals
[
'entityCreated'
]:
succeedTuple
=
(
newEntity
,
self
.
env
.
now
)
self
.
entityCreated
.
succeed
(
succeedTuple
)
self
.
expectedSignals
[
'entityCreated'
]
=
0
return
activeEntity
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