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
aeb2af24
Commit
aeb2af24
authored
Mar 20, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove of code that will not be used
parent
185388f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
65 deletions
+2
-65
dream/simulation/Break.py
dream/simulation/Break.py
+2
-65
No files found.
dream/simulation/Break.py
View file @
aeb2af24
...
...
@@ -40,10 +40,6 @@ class Break(ObjectInterruption):
self
.
rngTTB
=
RandomNumberGenerator
(
self
,
distribution
.
get
(
'TTB'
,{
'Fixed'
:{
'mean'
:
100
}}))
self
.
rngTTR
=
RandomNumberGenerator
(
self
,
distribution
.
get
(
'TTR'
,{
'Fixed'
:{
'mean'
:
10
}}))
self
.
type
=
"Break"
# shows how the time to break is measured
# 'constant' means it counts not matter the state of the victim
self
.
deteriorationType
=
deteriorationType
self
.
endUnfinished
=
endUnfinished
def
initialize
(
self
):
...
...
@@ -62,67 +58,8 @@ class Break(ObjectInterruption):
# if the time that the victim is off-shift should not be counted
timeToBreak
=
self
.
rngTTB
.
generateNumber
()
remainingTimeToBreak
=
timeToBreak
breakNotTriggered
=
True
# if time to break counts not matter the state of the victim
if
self
.
deteriorationType
==
'constant'
:
yield
self
.
env
.
timeout
(
remainingTimeToBreak
)
# # if time to break counts only in onShift time
# elif self.deteriorationType=='onShift':
# while breakNotTriggered:
# timeRestartedCounting=self.env.now
# self.isWaitingForVictimOffShift=True
#
# self.expectedSignals['victimOffShift']=1
#
# receivedEvent=yield self.env.timeout(remainingTimeToBreak) | self.victimOffShift
# # the break should receive a signal if there is a shift-off triggered
# if self.victimOffShift in receivedEvent:
# assert self.victim.onShift==False, 'break cannot recalculate TTB if the victim is onShift'
# self.victimOffShift=self.env.event()
# remainingTimeToBreak=remainingTimeToBreak-(self.env.now-timeRestartedCounting)
# # wait for the shift to start again
# self.isWaitingForVictimOnShift=True
#
# self.expectedSignals['victimOnShift']=1
#
# yield self.victimOnShift
#
# self.isWaitingForVictimOnShift=False
# self.victimOnShift=self.env.event()
# assert self.victim.onShift==True, 'the victim of break must be onShift to continue counting the TTB'
# else:
# self.isWaitingForVictimOffShift=False
# breakNotTriggered=False
#
# # if time to break counts only in working time
# elif self.deteriorationType=='working':
# # wait for victim to start process
#
# self.expectedSignals['victimStartsProcess']=1
#
# yield self.victimStartsProcess
#
# self.victimStartsProcess=self.env.event()
# while breakNotTriggered:
# timeRestartedCounting=self.env.now
#
# self.expectedSignals['victimEndsProcess']=1
#
# # wait either for the break or end of process
# receivedEvent=yield self.env.timeout(remainingTimeTobreak) | self.victimEndsProcess
# if self.victimEndsProcess in receivedEvent:
# self.victimEndsProcess=self.env.event()
# remainingTimeTobreak=remainingTimeTobreak-(self.env.now-timeRestartedCounting)
#
# self.expectedSignals['victimStartsProcess']=1
#
# yield self.victimStartsProcess
#
# # wait for victim to start again processing
# self.victimStartsProcess=self.env.event()
# else:
# breakNotTriggered=False
# interrupt the victim
...
...
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