示例#1
0
        /// <summary>
        /// Sets the instance.
        /// </summary>
        /// <param name="factor">The factor.</param>
        public void SetInstance(IScoreModelFactor factor)
        {
            Type t = factor.GetType();

            FactorClassName    = t.Name;
            SerializedInstance = objectSerialization.ObjectToXML(factor, t);
        }
        /// <summary>
        /// Gets the score
        /// </summary>
        /// <param name="factor">The factor.</param>
        /// <param name="GetAbsolute">if set to <c>true</c> [get absolute].</param>
        /// <returns></returns>
        public Double GetScore(IScoreModelFactor factor, Boolean GetAbsolute = true)
        {
            Dictionary <IScoreModelFactor, Double> Scores = AbsoluteFactorScores;

            if (!GetAbsolute)
            {
                Scores = FactorScores;
            }
            if (!Scores.ContainsKey(factor))
            {
                Scores.Add(factor, 0);
            }
            return(Scores[factor]);
        }
        /// <summary>
        /// Absolute score for the factor specified
        /// </summary>
        /// <param name="factor">The factor.</param>
        /// <param name="score">The score.</param>
        /// <param name="SetToAbsolute">if set to <c>true</c> it will set to absolute score registry, otherwise it will set to final factor scores.</param>
        public void SetScore(IScoreModelFactor factor, Double score, Boolean SetToAbsolute = true)
        {
            Dictionary <IScoreModelFactor, Double> Scores = AbsoluteFactorScores;

            if (!SetToAbsolute)
            {
                Scores = FactorScores;
            }
            if (!Scores.ContainsKey(factor))
            {
                Scores.Add(factor, 0);
            }
            Scores[factor] = score;
        }
示例#4
0
 public ScoreModelFactorSerialized(IScoreModelFactor factor)
 {
     SetInstance(factor);
 }