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
b006e043
Commit
b006e043
authored
Sep 05, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'doc4' into newULMaster
parents
9f26c736
2d2c36e5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
1 deletion
+81
-1
ManPy_documentation.doc
ManPy_documentation.doc
+0
-0
ManPy_documentation.pdf
ManPy_documentation.pdf
+0
-0
dream/simulation/Examples/NonStarvingLine.py
dream/simulation/Examples/NonStarvingLine.py
+30
-0
dream/simulation/Examples/NonStarvingLineBatches.py
dream/simulation/Examples/NonStarvingLineBatches.py
+30
-0
dream/simulation/imports.py
dream/simulation/imports.py
+1
-0
dream/tests/testSimulationExamples.py
dream/tests/testSimulationExamples.py
+20
-1
No files found.
ManPy_documentation.doc
View file @
b006e043
No preview for this file type
ManPy_documentation.pdf
View file @
b006e043
No preview for this file type
dream/simulation/Examples/NonStarvingLine.py
0 → 100644
View file @
b006e043
from
dream.simulation.imports
import
Machine
,
NonStarvingEntry
,
Exit
,
Part
from
dream.simulation.Globals
import
runSimulation
#define the objects of the model
NS
=
NonStarvingEntry
(
'NS1'
,
'Entry'
,
entityData
=
{
'_class'
:
'Dream.Part'
})
M
=
Machine
(
'M1'
,
'Machine'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
1
})
E
=
Exit
(
'E1'
,
'Exit'
)
#define predecessors and successors for the objects
NS
.
defineRouting
(
successorList
=
[
M
])
M
.
defineRouting
(
predecessorList
=
[
NS
],
successorList
=
[
E
])
E
.
defineRouting
(
predecessorList
=
[
M
])
def
main
():
# add all the objects in a list
objectList
=
[
NS
,
M
,
E
]
# set the length of the experiment
maxSimTime
=
10
# call the runSimulation giving the objects and the length of the experiment
runSimulation
(
objectList
,
maxSimTime
)
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
working_ratio
=
(
M
.
totalWorkingTime
/
maxSimTime
)
*
100
print
"the total working ratio of the Machine is"
,
working_ratio
,
"%"
return
{
"parts"
:
E
.
numOfExits
,
"working_ratio"
:
working_ratio
}
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
dream/simulation/Examples/NonStarvingLineBatches.py
0 → 100644
View file @
b006e043
from
dream.simulation.imports
import
BatchScrapMachine
,
NonStarvingEntry
,
Exit
,
Part
from
dream.simulation.Globals
import
runSimulation
#define the objects of the model
NS
=
NonStarvingEntry
(
'NS1'
,
'Entry'
,
entityData
=
{
'_class'
:
'Dream.Batch'
,
'numberOfUnits'
:
100
})
M
=
BatchScrapMachine
(
'M1'
,
'Machine'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.02
})
E
=
Exit
(
'E1'
,
'Exit'
)
#define predecessors and successors for the objects
NS
.
defineRouting
(
successorList
=
[
M
])
M
.
defineRouting
(
predecessorList
=
[
NS
],
successorList
=
[
E
])
E
.
defineRouting
(
predecessorList
=
[
M
])
def
main
():
# add all the objects in a list
objectList
=
[
NS
,
M
,
E
]
# set the length of the experiment
maxSimTime
=
10
# call the runSimulation giving the objects and the length of the experiment
runSimulation
(
objectList
,
maxSimTime
)
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"batches"
working_ratio
=
(
M
.
totalWorkingTime
/
maxSimTime
)
*
100
print
"the total working ratio of the Machine is"
,
working_ratio
,
"%"
return
{
"batches"
:
E
.
numOfExits
,
"working_ratio"
:
working_ratio
}
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
dream/simulation/imports.py
View file @
b006e043
...
...
@@ -56,6 +56,7 @@ from dream.simulation.QueueManagedJob import QueueManagedJob
from
dream.simulation.MouldAssembly
import
MouldAssembly
from
dream.simulation.MouldAssemblyBuffer
import
MouldAssemblyBuffer
from
dream.simulation.OrderDecomposition
import
OrderDecomposition
from
dream.simulation.NonStarvingEntry
import
NonStarvingEntry
#Entities
from
dream.simulation.Job
import
Job
...
...
dream/tests/testSimulationExamples.py
View file @
b006e043
...
...
@@ -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