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
Hide 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
...
@@ -278,23 +278,29 @@ class Machine(CoreObject):
...
@@ -278,23 +278,29 @@ class Machine(CoreObject):
return
len
(
self
.
Res
.
activeQ
)
>
0
and
self
.
waitToDispose
and
self
.
Up
and
flag
return
len
(
self
.
Res
.
activeQ
)
>
0
and
self
.
waitToDispose
and
self
.
Up
and
flag
#actions to be taken after the simulation ends
#actions to be taken after the simulation ends
def
postProcessing
(
self
,
MaxSimtime
):
def
postProcessing
(
self
,
MaxSimtime
):
alreadyAdded
=
False
#a flag that shows if the blockage time has already been added
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
#if there is an entity that finished processing in a Machine but did not get to reach
#the following Object
#the following Object
#till the end of simulation, we have to add this blockage to the percentage of blockage in Machine
#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!
#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
)
self
.
totalBlockageTime
+=
now
()
-
(
self
.
timeLastEntityEnded
+
self
.
downTimeInTryingToReleaseCurrentEntity
)
if
self
.
Up
==
False
:
if
self
.
Up
==
False
:
self
.
totalBlockageTime
-=
now
()
-
self
.
timeLastFailure
self
.
totalBlockageTime
-=
now
()
-
self
.
timeLastFailure
alreadyAdded
=
True
alreadyAdded
=
True
#if Machine is currently processing an entity we should count this working time
#if Machine is currently processing an entity we should count this working time
if
(
len
(
self
.
Res
.
activeQ
)
>
0
)
and
(
not
(
self
.
nameLastEntityEnded
==
self
.
nameLastEntityEntered
)):
if
(
len
(
self
.
Res
.
activeQ
)
>
0
)
and
(
not
(
self
.
nameLastEntityEnded
==
self
.
nameLastEntityEntered
)):
#if Machine is down we should add this last failure time to the time that it has been down in current entity
#if Machine is down we should add this last failure time to the time that it has been down in current entity
if
(
len
(
self
.
Res
.
activeQ
)
>
0
)
and
(
self
.
Up
==
False
):
if
(
len
(
self
.
Res
.
activeQ
)
>
0
)
and
(
self
.
Up
==
False
):
self
.
downTimeProcessingCurrentEntity
+=
now
()
-
self
.
timeLastFailure
self
.
downTimeProcessingCurrentEntity
+=
now
()
-
self
.
timeLastFailure
...
@@ -305,8 +311,9 @@ class Machine(CoreObject):
...
@@ -305,8 +311,9 @@ class Machine(CoreObject):
if
(
self
.
Up
==
False
):
if
(
self
.
Up
==
False
):
self
.
totalFailureTime
+=
now
()
-
self
.
timeLastFailure
self
.
totalFailureTime
+=
now
()
-
self
.
timeLastFailure
#we add the value only if it hasn't already been added
#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
)):
#if((len(self.next[0].Res.activeQ)>0) and (self.nameLastEntityEnded==self.nameLastEntityEntered) and (not alreadyAdded)):
#self.totalBlockageTime+=self.timeLastFailure-self.timeLastEntityEnded
if
((
self
.
nameLastEntityEnded
==
self
.
nameLastEntityEntered
)
and
(
not
alreadyAdded
)):
print
"in"
self
.
totalBlockageTime
+=
(
now
()
-
self
.
timeLastEntityEnded
)
-
(
now
()
-
self
.
timeLastFailure
)
-
self
.
downTimeInTryingToReleaseCurrentEntity
self
.
totalBlockageTime
+=
(
now
()
-
self
.
timeLastEntityEnded
)
-
(
now
()
-
self
.
timeLastFailure
)
-
self
.
downTimeInTryingToReleaseCurrentEntity
#Machine was idle when it was not in any other state
#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