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
20e93ba0
Commit
20e93ba0
authored
Sep 10, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
objects do not have to set flags to 0
parent
ecb52198
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
19 additions
and
93 deletions
+19
-93
dream/simulation/BatchDecomposition.py
dream/simulation/BatchDecomposition.py
+3
-15
dream/simulation/BatchReassembly.py
dream/simulation/BatchReassembly.py
+1
-14
dream/simulation/CapacityStationController.py
dream/simulation/CapacityStationController.py
+2
-6
dream/simulation/Dismantle.py
dream/simulation/Dismantle.py
+1
-8
dream/simulation/Failure.py
dream/simulation/Failure.py
+4
-14
dream/simulation/Machine.py
dream/simulation/Machine.py
+1
-6
dream/simulation/OperatedPoolBroker.py
dream/simulation/OperatedPoolBroker.py
+4
-11
dream/simulation/OperatorRouter.py
dream/simulation/OperatorRouter.py
+1
-3
dream/simulation/OperatorRouterManaged.py
dream/simulation/OperatorRouterManaged.py
+1
-3
dream/simulation/OrderDecomposition.py
dream/simulation/OrderDecomposition.py
+0
-3
dream/simulation/ScheduledMaintenance.py
dream/simulation/ScheduledMaintenance.py
+0
-4
dream/simulation/ShiftScheduler.py
dream/simulation/ShiftScheduler.py
+0
-1
dream/simulation/SkilledOperatorRouter.py
dream/simulation/SkilledOperatorRouter.py
+1
-5
No files found.
dream/simulation/BatchDecomposition.py
View file @
20e93ba0
...
...
@@ -101,9 +101,7 @@ class BatchDecomposition(CoreObject):
self
.
expectedSignals
[
'interruptionEnd'
]
=
1
yield
self
.
interruptionEnd
self
.
expectedSignals
[
'interruptionEnd'
]
=
0
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
assert
self
==
transmitter
,
'the victim of the failure is not the object that received the interruptionEnd event'
self
.
interruptionEnd
=
self
.
env
.
event
()
...
...
@@ -122,11 +120,7 @@ class BatchDecomposition(CoreObject):
assert
requestingObject
==
self
.
giver
,
'the giver is not the requestingObject'
self
.
isRequested
=
self
.
env
.
event
()
break
self
.
expectedSignals
[
'isRequested'
]
=
0
self
.
expectedSignals
[
'interruptionStart'
]
=
0
self
.
expectedSignals
[
'initialWIP'
]
=
0
if
not
self
.
isProcessingInitialWIP
:
# if we are in the state of having initial wip no need to take an Entity
self
.
currentEntity
=
self
.
getEntity
()
...
...
@@ -169,8 +163,6 @@ class BatchDecomposition(CoreObject):
yield
self
.
entityRemoved
self
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
waitEntityRemoval
=
False
break
...
...
@@ -190,17 +182,13 @@ class BatchDecomposition(CoreObject):
self
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
self
.
entityRemoved
self
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
waitEntityRemoval
=
False
break
self
.
entityRemoved
=
self
.
env
.
event
()
self
.
expectedSignals
[
'canDispose'
]
=
0
# =======================================================================
# removes an entity from the Machine
# =======================================================================
...
...
dream/simulation/BatchReassembly.py
View file @
20e93ba0
...
...
@@ -96,8 +96,6 @@ class BatchReassembly(CoreObject):
yield
self
.
interruptionEnd
self
.
expectedSignals
[
'interruptionEnd'
]
=
0
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
assert
self
==
transmitter
,
'the victim of the failure is not the object that received the interruptionEnd event'
self
.
interruptionEnd
=
self
.
env
.
event
()
...
...
@@ -118,10 +116,6 @@ class BatchReassembly(CoreObject):
self
.
isProcessingInitialWIP
=
False
break
self
.
expectedSignals
[
'isRequested'
]
=
0
self
.
expectedSignals
[
'interruptionStart'
]
=
0
self
.
expectedSignals
[
'initialWIP'
]
=
0
if
not
self
.
isProcessingInitialWIP
:
# if we are in the state of having initial wip no need to take an Entity
self
.
currentEntity
=
self
.
getEntity
()
...
...
@@ -163,8 +157,6 @@ class BatchReassembly(CoreObject):
yield
self
.
interruptionEnd
# interruptionEnd to be triggered by ObjectInterruption
self
.
expectedSignals
[
'interruptionEnd'
]
=
0
transmitter
,
eventTime
=
self
.
interruptionEnd
.
value
assert
eventTime
==
self
.
env
.
now
,
'the victim of the failure is not the object that received it'
self
.
interruptionEnd
=
self
.
env
.
event
()
...
...
@@ -201,8 +193,6 @@ class BatchReassembly(CoreObject):
yield
self
.
entityRemoved
self
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
self
.
entityRemoved
.
value
self
.
printTrace
(
self
.
id
,
entityRemoved
=
eventTime
)
assert
eventTime
==
self
.
env
.
now
,
'entityRemoved event activated earlier than received'
...
...
@@ -211,10 +201,7 @@ class BatchReassembly(CoreObject):
# if while waiting (for a canDispose event) became free as the machines that follows emptied it, then proceed
if
not
self
.
haveToDispose
():
break
self
.
expectedSignals
[
'interruptionStart'
]
=
0
self
.
expectedSignals
[
'canDispose'
]
=
0
# =======================================================================
# removes an entity from the Machine
# =======================================================================
...
...
dream/simulation/CapacityStationController.py
View file @
20e93ba0
...
...
@@ -70,9 +70,7 @@ class CapacityStationController(EventGenerator):
station
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
station
.
entityRemoved
station
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
station
.
entityRemoved
.
value
station
.
waitEntityRemoval
=
False
exit
.
currentlyObtainedEntities
.
append
(
entity
)
...
...
@@ -129,9 +127,7 @@ class CapacityStationController(EventGenerator):
buffer
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
buffer
.
entityRemoved
buffer
.
expectedSignals
[
'entityRemoved'
]
=
0
transmitter
,
eventTime
=
buffer
.
entityRemoved
.
value
buffer
.
waitEntityRemoval
=
False
buffer
.
entityRemoved
=
self
.
env
.
event
()
...
...
dream/simulation/Dismantle.py
View file @
20e93ba0
...
...
@@ -130,9 +130,6 @@ class Dismantle(CoreObject):
self
.
expectedSignals
[
'isRequested'
]
=
1
yield
self
.
isRequested
#[self.isRequested,self.canDispose, self.loadOperatorAvailable]
self
.
expectedSignals
[
'isRequested'
]
=
0
if
self
.
isRequested
.
value
:
# self.printTrace(self.id, isRequested=self.isRequested.value.id)
# reset the isRequested signal parameter
...
...
@@ -176,9 +173,6 @@ class Dismantle(CoreObject):
self
.
expectedSignals
[
'entityRemoved'
]
=
1
yield
self
.
entityRemoved
self
.
expectedSignals
[
'entityRemoved'
]
=
0
self
.
waitEntityRemoval
=
False
self
.
entityRemoved
=
self
.
env
.
event
()
...
...
@@ -189,8 +183,7 @@ class Dismantle(CoreObject):
if
self
.
isEmpty
():
self
.
waitToDisposeFrame
=
False
#the Dismantle has no Frame to dispose now
break
self
.
expectedSignals
[
'canDispose'
]
=
0
#===========================================================================
# checks if the Dismantle can accept an entity and there is a Frame
...
...
dream/simulation/Failure.py
View file @
20e93ba0
...
...
@@ -126,18 +126,14 @@ class Failure(ObjectInterruption):
self
.
expectedSignals
[
'victimOnShift'
]
=
1
yield
self
.
victimOnShift
self
.
expectedSignals
[
'victimOnShift'
]
=
0
self
.
isWaitingForVictimOnShift
=
False
self
.
victimOnShift
=
self
.
env
.
event
()
assert
self
.
victim
.
onShift
==
True
,
'the victim of shiftFailure must be onShift to continue counting the TTF'
else
:
self
.
isWaitingForVictimOffShift
=
False
failureNotTriggered
=
False
self
.
expectedSignals
[
'victimOffShift'
]
=
0
# if time to failure counts only in working time
elif
self
.
deteriorationType
==
'working'
:
# wait for victim to start process
...
...
@@ -145,9 +141,7 @@ class Failure(ObjectInterruption):
self
.
expectedSignals
[
'victimStartsProcess'
]
=
1
yield
self
.
victimStartsProcess
self
.
expectedSignals
[
'victimStartsProcess'
]
=
0
self
.
victimStartsProcess
=
self
.
env
.
event
()
while
failureNotTriggered
:
timeRestartedCounting
=
self
.
env
.
now
...
...
@@ -163,15 +157,11 @@ class Failure(ObjectInterruption):
self
.
expectedSignals
[
'victimStartsProcess'
]
=
1
yield
self
.
victimStartsProcess
self
.
expectedSignals
[
'victimStartsProcess'
]
=
0
# wait for victim to start again processing
self
.
victimStartsProcess
=
self
.
env
.
event
()
else
:
failureNotTriggered
=
False
self
.
expectedSignals
[
'victimEndsProcess'
]
=
0
# interrupt the victim
self
.
interruptVictim
()
# interrupt the victim
...
...
dream/simulation/Machine.py
View file @
20e93ba0
...
...
@@ -427,12 +427,7 @@ class Machine(CoreObject):
self
.
loadOperatorWaitTimeCurrentEntity
=
0
self
.
loadTimeCurrentEntity
=
0
self
.
setupTimeCurrentEntity
=
0
self
.
expectedSignals
[
'isRequested'
]
=
0
self
.
expectedSignals
[
'interruptionEnd'
]
=
0
self
.
expectedSignals
[
'loadOperatorAvailable'
]
=
0
self
.
expectedSignals
[
'initialWIP'
]
=
0
# ======= request a resource
if
(
self
.
operatorPool
!=
"None"
)
and
any
(
type
==
'Load'
for
type
in
self
.
multOperationTypeList
):
# when it's ready to accept (canAcceptAndIsRequested) then inform the broker
...
...
dream/simulation/OperatedPoolBroker.py
View file @
20e93ba0
...
...
@@ -75,9 +75,7 @@ class Broker(ObjectInterruption):
self
.
expectedSignals
[
'isCalled'
]
=
1
yield
self
.
isCalled
self
.
expectedSignals
[
'isCalled'
]
=
0
transmitter
,
eventTime
=
self
.
isCalled
.
value
assert
eventTime
==
self
.
env
.
now
,
'the broker should be granted control instantly'
self
.
isCalled
=
self
.
env
.
event
()
...
...
@@ -109,9 +107,7 @@ class Broker(ObjectInterruption):
self
.
expectedSignals
[
'resourceAvailable'
]
=
1
yield
self
.
resourceAvailable
self
.
expectedSignals
[
'resourceAvailable'
]
=
0
transmitter
,
eventTime
=
self
.
resourceAvailable
.
value
self
.
resourceAvailable
=
self
.
env
.
event
()
# remove the currentEntity from the pendingEntities
...
...
@@ -127,9 +123,7 @@ class Broker(ObjectInterruption):
self
.
expectedSignals
[
'resourceAvailable'
]
=
1
yield
self
.
resourceAvailable
self
.
expectedSignals
[
'resourceAvailable'
]
=
0
transmitter
,
eventTime
=
self
.
resourceAvailable
.
value
self
.
resourceAvailable
=
self
.
env
.
event
()
self
.
waitForOperator
=
False
...
...
@@ -162,8 +156,7 @@ class Broker(ObjectInterruption):
self
.
expectedSignals
[
'isCalled'
]
=
1
yield
self
.
isCalled
self
.
expectedSignals
[
'isCalled'
]
=
0
transmitter
,
eventTime
=
self
.
isCalled
.
value
assert
eventTime
==
self
.
env
.
now
,
'the broker should be granted control instantly'
self
.
isCalled
=
self
.
env
.
event
()
...
...
dream/simulation/OperatorRouter.py
View file @
20e93ba0
...
...
@@ -110,9 +110,7 @@ class Router(ObjectInterruption):
self
.
expectedSignals
[
'isCalled'
]
=
1
yield
self
.
isCalled
self
.
expectedSignals
[
'isCalled'
]
=
0
transmitter
,
eventTime
=
self
.
isCalled
.
value
self
.
isCalled
=
self
.
env
.
event
()
self
.
printTrace
(
''
,
'=-'
*
15
)
...
...
dream/simulation/OperatorRouterManaged.py
View file @
20e93ba0
...
...
@@ -82,9 +82,7 @@ class RouterManaged(Router):
self
.
expectedSignals
[
'isCalled'
]
=
1
yield
self
.
isCalled
self
.
expectedSignals
[
'isCalled'
]
=
0
transmitter
,
eventTime
=
self
.
isCalled
.
value
self
.
isCalled
=
self
.
env
.
event
()
self
.
printTrace
(
''
,
'=-'
*
15
)
...
...
dream/simulation/OrderDecomposition.py
View file @
20e93ba0
...
...
@@ -89,9 +89,6 @@ class OrderDecomposition(CoreObject):
transmitter
,
eventTime
=
self
.
canDispose
.
value
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
self
.
haveToDispose
():
# print now(), self.id, 'will try to signal a receiver from generator'
...
...
dream/simulation/ScheduledMaintenance.py
View file @
20e93ba0
...
...
@@ -87,8 +87,6 @@ class ScheduledMaintenance(ObjectInterruption):
yield
self
.
victim
.
endedLastProcessing
# there is no signal yet that signals the change of such state (an object getting empty)
self
.
expectedSignals
[
'endedLastProcessing'
]
=
0
transmitter
,
eventTime
=
self
.
victim
.
endedLastProcessing
.
value
assert
eventTime
==
self
.
env
.
now
,
'the processing end signal is not received by maintenance on time'
self
.
victim
.
endedLastProcessing
=
self
.
env
.
event
()
...
...
@@ -104,8 +102,6 @@ class ScheduledMaintenance(ObjectInterruption):
yield
self
.
victimIsEmptyBeforeMaintenance
# there is no signal yet that signals the change of such state (an object getting empty)
self
.
expectedSignals
[
'victimIsEmptyBeforeMaintenance'
]
=
0
transmitter
,
eventTime
=
self
.
victimIsEmptyBeforeMaintenance
.
value
assert
eventTime
==
self
.
env
.
now
,
'the processing end signal is not received by maintenance on time'
self
.
victimIsEmptyBeforeMaintenance
=
self
.
env
.
event
()
...
...
dream/simulation/ShiftScheduler.py
View file @
20e93ba0
...
...
@@ -116,7 +116,6 @@ class ShiftScheduler(ObjectInterruption):
self
.
waitingSignal
=
True
self
.
expectedSignals
[
'endedLastProcessing'
]
=
1
yield
self
.
victim
.
endedLastProcessing
self
.
expectedSignals
[
'endedLastProcessing'
]
=
0
transmitter
,
eventTime
=
self
.
victim
.
endedLastProcessing
.
value
self
.
victim
.
endedLastProcessing
=
self
.
env
.
event
()
self
.
interruptVictim
()
...
...
dream/simulation/SkilledOperatorRouter.py
View file @
20e93ba0
...
...
@@ -74,9 +74,7 @@ class SkilledRouter(Router):
self
.
expectedSignals
[
'isCalled'
]
=
1
yield
self
.
isCalled
self
.
expectedSignals
[
'isCalled'
]
=
0
transmitter
,
eventTime
=
self
.
isCalled
.
value
self
.
isCalled
=
self
.
env
.
event
()
self
.
printTrace
(
''
,
'=-'
*
15
)
...
...
@@ -137,8 +135,6 @@ class SkilledRouter(Router):
receivedEvent
=
yield
self
.
env
.
all_of
(
self
.
endProcessingSignals
)
self
.
expectedSignals
[
'endedLastProcessing'
]
=
0
for
station
in
self
.
busyStations
:
if
station
.
endedLastProcessing
in
receivedEvent
:
transmitter
,
eventTime
=
station
.
endedLastProcessing
.
value
...
...
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