Commit 97d3b955 authored by Georgios Dagkakis's avatar Georgios Dagkakis

lineGenerationCMSD.py was added. This is a main script that reads from the...

lineGenerationCMSD.py was added. This is a main script that reads from the CMSD like xml files made by panos. Tested in topologies 01, 03,04 and 06. To test in more Topologies we have to find how CMSD models parallel stations
parent 93fbc6af
<CMSDDocument xmlns="urn:cmsd:main"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:cmsd:main main.xsd">
<!--<CMSDDocument>-->
<DataSection>
<ResourceClass>
<Identifier>Source</Identifier>
<Description>This element describes a class of entrance</Description>
<ResourceType>other</ResourceType>
<Name>RawMaterial</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Machine</Identifier>
<Description>This element describes a class of machines</Description>
<ResourceType>machine</ResourceType>
<Name>Machine</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Queue</Identifier>
<Description>This element describes a class of queues</Description>
<ResourceType>other</ResourceType>
<Name>Queue</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Repairman</Identifier>
<Description>This element describes a class of employees</Description>
<ResourceType>employee</ResourceType>
<Name>W1</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Exit</Identifier>
<Description>This element describes a class of exit</Description>
<ResourceType>other</ResourceType>
<Name>Stock</Name>
</ResourceClass>
<PartType>
<Identifier>Part</Identifier>
</PartType>
<PartType>
<Identifier>UnfinishedPart1</Identifier>
</PartType>
************************************************Resource S1*****************************************
<Resource>
<Identifier>S1</Identifier>
<Description>The source of the topology</Description>
<ResourceType>other</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Source</ResourceClassIdentifier>
</ResourceClass>
<Name>RawMaterial</Name>
<Property>
<Name>interarrivalTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>0.5</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>partType</Name>
<Value>Part</Value>
</Property>
</Resource>
********************************Resource M1******************************************************
<Resource>
<Identifier>M1</Identifier>
<Description>The lathe of the topology</Description>
<ResourceType>machine</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Machine</ResourceClassIdentifier>
</ResourceClass>
<Name>Machine1</Name>
<Property>
<Name>ProcessTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>0.25</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToFailure</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>60</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToRepair</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>5</Value>
</DistributionParameter>
</Distribution>
<Property>
<Name>RepairmanRequired</Name>
<ResourcesRequired>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</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>
<Description>The moulding machine of the topology</Description>
<ResourceType>machine</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Machine</ResourceClassIdentifier>
</ResourceClass>
<Name>Machine2</Name>
<Property>
<Name>ProcessTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>1.5</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToFailure</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>40</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToRepair</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>10</Value>
</DistributionParameter>
</Distribution>
<Property>
<ResourcesRequired>
<Name>RepairmanRequired</Name>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</Property>
</Property>
</Resource>
****************************************Resource Exit ****************************************
<Resource>
<Identifier>E1</Identifier>
<Description>The exit of the topology</Description>
<ResourceType>other</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Exit</ResourceClassIdentifier>
</ResourceClass>
<Name>Stock</Name>
</Resource>
****************************************Resource Repairman**************************************
<Resource>
<Identifier>W1</Identifier>
<ResourceType>employee</ResourceType>
<Name>Bob</Name>
<ResourceClass>
<ResourceClassIdentifier>Repairman</ResourceClassIdentifier>
</ResourceClass>
<Property>
<Name>capacity</Name>
<Value>1</Value>
</Property>
</Resource>
********************************Process Plan*****************************************************
<ProcessPlan>
<Identifier>ProcessPlan:Part1</Identifier>
<PartsProduced>
<Description>The part produced the process</Description>
<PartType>
<PartTypeIdentifier>Part1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>The part(s) consumed the process</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<FirstProcess>
<ProcessIdentifier>MainProcessSequence</ProcessIdentifier>
</FirstProcess>
<Process>
<Identifier>MainProcessSequence</Identifier>
<RepetitionCount>1</RepetitionCount>
<SubProcessGroup>
<Type>sequence</Type>
<Process>
<ProcessIdentifier>A010</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A020</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A030</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A040</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A050</ProcessIdentifier>
</Process>
</SubProcessGroup>
</Process>
***********************************************Process************************************************
<Process>
<Identifier>A010</Identifier>
<Description>Process 1</Description>
<PartsProduced>
<Description>The part produced the process. Production resources have
transformed the part in some way, but it is not yet finished. If it is not
important to track unfinished part forms between processes, the
PartsProduced and PartsProduced information can be left out.</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>The part that is an input to this process</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<ResourcesRequired>
<Description>Source.</Description>
<Resource>
<ResourceIdentifier>S1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>A020</Identifier>
<Description>Process 2</Description>
<ResourcesRequired>
<Description>Machine1.</Description>
<Resource>
<ResourceIdentifier>M1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</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>
<ResourceIdentifier>M2</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>A050</Identifier>
<Description>Process 5</Description>
<ResourcesRequired>
<Description>Exit.</Description>
<Resource>
<ResourceIdentifier>E1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
</ProcessPlan>
</DataSection>
</CMSDDocument>
\ No newline at end of file
<CMSDDocument xmlns="urn:cmsd:main"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:cmsd:main main.xsd">
<!--<CMSDDocument>-->
<DataSection>
<ResourceClass>
<Identifier>Source</Identifier>
<Description>This element describes a class of entrance</Description>
<ResourceType>other</ResourceType>
<Name>RawMaterial</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Machine</Identifier>
<Description>This element describes a class of machines</Description>
<ResourceType>machine</ResourceType>
<Name>Machine</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Queue</Identifier>
<Description>This element describes a class of queues</Description>
<ResourceType>other</ResourceType>
<Name>Queue</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Repairman</Identifier>
<Description>This element describes a class of employees</Description>
<ResourceType>employee</ResourceType>
<Name>W1</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Exit</Identifier>
<Description>This element describes a class of exit</Description>
<ResourceType>other</ResourceType>
<Name>Stock</Name>
</ResourceClass>
<PartType>
<Identifier>Part</Identifier>
</PartType>
<PartType>
<Identifier>UnfinishedPart1</Identifier>
</PartType>
************************************************Resource S1*****************************************
<Resource>
<Identifier>S1</Identifier>
<Description>The source of the topology</Description>
<ResourceType>other</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Source</ResourceClassIdentifier>
</ResourceClass>
<Name>RawMaterial</Name>
<Property>
<Name>interarrivalTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>0.5</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>partType</Name>
<Value>Part</Value>
</Property>
</Resource>
********************************Resource M1******************************************************
<Resource>
<Identifier>M1</Identifier>
<Description>The lathe of the topology</Description>
<ResourceType>machine</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Machine</ResourceClassIdentifier>
</ResourceClass>
<Name>Machine1</Name>
<Property>
<Name>ProcessTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>0.25</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToFailure</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>60</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToRepair</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>5</Value>
</DistributionParameter>
</Distribution>
<Property>
<Name>RepairmanRequired</Name>
<ResourcesRequired>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</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>
<Description>The moulding machine of the topology</Description>
<ResourceType>machine</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Machine</ResourceClassIdentifier>
</ResourceClass>
<Name>Machine2</Name>
<Property>
<Name>ProcessTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>1.5</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToFailure</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>40</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToRepair</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>10</Value>
</DistributionParameter>
</Distribution>
<Property>
<ResourcesRequired>
<Name>RepairmanRequired</Name>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</Property>
</Property>
</Resource>
****************************************Resource Exit ****************************************
<Resource>
<Identifier>E1</Identifier>
<Description>The exit of the topology</Description>
<ResourceType>other</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Exit</ResourceClassIdentifier>
</ResourceClass>
<Name>Stock</Name>
</Resource>
****************************************Resource Repairman**************************************
<Resource>
<Identifier>W1</Identifier>
<ResourceType>employee</ResourceType>
<Name>Bob</Name>
<ResourceClass>
<ResourceClassIdentifier>Repairman</ResourceClassIdentifier>
</ResourceClass>
<Property>
<Name>capacity</Name>
<Value>1</Value>
</Property>
</Resource>
********************************Process Plan*****************************************************
<ProcessPlan>
<Identifier>ProcessPlan:Part1</Identifier>
<PartsProduced>
<Description>The part produced the process</Description>
<PartType>
<PartTypeIdentifier>Part1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>The part(s) consumed the process</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<FirstProcess>
<ProcessIdentifier>MainProcessSequence</ProcessIdentifier>
</FirstProcess>
<Process>
<Identifier>MainProcessSequence</Identifier>
<RepetitionCount>1</RepetitionCount>
<SubProcessGroup>
<Type>sequence</Type>
<Process>
<ProcessIdentifier>A010</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A020</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A040</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A050</ProcessIdentifier>
</Process>
</SubProcessGroup>
</Process>
***********************************************Process************************************************
<Process>
<Identifier>A010</Identifier>
<Description>Process 1</Description>
<PartsProduced>
<Description>The part produced the process. Production resources have
transformed the part in some way, but it is not yet finished. If it is not
important to track unfinished part forms between processes, the
PartsProduced and PartsProduced information can be left out.</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>The part that is an input to this process</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<ResourcesRequired>
<Description>Source.</Description>
<Resource>
<ResourceIdentifier>S1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>A020</Identifier>
<Description>Process 2</Description>
<ResourcesRequired>
<Description>Machine1.</Description>
<Resource>
<ResourceIdentifier>M1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</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>
<ResourceIdentifier>M2</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>A050</Identifier>
<Description>Process 5</Description>
<ResourcesRequired>
<Description>Exit.</Description>
<Resource>
<ResourceIdentifier>E1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
</ProcessPlan>
</DataSection>
</CMSDDocument>
\ No newline at end of file
<CMSDDocument xmlns="urn:cmsd:main"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:cmsd:main main.xsd">
<!--<CMSDDocument>-->
<DataSection>
<ResourceClass>
<Identifier>Source</Identifier>
<Description>This element describes a class of entrance</Description>
<ResourceType>other</ResourceType>
<Name>RawMaterial</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Machine</Identifier>
<Description>This element describes a class of machines</Description>
<ResourceType>machine</ResourceType>
<Name>Machine</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Queue</Identifier>
<Description>This element describes a class of queues</Description>
<ResourceType>other</ResourceType>
<Name>Queue</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Repairman</Identifier>
<Description>This element describes a class of employees</Description>
<ResourceType>employee</ResourceType>
<Name>W1</Name>
</ResourceClass>
<ResourceClass>
<Identifier>Exit</Identifier>
<Description>This element describes a class of exit</Description>
<ResourceType>other</ResourceType>
<Name>Stock</Name>
</ResourceClass>
<PartType>
<Identifier>Part</Identifier>
</PartType>
<PartType>
<Identifier>UnfinishedPart1</Identifier>
</PartType>
************************************************Resource S1*****************************************
<Resource>
<Identifier>S1</Identifier>
<Description>The source of the topology</Description>
<ResourceType>other</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Source</ResourceClassIdentifier>
</ResourceClass>
<Name>RawMaterial</Name>
<Property>
<Name>interarrivalTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>0.5</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>partType</Name>
<Value>Part</Value>
</Property>
</Resource>
********************************Resource M1******************************************************
<Resource>
<Identifier>M1</Identifier>
<Description>The lathe of the topology</Description>
<ResourceType>machine</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Machine</ResourceClassIdentifier>
</ResourceClass>
<Name>Machine1</Name>
<Property>
<Name>ProcessTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>0.25</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToFailure</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>60</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToRepair</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>5</Value>
</DistributionParameter>
</Distribution>
<Property>
<Name>RepairmanRequired</Name>
<ResourcesRequired>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</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>
<Description>The moulding machine of the topology</Description>
<ResourceType>machine</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Machine</ResourceClassIdentifier>
</ResourceClass>
<Name>Machine2</Name>
<Property>
<Name>ProcessTime</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>1.5</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToFailure</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>40</Value>
</DistributionParameter>
</Distribution>
</Property>
<Property>
<Name>MeanTimeToRepair</Name>
<Unit>minutes</Unit>
<Distribution>
<Name>Fixed</Name>
<DistributionParameter>
<Name>mean</Name>
<Value>10</Value>
</DistributionParameter>
</Distribution>
<Property>
<ResourcesRequired>
<Name>RepairmanRequired</Name>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</Property>
</Property>
</Resource>
****************************************Resource Exit ****************************************
<Resource>
<Identifier>E1</Identifier>
<Description>The exit of the topology</Description>
<ResourceType>other</ResourceType>
<ResourceClass>
<ResourceClassIdentifier>Exit</ResourceClassIdentifier>
</ResourceClass>
<Name>Stock</Name>
</Resource>
****************************************Resource Repairman**************************************
<Resource>
<Identifier>W1</Identifier>
<ResourceType>employee</ResourceType>
<Name>Bob</Name>
<ResourceClass>
<ResourceClassIdentifier>Repairman</ResourceClassIdentifier>
</ResourceClass>
<Property>
<Name>capacity</Name>
<Value>1</Value>
</Property>
</Resource>
********************************Process Plan*****************************************************
<ProcessPlan>
<Identifier>ProcessPlan:Part1</Identifier>
<PartsProduced>
<Description>The part produced the process</Description>
<PartType>
<PartTypeIdentifier>Part1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>The part(s) consumed the process</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<FirstProcess>
<ProcessIdentifier>MainProcessSequence</ProcessIdentifier>
</FirstProcess>
<Process>
<Identifier>MainProcessSequence</Identifier>
<RepetitionCount>1</RepetitionCount>
<SubProcessGroup>
<Type>sequence</Type>
<Process>
<ProcessIdentifier>A010</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A040</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A030</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A020</ProcessIdentifier>
</Process>
<Process>
<ProcessIdentifier>A050</ProcessIdentifier>
</Process>
</SubProcessGroup>
</Process>
***********************************************Process************************************************
<Process>
<Identifier>A010</Identifier>
<Description>Process 1</Description>
<PartsProduced>
<Description>The part produced the process. Production resources have
transformed the part in some way, but it is not yet finished. If it is not
important to track unfinished part forms between processes, the
PartsProduced and PartsProduced information can be left out.</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>The part that is an input to this process</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<ResourcesRequired>
<Description>Source.</Description>
<Resource>
<ResourceIdentifier>S1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>A020</Identifier>
<Description>Process 2</Description>
<ResourcesRequired>
<Description>Machine1.</Description>
<Resource>
<ResourceIdentifier>M1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</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>
<ResourceIdentifier>M2</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
<Process>
<Identifier>A050</Identifier>
<Description>Process 5</Description>
<ResourcesRequired>
<Description>Exit.</Description>
<Resource>
<ResourceIdentifier>E1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
</Process>
</ProcessPlan>
</DataSection>
</CMSDDocument>
\ No newline at end of file
This diff is collapsed.
......@@ -7,7 +7,6 @@ Created on 23 May 2013
Models a conveyer object
it gathers entities and transfers them with a certain speed
'''
from SimPy.Simulation import *
import xlwt
import scipy.stats as stat
......@@ -63,6 +62,9 @@ class Conveyer(Process):
self.timeLastMoveHappened=0 #holds the last time that the move was performed (in reality it is
#continues, in simulation we have to handle it as discrete)
self.justDisposed=False
self.timeToReachEnd=-1
self.justReachedEnd=False
def run(self):
#these are just for the first Entity
......@@ -70,15 +72,19 @@ class Conveyer(Process):
self.getEntity() #get the entity
self.timeLastMoveHappened=now()
while 1:
if(len(self.position)>0 and (not self.length==self.position[0])):
self.timeToReachEnd=now()*60.0+self.speed/(self.length-self.position[0])
print now(), "timeToReachEnd=",self.timeToReachEnd/60.0
activate(self,self.reachedEnd())
yield waituntil, self, self.somethingHappened #wait for an important event in order to move the items
#print now()
self.moveEntities()
if self.canAcceptAndIsRequested():
print now(), ":canAcceptAndIsRequested"
self.getEntity()
if self.waitToDispose:
#yield waituntil, self, self.entityJustDisposed
#self.justDisposed=False
pass
print now(), ":waitToDispose"
continue
'''
now we have to wait until something happens. The things that are important are (may be not a full list)
one item reaches the end
......@@ -187,10 +193,22 @@ class Conveyer(Process):
else:
return False
'''
def reachedEnd(self):
print "-"*50
yield waituntil, self, self.somethingHappened #wait for an important event in order to move the items
def somethingHappened(self):
return self.canAcceptAndIsRequested() or self.entityJustReachedEnd()
print now()
if(len(self.position)>0):
if(self.timeToReachEnd==now() and (not self.position[0]==self.length)):
self.waitToDispose==True
return True
else:
return self.canAcceptAndIsRequested()
else:
return self.canAcceptAndIsRequested()
#checks if the Conveyer is requested by the predecessor
def isRequested(self):
return self.previous[0].haveToDispose
......
......@@ -139,7 +139,7 @@ class Exit(Process):
except ZeroDivisionError:
G.outputSheet.write(G.outputIndex,1,0)
G.outputIndex+=1
G.outputSheet.write(G.outputIndex,0, "The average tatk time in "+ self.objName +" is:")
G.outputSheet.write(G.outputIndex,0, "The average takt time in "+ self.objName +" is:")
try:
G.outputSheet.write(G.outputIndex,1,((self.totalTaktTime)/self.numOfExits)/G.Base)
except ZeroDivisionError:
......
......@@ -55,15 +55,12 @@ class Failure(Process):
def run(self):
while 1:
#yield hold,self,self.calcTimeToFailure()
yield hold,self,self.rngTTF.generateNumber() #wait until a failure happens
try:
#print self.name
if(len(self.victim.Res.activeQ)>0):
self.interrupt(self.victim) #when a Machine gets failure while in process it is interrupted
self.victim.Up=False
self.victim.timeLastFailure=now()
#print str(now())+":M"+str(self.victim.id)+" is down"
self.victim.timeLastFailure=now()
self.outputTrace("is down")
except AttributeError:
......@@ -77,8 +74,6 @@ class Failure(Process):
timeRepairStarted=now()
self.repairman.timeLastRepairStarted=now()
#yield hold,self,self.calcTimeToRepair() #wait until the repairing process is over
yield hold,self,self.rngTTR.generateNumber() #wait until the repairing process is over
self.victim.totalFailureTime+=now()-failTime
......@@ -86,37 +81,12 @@ class Failure(Process):
if(len(self.victim.Res.activeQ)>0):
reactivate(self.victim) #since repairing is over, the Machine is reactivated
self.victim.Up=True
#print str(now())+":M"+str(self.victim.id)+" is up"
self.outputTrace("is up")
if(self.repairman!="None"): #if a resource was used, it is now released
yield release,self,self.repairman.Res
self.repairman.totalWorkingTime+=now()-timeRepairStarted
#print "reactivating "+str(self.victim.currentEntity)
except AttributeError:
print "AttributeError2"
'''
#calculates the time until the next failure
def calcTimeToFailure(self):
from Globals import G
if self.distType=="Fixed": #in a fixed distribution every TTF should be equal to MTTF
TTF=self.MTTF
elif self.distType=="Availability": #if we have availability defined, TTF should follow the exponential distribution
TTF=G.Rnd.expovariate(float(1)/self.AvailabilityMTTF)
#print self.name+" TTF="+str(TTF)
return TTF
#calculates the time that it is needed for the repair
def calcTimeToRepair(self):
from Globals import G
if self.distType=="Fixed": #in a fixed distribution every TTR should be equal to MTTR
TTR=self.MTTR
elif self.distType=="Availability": #if we have availability defined, TTR should follow the Erlang distribution
TTR=G.Rnd.gammavariate(self.alpha,self.beta)
#print self.name+" TTR="+str(TTR)
return TTR
'''
#outputs message to the trace.xls. Format is (Simulation Time | Machine Name | message)
def outputTrace(self, message):
......@@ -134,7 +104,6 @@ class Failure(Process):
G.sheetIndex+=1
G.traceSheet=G.traceFile.add_sheet('sheet '+str(G.sheetIndex), cell_overwrite_ok=True)
#outputs data to "output.xls"
def outputResultsXL(self, MaxSimtime):
pass
\ No newline at end of file
......@@ -2,7 +2,7 @@
"general": {
"_class": "Dream.Configuration",
"numberOfReplications": "1",
"maxSimTime": "60",
"maxSimTime": "5",
"trace": "Yes",
"confidenceLevel": "0.95"
},
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment