Esempio n. 1
0
 protected void SetDescriptors(string descriptors)
 {
     this.m_descriptors = (List <Query.Descriptor_t>)StringUtils.FromString(typeof(List <Query.Descriptor_t>), descriptors, false);
     for (int i = 0; i < this.m_descriptors.get_Count(); i++)
     {
         Query.Descriptor_t descriptor_t = this.m_descriptors.get_Item(i);
         descriptor_t.Attribute.SetDefaultValue(descriptor_t.Reference);
     }
 }
Esempio n. 2
0
 private static Property FindProperty(Query.Descriptor_t q, List <BehaviorTree.Descriptor_t> c)
 {
     for (int i = 0; i < c.get_Count(); i++)
     {
         BehaviorTree.Descriptor_t descriptor_t = c.get_Item(i);
         if (descriptor_t.Descriptor.GetVariableId() == q.Attribute.GetVariableId())
         {
             return(descriptor_t.Descriptor);
         }
     }
     return(null);
 }
Esempio n. 3
0
        private float ComputeSimilarity(List <Query.Descriptor_t> q, List <BehaviorTree.Descriptor_t> c)
        {
            float num = 0f;

            for (int i = 0; i < q.get_Count(); i++)
            {
                Query.Descriptor_t descriptor_t = q.get_Item(i);
                Property           property     = Query.FindProperty(descriptor_t, c);
                if (property != null)
                {
                    float num2 = descriptor_t.Attribute.DifferencePercentage(property);
                    num += (1f - num2) * descriptor_t.Weight;
                }
            }
            return(num);
        }
Esempio n. 4
0
 public Descriptor_t(Query.Descriptor_t copy)
 {
     this.Attribute = copy.Attribute.clone();
     this.Reference = copy.Reference.clone();
     this.Weight    = copy.Weight;
 }