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
f16c3dd9
Commit
f16c3dd9
authored
Sep 05, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for the new examples
parent
73ecc520
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
dream/simulation/Examples/NonStarvingLineBatches.py
dream/simulation/Examples/NonStarvingLineBatches.py
+2
-2
dream/tests/testSimulationExamples.py
dream/tests/testSimulationExamples.py
+20
-1
No files found.
dream/simulation/Examples/NonStarvingLineBatches.py
View file @
f16c3dd9
...
...
@@ -20,10 +20,10 @@ def main():
runSimulation
(
objectList
,
maxSimTime
)
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"
part
s"
print
"the system produced"
,
E
.
numOfExits
,
"
batche
s"
working_ratio
=
(
M
.
totalWorkingTime
/
maxSimTime
)
*
100
print
"the total working ratio of the Machine is"
,
working_ratio
,
"%"
return
{
"
part
s"
:
E
.
numOfExits
,
return
{
"
batche
s"
:
E
.
numOfExits
,
"working_ratio"
:
working_ratio
}
if
__name__
==
'__main__'
:
...
...
dream/tests/testSimulationExamples.py
View file @
f16c3dd9
...
...
@@ -195,4 +195,23 @@ class SimulationExamples(TestCase):
result
=
main
()
self
.
assertEquals
(
result
[
'parts'
],
10
)
self
.
assertEquals
(
result
[
'simulationTime'
],
36.0
)
self
.
assertTrue
(
83.32
<
result
[
"working_ratio"
]
<
83.34
)
\ No newline at end of file
self
.
assertTrue
(
83.32
<
result
[
"working_ratio"
]
<
83.34
)
def
testSettingWip3
(
self
):
from
dream.simulation.Examples.SettingWip3
import
main
result
=
main
()
self
.
assertEquals
(
result
[
'parts'
],
2
)
self
.
assertEquals
(
result
[
'simulationTime'
],
0.35
)
self
.
assertEquals
(
result
[
"working_ratio"
],
100
)
def
testNonStarvingLine
(
self
):
from
dream.simulation.Examples.NonStarvingLine
import
main
result
=
main
()
self
.
assertEquals
(
result
[
'parts'
],
9
)
self
.
assertEquals
(
result
[
"working_ratio"
],
100
)
def
testNonStarvingLineBatches
(
self
):
from
dream.simulation.Examples.NonStarvingLineBatches
import
main
result
=
main
()
self
.
assertEquals
(
result
[
'batches'
],
4
)
self
.
assertEquals
(
result
[
"working_ratio"
],
100
)
\ No newline at end of file
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