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
c95ce840
Commit
c95ce840
authored
Oct 23, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
impose M1 not to receive when in state 0
parent
3f959fe6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
dream/simulation/Examples/OperationalFailures.py
dream/simulation/Examples/OperationalFailures.py
+6
-3
No files found.
dream/simulation/Examples/OperationalFailures.py
View file @
c95ce840
...
...
@@ -11,7 +11,7 @@ start=time.time()
maxSimTime
=
10000
# the capacity of B123
capacity
=
float
(
'inf'
)
capacity
=
3
#
float('inf')
class
OpQueue
(
Queue
):
# allow to be locked between the time periods
...
...
@@ -130,8 +130,11 @@ def controllerMethod():
i
=
0
while
(
len
(
M1
.
getActiveObjectQueue
())
and
(
not
M1
.
state
==
0
))
\
or
(
len
(
M2
.
getActiveObjectQueue
())
and
(
not
M2
.
state
==
0
)):
# define the giver based on the state of the machines also
if
(
len
(
M1
.
getActiveObjectQueue
())
and
(
not
M1
.
state
==
0
)):
B123
.
giver
=
M1
else
:
B123
.
giver
=
M2
yield
G
.
env
.
timeout
(
0
)
if
len
(
B123
.
getActiveObjectQueue
())
==
B123
.
capacity
:
break
...
...
@@ -140,9 +143,9 @@ def controllerMethod():
# unlock M1 and M2 and let parts get from NS1 to M1 and from NS2 to M2
M1
.
locked
=
False
M2
.
locked
=
False
if
len
(
M1
.
getActiveObjectQueue
())
==
0
:
if
(
len
(
M1
.
getActiveObjectQueue
())
==
0
)
and
(
not
M1
.
state
==
0
)
:
Controller
.
sendSignal
(
sender
=
NS1
,
receiver
=
M1
,
signal
=
M1
.
isRequested
)
if
len
(
M2
.
getActiveObjectQueue
())
==
0
:
if
(
len
(
M2
.
getActiveObjectQueue
())
==
0
)
and
(
not
M2
.
state
==
0
)
:
Controller
.
sendSignal
(
sender
=
NS2
,
receiver
=
M2
,
signal
=
M2
.
isRequested
)
while
1
:
yield
G
.
env
.
timeout
(
0
)
...
...
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