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
bb1ebfcb
Commit
bb1ebfcb
authored
Aug 28, 2014
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3 examples added
parent
ee52c9cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
0 deletions
+110
-0
dream/simulation/Examples/SettingWip1.py
dream/simulation/Examples/SettingWip1.py
+35
-0
dream/simulation/Examples/SettingWip2.py
dream/simulation/Examples/SettingWip2.py
+37
-0
dream/simulation/Examples/SettingWip3.py
dream/simulation/Examples/SettingWip3.py
+38
-0
No files found.
dream/simulation/Examples/SettingWip1.py
0 → 100644
View file @
bb1ebfcb
from
dream.simulation.imports
import
Machine
,
Queue
,
Exit
,
Part
,
ExcelHandler
from
dream.simulation.Globals
import
runSimulation
,
G
#define the objects of the model
Q
=
Queue
(
'Q1'
,
'Queue'
,
capacity
=
1
)
M
=
Machine
(
'M1'
,
'Machine'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.25
})
E
=
Exit
(
'E1'
,
'Exit'
)
P1
=
Part
(
'P1'
,
'Part1'
)
# set the current station
P1
.
currentStation
=
Q
#define predecessors and successors for the objects
Q
.
defineRouting
(
successorList
=
[
M
])
M
.
defineRouting
(
predecessorList
=
[
Q
],
successorList
=
[
E
])
E
.
defineRouting
(
predecessorList
=
[
M
])
def
main
():
# add all the objects in a list
objectList
=
[
Q
,
M
,
E
,
P1
]
# set the length of the experiment
maxSimTime
=
float
(
'inf'
)
# call the runSimulation giving the objects and the length of the experiment
runSimulation
(
objectList
,
maxSimTime
,
trace
=
'Yes'
)
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
working_ratio
=
(
M
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the total working ratio of the Machine is"
,
working_ratio
,
"%"
ExcelHandler
.
outputTrace
(
'Wip1'
)
return
{
"parts"
:
E
.
numOfExits
,
"working_ratio"
:
working_ratio
}
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
dream/simulation/Examples/SettingWip2.py
0 → 100644
View file @
bb1ebfcb
from
dream.simulation.imports
import
Machine
,
Queue
,
Exit
,
Part
,
ExcelHandler
from
dream.simulation.Globals
import
runSimulation
,
G
#define the objects of the model
Q
=
Queue
(
'Q1'
,
'Queue'
,
capacity
=
1
)
M
=
Machine
(
'M1'
,
'Machine'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.25
})
E
=
Exit
(
'E1'
,
'Exit'
)
P1
=
Part
(
'P1'
,
'Part1'
)
P2
=
Part
(
'P2'
,
'Part2'
)
# set the current station
P1
.
currentStation
=
Q
P2
.
currentStation
=
M
#define predecessors and successors for the objects
Q
.
defineRouting
(
successorList
=
[
M
])
M
.
defineRouting
(
predecessorList
=
[
Q
],
successorList
=
[
E
])
E
.
defineRouting
(
predecessorList
=
[
M
])
def
main
():
# add all the objects in a list
objectList
=
[
Q
,
M
,
E
,
P1
,
P2
]
# set the length of the experiment
maxSimTime
=
float
(
'inf'
)
# call the runSimulation giving the objects and the length of the experiment
runSimulation
(
objectList
,
maxSimTime
,
trace
=
'Yes'
)
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
working_ratio
=
(
M
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the total working ratio of the Machine is"
,
working_ratio
,
"%"
ExcelHandler
.
outputTrace
(
'Wip2'
)
return
{
"parts"
:
E
.
numOfExits
,
"working_ratio"
:
working_ratio
}
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
dream/simulation/Examples/SettingWip3.py
0 → 100644
View file @
bb1ebfcb
from
dream.simulation.imports
import
Machine
,
Queue
,
Exit
,
Part
,
ExcelHandler
from
dream.simulation.Globals
import
runSimulation
,
G
#define the objects of the model
Q
=
Queue
(
'Q1'
,
'Queue'
,
capacity
=
1
)
M
=
Machine
(
'M1'
,
'Machine'
,
processingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.25
})
E
=
Exit
(
'E1'
,
'Exit'
)
P1
=
Part
(
'P1'
,
'Part1'
)
P2
=
Part
(
'P2'
,
'Part2'
)
# set the current station
P1
.
currentStation
=
Q
P2
.
currentStation
=
M
P2
.
remainingProcessingTime
=
{
'distributionType'
:
'Fixed'
,
'mean'
:
0.1
}
#define predecessors and successors for the objects
Q
.
defineRouting
(
successorList
=
[
M
])
M
.
defineRouting
(
predecessorList
=
[
Q
],
successorList
=
[
E
])
E
.
defineRouting
(
predecessorList
=
[
M
])
def
main
():
# add all the objects in a list
objectList
=
[
Q
,
M
,
E
,
P1
,
P2
]
# set the length of the experiment
maxSimTime
=
float
(
'inf'
)
# call the runSimulation giving the objects and the length of the experiment
runSimulation
(
objectList
,
maxSimTime
,
trace
=
'Yes'
)
#print the results
print
"the system produced"
,
E
.
numOfExits
,
"parts"
working_ratio
=
(
M
.
totalWorkingTime
/
G
.
maxSimTime
)
*
100
print
"the total working ratio of the Machine is"
,
working_ratio
,
"%"
ExcelHandler
.
outputTrace
(
'Wip3'
)
return
{
"parts"
:
E
.
numOfExits
,
"working_ratio"
:
working_ratio
}
if
__name__
==
'__main__'
:
main
()
\ 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