示例#1
0
        public Dictionary <string, double> TrusteeTrustValues(Agent targetAgent, TrustAction action, TrustFunction[] trustFunctions)
        {
            Dictionary <string, double> result = new Dictionary <string, double>();

            Trustee targetTrustee = Trustees[targetAgent.Name];

            foreach (TrustFunction trustFunction in trustFunctions)
            {
                result.Add(trustFunction.ToString(), trustFunction.CalculateTrust(this, targetTrustee, action));
            }

            return(result);
        }
示例#2
0
 public void UpdateTrustees(IEnumerable <Agent> trustees, IEnumerable <Feature> features)
 {
     foreach (Agent trustee in trustees)
     {
         var targetTrustee = GetTrustee(trustee);
         if (targetTrustee == null)
         {
             targetTrustee = new Trustee(trustee);
             AddTrustee(targetTrustee);
         }
         foreach (Feature feature in features)
         {
             targetTrustee.UpdateFeature(feature);
         }
     }
 }
示例#3
0
 public void AddTrustee(Trustee trustee)
 {
     Trustees.Add(trustee.Agent.Key, trustee);
     trustee.PropertyChanged += OnAgentNameChanged;
 }