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
e50203c7
Commit
e50203c7
authored
Aug 31, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example written in documentation and minor amendmens on code
parent
ee20eacb
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
7 deletions
+6
-7
ManPy_documentation.doc
ManPy_documentation.doc
+0
-0
ManPy_documentation.pdf
ManPy_documentation.pdf
+0
-0
dream/simulation/Examples/CompoundMachine.py
dream/simulation/Examples/CompoundMachine.py
+6
-7
No files found.
ManPy_documentation.doc
View file @
e50203c7
No preview for this file type
ManPy_documentation.pdf
View file @
e50203c7
No preview for this file type
dream/simulation/Examples/CompoundMachine.py
View file @
e50203c7
...
@@ -36,14 +36,12 @@ class InternalProcess(Machine):
...
@@ -36,14 +36,12 @@ class InternalProcess(Machine):
# if there is one other machine processing return False
# if there is one other machine processing return False
if
object
.
isProcessing
:
if
object
.
isProcessing
:
return
False
return
False
# # if there is one other machine that got signal to dispose return false
# if object.canDispose.triggered:
# return False
return
Machine
.
haveToDispose
(
self
,
callerObject
)
return
Machine
.
haveToDispose
(
self
,
callerObject
)
# check if all the machines got empty and send signal to QB
# check if all the machines got empty and send signal to QB
def
removeEntity
(
self
,
entity
=
None
):
def
removeEntity
(
self
,
entity
=
None
):
activeEntity
=
Machine
.
removeEntity
(
self
,
entity
)
# run the default method
# run the default method
activeEntity
=
Machine
.
removeEntity
(
self
,
entity
)
# count the number of parts in the server.
# count the number of parts in the server.
# If it is empty have one internal queue to signal the queue before the compound object
# If it is empty have one internal queue to signal the queue before the compound object
if
not
self
.
countInternalParts
():
if
not
self
.
countInternalParts
():
...
@@ -54,8 +52,7 @@ class InternalProcess(Machine):
...
@@ -54,8 +52,7 @@ class InternalProcess(Machine):
def
countInternalParts
(
self
):
def
countInternalParts
(
self
):
totalParts
=
0
totalParts
=
0
for
object
in
G
.
InternalProcessList
+
G
.
InternalQueueList
:
for
object
in
G
.
InternalProcessList
+
G
.
InternalQueueList
:
if
len
(
object
.
getActiveObjectQueue
()):
totalParts
+=
len
(
object
.
getActiveObjectQueue
())
totalParts
+=
1
return
totalParts
return
totalParts
QB
=
Queue
(
'QB'
,
'QueueBefore'
,
capacity
=
float
(
"inf"
))
QB
=
Queue
(
'QB'
,
'QueueBefore'
,
capacity
=
float
(
"inf"
))
...
@@ -96,7 +93,9 @@ def main(test=0):
...
@@ -96,7 +93,9 @@ def main(test=0):
#output the trace of the simulation
#output the trace of the simulation
ExcelHandler
.
outputTrace
(
'CompoundMachine'
)
ExcelHandler
.
outputTrace
(
'CompoundMachine'
)
print
1
print
G
.
maxSimTime
if
test
:
return
G
.
maxSimTime
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
main
()
main
()
...
...
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