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
9a458a97
Commit
9a458a97
authored
Dec 20, 2013
by
Georgios Dagkakis
Committed by
Jérome Perrin
Jan 20, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CoreObject and Machine update in order to prepare pre-emption
parent
d7f8254c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
3 deletions
+21
-3
dream/simulation/CoreObject.py
dream/simulation/CoreObject.py
+2
-1
dream/simulation/Machine.py
dream/simulation/Machine.py
+19
-2
No files found.
dream/simulation/CoreObject.py
View file @
9a458a97
...
...
@@ -89,7 +89,8 @@ class CoreObject(Process):
self
.
totalProcessingTimeInCurrentEntity
=
0
self
.
failureTimeInCurrentEntity
=
0
self
.
setupTimeCurrentEntity
=
0
self
.
shouldPreempt
=
False
#flag that shows that the machine should preempt or not
self
.
Failure
=
[]
self
.
Working
=
[]
...
...
dream/simulation/Machine.py
View file @
9a458a97
...
...
@@ -138,10 +138,20 @@ class Machine(CoreObject):
self
.
timeLastFailureEnded
=
now
()
# set the timeLastFailureEnded
self
.
failureTimeInCurrentEntity
+=
now
()
-
breakTime
# dummy variable keeping track of the failure time
# output to trace that the Machine self.objName was passivated for the current failure time
self
.
outputTrace
(
self
.
getActiveObjectQueue
()[
0
].
name
,
"passivated in "
+
self
.
objName
+
" for "
+
str
(
now
()
-
breakTime
))
self
.
outputTrace
(
self
.
getActiveObjectQueue
()[
0
].
name
,
"passivated in "
+
self
.
objName
+
" for "
+
str
(
now
()
-
breakTime
))
#if during the interruption the object became empty break
if
(
len
(
self
.
getActiveObjectQueue
())
==
0
and
self
.
shouldPreempt
):
break
# if no interruption occurred the processing in M1 is ended
else
:
processingNotFinished
=
False
#if during the interruption the object became empty continue
if
(
len
(
self
.
getActiveObjectQueue
())
==
0
and
self
.
shouldPreempt
):
self
.
shouldPreempt
=
False
continue
# output to trace that the processing in the Machine self.objName ended
self
.
outputTrace
(
self
.
getActiveObjectQueue
()[
0
].
name
,
"ended processing in "
+
self
.
objName
)
# set the variable that flags an Entity is ready to be disposed
...
...
@@ -174,7 +184,14 @@ class Machine(CoreObject):
self
.
downTimeInTryingToReleaseCurrentEntity
+=
now
()
-
failTime
self
.
downTimeInCurrentEntity
+=
now
()
-
failTime
# already updated from failures during processing
# update the timeLastFailureEnded
self
.
timeLastFailureEnded
=
now
()
self
.
timeLastFailureEnded
=
now
()
#if during the interruption the object became empty break
if
(
len
(
self
.
getActiveObjectQueue
())
==
0
and
self
.
shouldPreempt
):
self
.
shouldPreempt
==
False
break
# =======================================================================
# checks if the machine is Up
# =======================================================================
...
...
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