Commit d8b4f0d1 authored by panos's avatar panos Committed by Jérome Perrin

Bug fixed in ReplaceMissingValues

parent 904f5823
<?xml version='1.0' encoding='utf8'?>
<CMSDDocument>
<DataSection>
<PartType>
<Identifier>Part1</Identifier>
</PartType>
<PartType>
<Identifier>UnfinishedPart1</Identifier>
</PartType>
<Resource>
<Identifier>S1</Identifier>
<Description>The source of the topology</Description>
<ResourceType>Source</ResourceType>
<Name>RawMaterial</Name>
</Resource>
<Resource>
<Identifier>M1</Identifier>
<Description>The lathe of the topology</Description>
<ResourceType>Machine</ResourceType>
<Name>Machine1</Name>
</Resource>
<Resource>
<Identifier>M2</Identifier>
<Description>The moulding machine of the topology</Description>
<ResourceType>Machine</ResourceType>
<Name>Machine2</Name>
</Resource>
<Resource>
<Identifier>Queue</Identifier>
<Description>The queue of the topology</Description>
<ResourceType>Queue</ResourceType>
<Name>Queue</Name>
</Resource>
<Resource>
<Identifier>Exit</Identifier>
<Description>The exit of the topology</Description>
<ResourceType>Exit</ResourceType>
<Name>Stock</Name>
</Resource>
<Resource>
<Identifier>A</Identifier>
<ResourceType>employee</ResourceType>
</Resource>
<Resource>
<Identifier>B</Identifier>
<ResourceType>employee</ResourceType>
</Resource>
<Resource>
<Identifier>Repairman</Identifier>
<Description>This element describes a class of employees</Description>
<ResourceType>employee</ResourceType>
<Name>W1</Name>
</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>
<ResourcesRequired>
<Description>Source</Description>
<Resource>
<ResourceIdentifier>S1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
<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>
</Process>
<Process>
<Identifier>A020</Identifier>
<Description>Process 2</Description>
<PartsProduced>
<Description>...</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>...</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<ResourcesRequired>
<Description>The employee performing the operation.</Description>
<Resource>
<ResourceIdentifier>A</ResourceIdentifier>
</Resource>
</ResourcesRequired>
<ResourcesRequired>
<Description>Machine1.</Description>
<Resource>
<ResourceIdentifier>M1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
<OperationTime>
<Unit>minutes</Unit>
<Distribution>
<Name></Name>
<DistributionParameterA>
<Name></Name>
<Value></Value>
</DistributionParameterA>
<DistributionParameterB>
<Name></Name>
<Value></Value>
</DistributionParameterB>
</Distribution>
</OperationTime>
<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>
</Process>
<Process>
<Identifier>A030</Identifier>
<Description>Process 3</Description>
<ResourcesRequired>
<Description>Queue1.</Description>
<Resource>
<ResourceIdentifier>Q1</ResourceIdentifier>
</Resource>
</ResourcesRequired>
<Property>
<Name>capacity</Name>
<Value>1</Value>
</Property>
</Process>
<Process>
<Identifier>A040</Identifier>
<Description>Process 4</Description>
<PartsProduced>
<Description>...</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsProduced>
<PartsConsumed>
<Description>...</Description>
<PartType>
<PartTypeIdentifier>UnfinishedPart1</PartTypeIdentifier>
</PartType>
<PartQuantity>1</PartQuantity>
</PartsConsumed>
<ResourcesRequired>
<Description>The employee performing the operation.</Description>
<Resource>
<ResourceIdentifier>B</ResourceIdentifier>
</Resource>
</ResourcesRequired>
<ResourcesRequired>
<Description>Machine2.</Description>
<Resource>
<ResourceIdentifier>M2</ResourceIdentifier>
</Resource>
</ResourcesRequired>
<OperationTime>
<Unit>minutes</Unit>
<Distribution>
<Name></Name>
<DistributionParameterA>
<Name></Name>
<Value></Value>
</DistributionParameterA>
<DistributionParameterB>
<Name></Name>
<Value></Value>
</DistributionParameterB>
</Distribution>
</OperationTime>
<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>
<Name>RepairmanRequired</Name>
<ResourcesRequired>
<Description>The employee performing the operation.</Description>
<ResourceIdentifier>W1</ResourceIdentifier>
</ResourcesRequired>
</Property>
</Property>
</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
{
"modelResource": [
{
"_class": "Dream.Repairman",
"capacity": "1",
"id": "W1",
"name": "W1"
}
],
"_class": "Dream.Simulation",
"coreObject": [
{
"name": "Raw Material",
"entity": "Part",
"interarrivalTime": {
"distributionType": "Fixed",
"mean": "0.5"
},
"successorList": [
"DummyQ"
],
"_class": "Dream.Source",
"id": "S1"
},
{
"predecessorList": [
"DummyQ"
],
"name": "Machine1",
"processingTime": {
},
"successorList": [
"Q1"
],
"failures": {
"MTTR": "5",
"failureDistribution": "Fixed",
"repairman": "W1",
"MTTF": "60"
},
"_class": "Dream.Machine",
"id": "M1"
},
{
"predecessorList": [
"Q1"
],
"name": "Machine2",
"processingTime": {
},
"successorList": [
"E1"
],
"failures": {
"MTTR": "10",
"failureDistribution": "Fixed",
"repairman": "W1",
"MTTF": "40"
},
"_class": "Dream.Machine",
"id": "M2"
},
{
"capacity": "1",
"name": "DummyQ",
"isDummy": "True",
"predecessorList": [
"S1"
],
"successorList": [
"M1"
],
"_class": "Dream.Queue",
"id": "DummyQ"
},
{
"capacity": "1",
"name": "Q1",
"isDummy": "False",
"predecessorList": [
"M1"
],
"successorList": [
"M2"
],
"_class": "Dream.Queue",
"id": "Q1"
},
{
"predecessorList": [
"M2"
],
"_class": "Dream.Exit",
"id": "E1",
"name": "Stock"
}
],
"general": {
"trace": "Yes",
"_class": "Dream.Configuration",
"numberOfReplications": "1",
"maxSimTime": "1440",
"confidenceLevel": "0.95"
}
}
\ No newline at end of file
......@@ -47,7 +47,6 @@ class HandleMissingValues(BasicStatisticalMeasures):
def ReplaceWithMean(self,mylist): #Replace in the given list the missing values with the mean value
list1=self.DeleteMissingValue(mylist) #Create a new list, which is the given list deleting the missing values (calling the DeleteMissingValue method)
mean=sum(list1)/float(len(list1)) #Calculate the mean value of the new list
print mean
i=0
for value in mylist:
if value is '' :
......
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