Esempio n. 1
0
        internal Scenario.ConsiderationScores Score(IInputBroker broker, Scenario.Context context)
        {
            var ret = new Scenario.ConsiderationScores
            {
                Considerations = new Dictionary <Consideration, Scenario.Score>()
            };

            double compensationFactor = 1.0 - (1.0 / (double)Considerations.Count);
            double result             = Weight;

            ret.InitialWeight = Weight;

            foreach (Consideration c in Considerations)
            {
                Scenario.Score considerationScore = c.Score(broker, context);
                double         modification       = (1.0 - considerationScore.FinalScore) * compensationFactor;
                considerationScore.FinalScore = considerationScore.FinalScore + (modification * considerationScore.FinalScore);

                result *= considerationScore.FinalScore;
                ret.Considerations.Add(c, considerationScore);
            }

            ret.FinalScore = result;
            return(ret);
        }
Esempio n. 2
0
        internal Scenario.Score Score(IInputBroker broker, Scenario.Context context)
        {
            var score = new Scenario.Score();

            score.InputValue = broker.GetInputValue(Input, context);
            score.InputValue = NormalizeInput(score.InputValue);
            score.FinalScore = Curve.ComputeValue(score.InputValue);
            return(score);
        }