Ejemplo n.º 1
0
    public string pickupAbstractionNew()
    {
        List <float> finalValues    = new List <float> ();
        List <float> finalValuesTmp = new List <float> ();

        for (int i = 0; i < samplesDeltaMeasures.Count; i++)
        {
            string abstrName  = abstractions.Keys.ToList() [i];
            float  scaleValue = abstractions[abstrName].scale;

            int numOfItems = Mathf.FloorToInt((Camera.main.orthographicSize * 2f) / (scaleValue * 300f));

            float val = 0;
            for (int j = 0; j < characteristics.Count; j++)
            {
                Abstraction abstr       = abstractions[abstractions.Keys.ToList()[i]];
                float       abstrWeight = abstr.DimensionWeight(layouter.GetRequiredSpatialDimension());

                float increment = samplesDeltaMeasures[i][j] * characteristics[j].weight;

                if (abstrWeight > 0)
                {
                    val += increment;
                }
                else
                {
                    val = float.MaxValue;
                }
            }

            finalValues.Add((val + (1f / numOfItems)));
            finalValuesTmp.Add((val + (1f / numOfItems)));
        }

        finalValues.Sort();

        int resultIndex = finalValuesTmp.IndexOf(finalValues [0]);

        return(abstractions.Keys.ToList() [resultIndex]);
    }