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
2e97a98e
Commit
2e97a98e
authored
Sep 17, 2013
by
Georgios Dagkakis
Committed by
Sebastien Robin
Sep 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Machine postProcessing method changed to accomodate better machines with multiple connections
parent
351faa1e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
dream/simulation/Machine.py
dream/simulation/Machine.py
+13
-6
No files found.
dream/simulation/Machine.py
View file @
2e97a98e
...
...
@@ -280,14 +280,20 @@ class Machine(CoreObject):
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
alreadyAdded
=
False
#a flag that shows if the blockage time has already been added
#checks all the successors. If no one can accept an Entity then the machine might be blocked
mightBeBlocked
=
True
for
nextObject
in
self
.
next
:
if
nextObject
.
canAccept
():
mightBeBlocked
=
False
#if there is an entity that finished processing in a Machine but did not get to reach
#the following Object
#till the end of simulation, we have to add this blockage to the percentage of blockage in Machine
#we should exclude the failure time in current entity though!
if
(
len
(
self
.
Res
.
activeQ
)
>
0
)
and
(
len
(
self
.
next
[
0
].
Res
.
activeQ
)
>
0
)
and
((
self
.
nameLastEntityEntered
==
self
.
nameLastEntityEnded
)):
#if (len(self.Res.activeQ)>0) and (len(self.next[0].Res.activeQ)>0) and ((self.nameLastEntityEntered == self.nameLastEntityEnded)):
if
(
len
(
self
.
Res
.
activeQ
)
>
0
)
and
(
mightBeBlocked
)
and
((
self
.
nameLastEntityEntered
==
self
.
nameLastEntityEnded
)):
self
.
totalBlockageTime
+=
now
()
-
(
self
.
timeLastEntityEnded
+
self
.
downTimeInTryingToReleaseCurrentEntity
)
if
self
.
Up
==
False
:
self
.
totalBlockageTime
-=
now
()
-
self
.
timeLastFailure
...
...
@@ -305,8 +311,9 @@ class Machine(CoreObject):
if
(
self
.
Up
==
False
):
self
.
totalFailureTime
+=
now
()
-
self
.
timeLastFailure
#we add the value only if it hasn't already been added
if
((
len
(
self
.
next
[
0
].
Res
.
activeQ
)
>
0
)
and
(
self
.
nameLastEntityEnded
==
self
.
nameLastEntityEntered
)
and
(
not
alreadyAdded
)):
#self.totalBlockageTime+=self.timeLastFailure-self.timeLastEntityEnded
#if((len(self.next[0].Res.activeQ)>0) and (self.nameLastEntityEnded==self.nameLastEntityEntered) and (not alreadyAdded)):
if
((
self
.
nameLastEntityEnded
==
self
.
nameLastEntityEntered
)
and
(
not
alreadyAdded
)):
print
"in"
self
.
totalBlockageTime
+=
(
now
()
-
self
.
timeLastEntityEnded
)
-
(
now
()
-
self
.
timeLastFailure
)
-
self
.
downTimeInTryingToReleaseCurrentEntity
#Machine was idle when it was not in any other state
...
...
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