Commit eabdc79d authored by Georgios Dagkakis's avatar Georgios Dagkakis Committed by Sebastien Robin

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 071661ca
<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 ...@@ -7,7 +7,6 @@ Created on 23 May 2013
Models a conveyer object Models a conveyer object
it gathers entities and transfers them with a certain speed it gathers entities and transfers them with a certain speed
''' '''
from SimPy.Simulation import * from SimPy.Simulation import *
import xlwt import xlwt
import scipy.stats as stat import scipy.stats as stat
...@@ -63,6 +62,9 @@ class Conveyer(Process): ...@@ -63,6 +62,9 @@ class Conveyer(Process):
self.timeLastMoveHappened=0 #holds the last time that the move was performed (in reality it is 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) #continues, in simulation we have to handle it as discrete)
self.justDisposed=False self.justDisposed=False
self.timeToReachEnd=-1
self.justReachedEnd=False
def run(self): def run(self):
#these are just for the first Entity #these are just for the first Entity
...@@ -70,15 +72,19 @@ class Conveyer(Process): ...@@ -70,15 +72,19 @@ class Conveyer(Process):
self.getEntity() #get the entity self.getEntity() #get the entity
self.timeLastMoveHappened=now() self.timeLastMoveHappened=now()
while 1: 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 yield waituntil, self, self.somethingHappened #wait for an important event in order to move the items
#print now()
self.moveEntities() self.moveEntities()
if self.canAcceptAndIsRequested(): if self.canAcceptAndIsRequested():
print now(), ":canAcceptAndIsRequested"
self.getEntity() self.getEntity()
if self.waitToDispose: if self.waitToDispose:
#yield waituntil, self, self.entityJustDisposed print now(), ":waitToDispose"
#self.justDisposed=False continue
pass
''' '''
now we have to wait until something happens. The things that are important are (may be not a full list) 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 one item reaches the end
...@@ -188,8 +194,20 @@ class Conveyer(Process): ...@@ -188,8 +194,20 @@ class Conveyer(Process):
return False 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): 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 #checks if the Conveyer is requested by the predecessor
def isRequested(self): def isRequested(self):
......
...@@ -139,7 +139,7 @@ class Exit(Process): ...@@ -139,7 +139,7 @@ class Exit(Process):
except ZeroDivisionError: except ZeroDivisionError:
G.outputSheet.write(G.outputIndex,1,0) G.outputSheet.write(G.outputIndex,1,0)
G.outputIndex+=1 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: try:
G.outputSheet.write(G.outputIndex,1,((self.totalTaktTime)/self.numOfExits)/G.Base) G.outputSheet.write(G.outputIndex,1,((self.totalTaktTime)/self.numOfExits)/G.Base)
except ZeroDivisionError: except ZeroDivisionError:
......
...@@ -55,15 +55,12 @@ class Failure(Process): ...@@ -55,15 +55,12 @@ class Failure(Process):
def run(self): def run(self):
while 1: while 1:
#yield hold,self,self.calcTimeToFailure()
yield hold,self,self.rngTTF.generateNumber() #wait until a failure happens yield hold,self,self.rngTTF.generateNumber() #wait until a failure happens
try: try:
#print self.name
if(len(self.victim.Res.activeQ)>0): if(len(self.victim.Res.activeQ)>0):
self.interrupt(self.victim) #when a Machine gets failure while in process it is interrupted self.interrupt(self.victim) #when a Machine gets failure while in process it is interrupted
self.victim.Up=False self.victim.Up=False
self.victim.timeLastFailure=now() self.victim.timeLastFailure=now()
#print str(now())+":M"+str(self.victim.id)+" is down"
self.outputTrace("is down") self.outputTrace("is down")
except AttributeError: except AttributeError:
...@@ -77,8 +74,6 @@ class Failure(Process): ...@@ -77,8 +74,6 @@ class Failure(Process):
timeRepairStarted=now() timeRepairStarted=now()
self.repairman.timeLastRepairStarted=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 yield hold,self,self.rngTTR.generateNumber() #wait until the repairing process is over
self.victim.totalFailureTime+=now()-failTime self.victim.totalFailureTime+=now()-failTime
...@@ -86,38 +81,13 @@ class Failure(Process): ...@@ -86,38 +81,13 @@ class Failure(Process):
if(len(self.victim.Res.activeQ)>0): if(len(self.victim.Res.activeQ)>0):
reactivate(self.victim) #since repairing is over, the Machine is reactivated reactivate(self.victim) #since repairing is over, the Machine is reactivated
self.victim.Up=True self.victim.Up=True
#print str(now())+":M"+str(self.victim.id)+" is up"
self.outputTrace("is up") self.outputTrace("is up")
if(self.repairman!="None"): #if a resource was used, it is now released if(self.repairman!="None"): #if a resource was used, it is now released
yield release,self,self.repairman.Res yield release,self,self.repairman.Res
self.repairman.totalWorkingTime+=now()-timeRepairStarted self.repairman.totalWorkingTime+=now()-timeRepairStarted
#print "reactivating "+str(self.victim.currentEntity)
except AttributeError: except AttributeError:
print "AttributeError2" 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) #outputs message to the trace.xls. Format is (Simulation Time | Machine Name | message)
def outputTrace(self, message): def outputTrace(self, message):
from Globals import G from Globals import G
...@@ -134,7 +104,6 @@ class Failure(Process): ...@@ -134,7 +104,6 @@ class Failure(Process):
G.sheetIndex+=1 G.sheetIndex+=1
G.traceSheet=G.traceFile.add_sheet('sheet '+str(G.sheetIndex), cell_overwrite_ok=True) G.traceSheet=G.traceFile.add_sheet('sheet '+str(G.sheetIndex), cell_overwrite_ok=True)
#outputs data to "output.xls" #outputs data to "output.xls"
def outputResultsXL(self, MaxSimtime): def outputResultsXL(self, MaxSimtime):
pass pass
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"general": { "general": {
"_class": "Dream.Configuration", "_class": "Dream.Configuration",
"numberOfReplications": "1", "numberOfReplications": "1",
"maxSimTime": "60", "maxSimTime": "5",
"trace": "Yes", "trace": "Yes",
"confidenceLevel": "0.95" "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