Ejemplo n.º 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);
        }
Ejemplo n.º 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);
         }
     }
 }
Ejemplo n.º 3
0
 public void AddTrustee(Trustee trustee)
 {
     Trustees.Add(trustee.Agent.Key, trustee);
     trustee.PropertyChanged += OnAgentNameChanged;
 }