Esempio n. 1
0
        /// <summary>
        /// Make the interaction values similar to the interaction values of the selected feature non-functional property
        /// E.g     Feature distribution        =  binarySize: BDB
        ///         Interaction distribution    =  performance: SQLite
        /// Then scales the interaction distribution, to the values of the Interactions: BinarySize: BDB
        /// </summary>
        /// <param name="feature"></param>
        /// <param name="interaction"></param>
        /// <returns></returns>
        private Distribution ScaleInteractionValuesToFeature(Distribution feature, Distribution interaction)
        {
            //elevator has no interaction distribution, cant scale
            if (feature.DisplayName == "Elevator")
            {
                return(interaction);
            }

            //different SPL selected, scale the values accordingly
            if (feature.DisplayName != interaction.DisplayName)
            {
                var interactionOfFeature = _model.DStore.SelectedFeatureDistribution;//Model.LoadSingleDistribution(feature.SelectedNFProperty.Name, Model.SelectedFeatureDistribution.DisplayName);
                return(InteractionToScale(interaction, interactionOfFeature));
            }
            //same name but maybe from different nfp
            if (feature.SelectedNfProperty.Name == interaction.SelectedNfProperty.Name)
            {
                //same nfp: No need to scale, is already at correct values
                return(interaction);
            }

            var interactionOfOtherNfp = _model.LoadSingleDistribution(feature.SelectedNfProperty.Name, _model.DStore.SelectedFeatureDistribution.DisplayName);

            return(InteractionToScale(interaction, interactionOfOtherNfp));
        }