예제 #1
0
        public void FillQueuesWithObservations() // RECO: think about filling queues during RDF reading
        {
            int MachineIndex = -1;

            Singleton.Writer.WriteResultsOnScreen(Convert.ToString(ObservationGroup.observationGroupNumber + " "));
            for (int Index = 0; Index < Singleton.MachineQueues.Count; Index++) // Search for the desired machine among the machines List which this OG belongs to.
            {
                if (Singleton.MachineQueues[Index].MachineNumber == ObservationGroup.MachineNumber)
                {
                    MachineIndex = Index;
                    break;
                }
            }

            ObservationsData observationsData = ObservationGroup.observationsData;                  // get a reference of ObservationsData

            for (int i = 0; i < Singleton.MachineQueues[MachineIndex].StatfulProperties.Count; i++) //for (int Property = 0; Property < 120; Property++)
            {
                int Property = Singleton.MachineQueues[MachineIndex].StatfulProperties[i];
                int index    = observationsData.ItemSearch(Property, observationsData.ObservedProperties); // search for the index of the property within observedProperties array.

                //RECO: CHeck the conditions Again
                if ((index != -1) && (Singleton.MachineQueues[MachineIndex].QueuesInfo[Property] != null))                                                                      // if we didn't found the index (result index = -1) AND we have Metadata related to this property (QueueInfo)
                {
                    Singleton.MachineQueues[MachineIndex].AddQueuePoint(Property, observationsData.Values[index], ObservationGroup.TimeStamp, ObservationGroup.TimeStampLabel); // push the different observation values(value,timestamp,timestamplabel) into the corresponding property's queue of respective machine.
                    ExecutionCount++;
                    start1 = DateTime.Now;
                    Singleton.MachineQueues[MachineIndex].KmeanInstances[Property].NewEvent();
                    timeSpan1            = DateTime.Now - start1;
                    SumOfAllQueriesTime += timeSpan1.TotalMilliseconds;
                }
            }
        }
예제 #2
0
 private void MatchMissingObservations(ObservationsData observationData)
 {
     for (int i = 0; i < observationData.TempValueLabels.Length; i++)
     {
         if (observationData.TempValueLabels[i] != int.MinValue)
         {
             for (int j = 0; j < observationData.Observations.Length; j++)
             {
                 if (ObservationGroup.observationsData.Outputs[j] == ObservationGroup.observationsData.TempOutputs[i])
                 {
                     ObservationGroup.observationsData.Values[j] = ObservationGroup.observationsData.TempValues[i];
                     break;
                 }
             }
         }
     }
 }