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
80eca556
Commit
80eca556
authored
Oct 17, 2013
by
Georgios Dagkakis
Committed by
Sebastien Robin
Nov 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LineGenerationCMSD.py updated to match the new argument notation for the Machine
parent
80aed260
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
48 deletions
+45
-48
dream/simulation/CMSDInputs/Topology03.xml
dream/simulation/CMSDInputs/Topology03.xml
+6
-33
dream/simulation/LineGenerationCMSD.py
dream/simulation/LineGenerationCMSD.py
+39
-15
No files found.
dream/simulation/CMSDInputs/Topology03.xml
View file @
80eca556
...
...
@@ -114,20 +114,6 @@
</Property>
</Property>
</Resource>
************************************Resource Q1***********************************************
<Resource>
<Identifier>
Q1
</Identifier>
<Description>
The queue of the topology
</Description>
<ResourceType>
other
</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>
Queue
</ResourceClassIdentifier>
</ResourceClass>
<Name>
Q1
</Name>
<Property>
<Name>
capacity
</Name>
<Value>
1
</Value>
</Property>
</Resource>
**********************************Resource M2***************************************************
<Resource>
<Identifier>
M2
</Identifier>
...
...
@@ -233,10 +219,10 @@
<ProcessIdentifier>
A020
</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>
A0
4
0
</ProcessIdentifier>
<ProcessIdentifier>
A0
3
0
</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>
A0
5
0
</ProcessIdentifier>
<ProcessIdentifier>
A0
4
0
</ProcessIdentifier>
</Process>
</SubProcessGroup>
</Process>
...
...
@@ -267,8 +253,7 @@
<ResourceIdentifier>
S1
</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
</Process>
<Process>
<Identifier>
A020
</Identifier>
<Description>
Process 2
</Description>
...
...
@@ -278,22 +263,10 @@
<ResourceIdentifier>
M1
</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
</Process>
<Process>
<Identifier>
A030
</Identifier>
<Description>
Process 3
</Description>
<ResourcesRequired>
<Description>
Queue1.
</Description>
<Resource>
<ResourceIdentifier>
Q1
</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>
A040
</Identifier>
<Description>
Process 4
</Description>
<ResourcesRequired>
<Description>
Machine2.
</Description>
<Resource>
...
...
@@ -303,8 +276,8 @@
</Process>
<Process>
<Identifier>
A0
5
0
</Identifier>
<Description>
Process
5
</Description>
<Identifier>
A0
4
0
</Identifier>
<Description>
Process
4
</Description>
<ResourcesRequired>
<Description>
Exit.
</Description>
<Resource>
...
...
dream/simulation/LineGenerationCMSD.py
View file @
80eca556
...
...
@@ -25,10 +25,33 @@ Created on 27 May 2013
main script. Reads data from the CMSD xml files that Panos creates,
generates and runs the simulation and prints the results to excel
'''
from
warnings
import
warn
import
logging
logger
=
logging
.
getLogger
(
"dream.platform"
)
from
SimPy.Simulation
import
*
try
:
import
scipy
except
ImportError
:
class
scipy
:
class
stats
:
@
staticmethod
def
bayes_mvs
(
*
args
,
**
kw
):
warn
(
"Scipy is missing, using fake implementation"
)
serie
,
confidence
=
args
import
numpy
mean
=
numpy
.
mean
(
serie
),
(
numpy
.
min
(
serie
),
numpy
.
max
(
serie
))
var
=
0
,
(
0
,
0
)
std
=
0
,
(
0
,
0
)
return
mean
,
var
,
std
import
sys
sys
.
modules
[
'scipy.stats'
]
=
scipy
.
stats
sys
.
modules
[
'scipy'
]
=
scipy
logger
.
error
(
"Scipy cannot be imported, using dummy implementation"
)
from
SimPy.Simulation
import
activate
,
initialize
,
simulate
,
now
,
infinity
from
Globals
import
G
from
Source
import
Source
from
Globals
import
G
from
Machine
import
Machine
from
Exit
import
Exit
from
Queue
import
Queue
...
...
@@ -39,13 +62,16 @@ from Frame import Frame
from
Assembly
import
Assembly
from
Dismantle
import
Dismantle
from
Conveyer
import
Conveyer
from
Job
import
Job
from
MachineJobShop
import
MachineJobShop
from
QueueJobShop
import
QueueJobShop
from
ExitJobShop
import
ExitJobShop
import
xlwt
import
xlrd
import
time
import
numpy
as
np
import
json
from
random
import
Random
import
sys
import
os.path
from
xml.dom.minidom
import
parseString
from
xml.dom.minidom
import
parse
...
...
@@ -215,8 +241,9 @@ def readResources():
if
(
G
.
RepairmanList
[
j
].
id
==
repairmanID
):
repairman
=
G
.
RepairmanList
[
j
]
M
=
Machine
(
id
,
name
,
1
,
distributionType
,
[
mean
,
stdev
,
min
,
max
],
failureDistribution
,
MTTF
,
MTTR
,
availability
,
repairman
)
M
=
Machine
(
id
,
name
,
1
,
distribution
=
distributionType
,
failureDistribution
=
failureDistribution
,
MTTF
=
MTTF
,
MTTR
=
MTTR
,
availability
=
availability
,
repairman
=
repairman
,
mean
=
mean
,
stdev
=
stdev
,
min
=
min
,
max
=
max
)
G
.
MachineList
.
append
(
M
)
G
.
ObjList
.
append
(
M
)
...
...
@@ -380,17 +407,16 @@ def main():
G
.
ObjList
=
[]
#user inputs the id of the JSON file
topologyId
=
raw_input
(
"give the
topology id
\
n
"
)
topologyId
=
raw_input
(
"give the
path to the CMSD file
\
n
"
)
try
:
#G.CMSDFile=open('CMSDInputs/Topology01.xml', "r")
G
.
CMSDFile
=
open
(
'CMSDInputs/Topology'
+
str
(
topologyId
)
+
'.xml'
,
"r"
)
G
.
CMSDFile
=
open
(
str
(
topologyId
),
"r"
)
except
IOError
:
print
"no such
topology
file. The programm is terminated"
print
"no such file. The programm is terminated"
sys
.
exit
()
start
=
time
.
time
()
#start counting execution time
#read the input from the
JSON
file and create the line
#read the input from the
CMSD
file and create the line
G
.
InputData
=
G
.
CMSDFile
.
read
()
G
.
CMSDData
=
parseString
(
G
.
InputData
)
readGeneralInput
()
...
...
@@ -405,12 +431,10 @@ def main():
for
i
in
range
(
G
.
numberOfReplications
):
print
"start run number "
+
str
(
i
+
1
)
G
.
seed
+=
1
G
.
Rnd
=
Random
(
G
.
seed
)
G
.
Rnd
=
Random
(
G
.
seed
)
initialize
()
#initialize the simulation
initializeObjects
()
activateObjects
()
activateObjects
()
simulate
(
until
=
G
.
maxSimTime
)
#start the simulation
#carry on the post processing operations for every object in the topology
...
...
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