Example #1
0
        private DOIValue[] WrapWeights(float[] weights)
        {
            DOIValue[] result = new DOIValue[weights.Length];

            for (int i = 0; i < weights.Length; i++)
            {
                // 23-04-07: weight is saved but only importance is used to color the connectors
                result[i].weight = weights[i];
                result[i].importance = weights[i];
                if (_semanticWeights[Model.Default.FocusCenter][i] > 0f)
                    result[i].semantic = 1f;
                else
                    result[i].semantic = 0f;
            }

            return result;
        }
Example #2
0
        private void Normalize(DOIValue[] values)
        {
            float maxWeight = float.MinValue;
            float maxImportance = float.MinValue;

            for (int i = 0; i < _weights.Length; i++)
            {
                maxWeight = Math.Max(values[i].weight, maxWeight);
                maxImportance = Math.Max(values[i].importance, maxImportance);
            }

            for (int i = 0; i < _weights.Length; i++)
            {
                values[i].importance /= maxImportance;
                values[i].weight /= maxWeight;
            }
        }