Exemplo n.º 1
0
        private void recommendTemplateButton_Click(object sender, EventArgs e)
        {
            List <QueryResult> QRList = new List <QueryResult>();
            string             Title;

            if (nNDataGridView.SelectedRows.Count > 0)
            {
                Title = $"User Selection from {nNDataGridView.Rows.Count} Nearest Neighbours, {qRName}";
            }
            else
            {
                Title = $"{nNDataGridView.Rows.Count} Nearest Neighbours, {qRName}";
            }
            if (thisFormResultType == typeof(UserQueryResult))
            {
                Converter <UserQueryResult, QueryResult> Converter = new Converter <UserQueryResult, QueryResult>(uQtoQR);
                QRList = HelperFunctions.DatagridViewToQueryResultList(nNDataGridView, 4, parentReference.UserQueryResults.ConvertAll <QueryResult>(Converter));
                QRList.Add(thisFormResult);
                string       InputString   = FileHelperFuctions.ReturnRecommendationString(QRList, parentReference.GroupNamesAndDescriptionsAll, parentReference.Threshold);
                TemplateForm ResultantForm = new TemplateForm(InputString, Title);
                ResultantForm.Show();
            }
            else
            {
                Converter <GroupingQueryResult, QueryResult> Converter = new Converter <GroupingQueryResult, QueryResult>(gQtoQR);
                QRList = HelperFunctions.DatagridViewToQueryResultList(nNDataGridView, 1, parentReference.GroupingQueryResults.ConvertAll <QueryResult>(Converter));
                QRList.Add(thisFormResult);
                string       InputString   = FileHelperFuctions.ReturnRecommendationString(QRList, parentReference.GroupNamesAndDescriptionsAll, parentReference.Threshold);
                TemplateForm ResultantForm = new TemplateForm(InputString, Title);
                ResultantForm.Show();
            }
        }
Exemplo n.º 2
0
        private void recommendTemplateButton_Click(object sender, EventArgs e)
        {
            List <QueryResult> QRList = new List <QueryResult>();

            foreach (Cluster C in thisAlgo.Clusters)
            {
                string Title = $"Based on Cluster {C.ListPosition}, clustered by {thisAlgo.GetType().ToString().Split('.')[1]}";
                if (thisFormResultType == typeof(UserQueryResult))
                {
                    Converter <UserQueryResult, QueryResult> Converter = new Converter <UserQueryResult, QueryResult>(uQtoQR);
                    QRList = HelperFunctions.DatagridViewSubsetToQueryResultList(clustersDataGridView, 4, 0, C.ListPosition.ToString(), parentReference.UserQueryResults.ConvertAll <QueryResult>(Converter));

                    string       InputString   = FileHelperFuctions.ReturnRecommendationString(QRList, parentReference.GroupNamesAndDescriptionsAll, parentReference.Threshold);
                    TemplateForm ResultantForm = new TemplateForm(InputString, Title);
                    ResultantForm.Show();
                }
                else
                {
                    Converter <GroupingQueryResult, QueryResult> Converter = new Converter <GroupingQueryResult, QueryResult>(gQtoQR);
                    QRList = HelperFunctions.DatagridViewSubsetToQueryResultList(clustersDataGridView, 1, 0, C.ListPosition.ToString(), parentReference.GroupingQueryResults.ConvertAll <QueryResult>(Converter));

                    string       InputString   = FileHelperFuctions.ReturnRecommendationString(QRList, parentReference.GroupNamesAndDescriptionsAll, parentReference.Threshold);
                    TemplateForm ResultantForm = new TemplateForm(InputString, Title);
                    ResultantForm.Show();
                }
            }
        }