示例#1
0
        private LocationChoiceInformation DataToLCI(int n, float[] data)
        {
            //data.length should be equal to number of internal zones, 4 is 4 possible
            //parameter calculations
            //and the 2 is for the SUM value / 7
            //ignore "1" value because data[0] is just the zone nUmber we are looking at
            LocationChoiceInformation lci = new LocationChoiceInformation
            {
                Data = new float[data.Length / 4][]
            };

            for (int i = 0; i < lci.Data.Length; i++)
            {
                lci.Data[i] = new float[4];
            }
            int sectionLength = (data.Length / 4);

            for (int i = 0; i < 4; i++)
            {
                for (int j = 0; j < sectionLength; j++)
                {
                    lci.Data[j][i] = data[(i * sectionLength) + j];
                }
            }
            return(lci);
        }
示例#2
0
 private LocationChoiceInformation DataToLCI(int n, float[] data)
 {
     LocationChoiceInformation lci = new LocationChoiceInformation();
     //data.length should be equal to number of internal zones, 4 is 4 possible
     //parameter calculations
     //and the 2 is for the SUM value / 7
     //ignore "1" value because data[0] is just the zone nUmber we are looking at
     lci.Data = new float[data.Length / 4][];
     for ( int i = 0; i < lci.Data.Length; i++ )
     {
         lci.Data[i] = new float[4];
     }
     int sectionLength = ( data.Length / 4 );
     for ( int i = 0; i < 4; i++ )
     {
         for ( int j = 0; j < sectionLength; j++ )
         {
             lci.Data[j][i] = data[( i * sectionLength ) + j];
         }
     }
     return lci;
 }