Exemplo n.º 1
0
        /// <summary>
        /// 根据数值高低进行推荐
        /// </summary>
        /// <param name="category"></param>
        private string BehaviorScoresLoadSuggestion()
        {
            double            dANX    = Recommendation.dic_ANX_Predictions.Values.Last();
            double            dDEP    = Recommendation.dic_DEP_Predictions.Values.Last();
            double            dHMA    = Recommendation.dic_HMA_Predictions.Values.Last();
            double            dHYP    = Recommendation.dic_HYP_Predictions.Values.Last();
            double            dPSD    = Recommendation.dic_PSD_Predictions.Values.Last();
            double            dSOM    = Recommendation.dic_SOM_Predictions.Values.Last();
            double            dUNR    = Recommendation.dic_UNR_Predictions.Values.Last();
            double            dMax    = dANX;
            EmotionDimensions emotion = EmotionDimensions.AMX;
            int iSuggestion           = 0;//推荐建议的ID

            //if (dDEP > dMax)
            //{
            //    dMax = dDEP;
            //    emotion = EmotionDimensions.DEP;
            //}
            if (dHMA > dMax)
            {
                dMax    = dHMA;
                emotion = EmotionDimensions.HMA;
            }
            if (dHYP > dMax)
            {
                dMax    = dHYP;
                emotion = EmotionDimensions.HYP;
            }
            if (dPSD > dMax)
            {
                dMax    = dPSD;
                emotion = EmotionDimensions.PSD;
            }
            if (dSOM > dMax)
            {
                dMax    = dSOM;
                emotion = EmotionDimensions.SOM;
            }
            if (dUNR > dMax)
            {
                dMax    = dUNR;
                emotion = EmotionDimensions.UNR;
            }
            /////////////////////  分三级  /////////////////////////
            if (dMax > 1.0)
            {
                iSuggestion = (int)emotion + 2;
            }
            else if (dMax < -1.0)
            {
                iSuggestion = (int)emotion;
            }
            else
            {
                iSuggestion = (int)emotion + 1;
            }
            //return GetEmotionSuggestionByID(RecommendedCategory.BehaviorScores, iSuggestion) + "\r\n <!--- 根据分值高低推荐 --->";
            return(GetEmotionSuggestionByID(RecommendedCategory.BehaviorScores, iSuggestion));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 根据变化幅度推荐
        /// </summary>
        private string BehaviorChangeLoadSuggestion()
        {
            int iCount = Recommendation.dic_ANX_Predictions.Count;//记录数

            if (iCount == 0)
            {
                return(string.Empty);
            }
            double dANX = Recommendation.dic_ANX_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_ANX_Predictions.Values.ElementAt(iCount - 2);
            double dDEP = Recommendation.dic_DEP_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_DEP_Predictions.Values.ElementAt(iCount - 2);
            double dHMA = Recommendation.dic_HMA_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_HMA_Predictions.Values.ElementAt(iCount - 2);
            double dHYP = Recommendation.dic_HYP_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_HYP_Predictions.Values.ElementAt(iCount - 2);
            double dPSD = Recommendation.dic_PSD_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_PSD_Predictions.Values.ElementAt(iCount - 2);
            double dSOM = Recommendation.dic_SOM_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_SOM_Predictions.Values.ElementAt(iCount - 2);
            double dUNR = Recommendation.dic_UNR_Predictions.Values.ElementAt(iCount - 1) -
                          Recommendation.dic_UNR_Predictions.Values.ElementAt(iCount - 2);
            double            dMax    = dANX;
            EmotionDimensions emotion = EmotionDimensions.AMX;
            double            dScore  = Recommendation.dic_ANX_Predictions.Values.ElementAt(iCount - 1);
            int iSuggestion           = 0;//推荐建议的ID

            if (dDEP > dMax)
            {
                dMax    = dDEP;
                emotion = EmotionDimensions.DEP;
                dScore  = Recommendation.dic_DEP_Predictions.Values.ElementAt(iCount - 1);
            }
            if (dHMA > dMax)
            {
                dMax    = dHMA;
                emotion = EmotionDimensions.HMA;
                dScore  = Recommendation.dic_HMA_Predictions.Values.ElementAt(iCount - 1);
            }
            if (dHYP > dMax)
            {
                dMax    = dHYP;
                emotion = EmotionDimensions.HYP;
                dScore  = Recommendation.dic_HYP_Predictions.Values.ElementAt(iCount - 1);
            }
            if (dPSD > dMax)
            {
                dMax    = dPSD;
                emotion = EmotionDimensions.PSD;
                dScore  = Recommendation.dic_PSD_Predictions.Values.ElementAt(iCount - 1);
            }
            if (dSOM > dMax)
            {
                dMax    = dSOM;
                emotion = EmotionDimensions.SOM;
                dScore  = Recommendation.dic_SOM_Predictions.Values.ElementAt(iCount - 1);
            }
            if (dUNR > dMax)
            {
                dMax    = dUNR;
                emotion = EmotionDimensions.UNR;
                dScore  = Recommendation.dic_UNR_Predictions.Values.ElementAt(iCount - 1);
            }
            /////////////////////  分三级  /////////////////////////
            if (dScore > 1.0)
            {
                iSuggestion = (int)emotion + 2;
            }
            else if (dScore < -1.0)
            {
                iSuggestion = (int)emotion;
            }
            else
            {
                iSuggestion = (int)emotion + 1;
            }
            //return GetEmotionSuggestionByID(RecommendedCategory.BehaviorChange, iSuggestion) + "\r\n <!--- 根据变化幅度推荐 --->";

            return(GetEmotionSuggestionByID(RecommendedCategory.BehaviorChange, iSuggestion));
        }