public void PlayerReplyTurn()
    {
        var playerAgent = rpcList.Find(x => x.CharacterName == _chosenCharacter);


        var decidedList = playerAgent.Decide();
        var action      = decidedList.FirstOrDefault();

        IEnumerable <DialogueStateActionDTO> availableDialogs = new DialogueStateActionDTO[1];
        List <DialogueStateActionDTO>        dialogs          = new List <DialogueStateActionDTO>();

        stopTime = true;


        Name currentState = action.Parameters[0];
        Name nextState    = action.Parameters[1];
        Name meaning      = action.Parameters[2];

        Debug.Log(" meaning: " + meaning);
        Name style = Name.BuildName("*");

        dialogs = _iat.GetDialogueActions(currentState, nextState, meaning, style);
        //Debug.Log(" dialog: " + dialogs.Count +  " first: " + dialogs[0].Utterance);
        availableDialogs = dialogs;


        UpdateButtonTexts(false, availableDialogs);
    }
Exemplo n.º 2
0
        private IEnumerable <DynamicPropertyResult> WorkingMemoryProperty(IQueryContext context, Name name, Name value)
        {
            foreach (var c in context.Constraints)
            {
                var n = context.AskPossibleProperties(name).ToList().FirstOrDefault()?.Item1.Value;
                var v = context.AskPossibleProperties(value).ToList().FirstOrDefault()?.Item1.Value;

                if (n == null || v == null)
                {
                    yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName("Fail")), c));
                }
                else if (!n.IsGrounded || !v.IsGrounded)
                {
                    yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName("Fail")), c));
                }
                else if (n.IsComposed || v.IsComposed)
                {
                    yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName("Fail")), c));
                }
                else
                {
                    this.SetValue(n, v);
                    yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName("OK")), c));
                }
            }
        }
    public void Reply(Guid dialogId)
    {
        /*     var state = _agentController.RPC.GetBeliefValue("DialogState(Player)");
         *   if (state == IATConsts.TERMINAL_DIALOGUE_STATE)
         *   {
         *       return;
         *   }*/
        var reply = _iat.GetDialogActionById(dialogId);

        Name actionName  = Name.BuildName("Speak");
        Name actionCS    = Name.BuildName(reply.CurrentState);
        Name actionNS    = Name.BuildName(reply.NextState);
        Name actionMean  = Name.BuildName(reply.Meaning[0]);
        Name actionStyle = Name.BuildName(reply.Style[0]);
        Name utteranceID = Name.BuildName(reply.UtteranceId);

        var act = new ActionLibrary.Action(new List <Name>()
        {
            actionName, actionCS, actionNS, actionMean, actionStyle
        }, chosenTarget);

        _agentControllers.Find(x => x.RPC.CharacterName == _chosenCharacter).Speak(this, act);
        UpdateButtonTexts(true, new DialogueStateActionDTO[1]);

        //  alreadyUsedDialogs.Add(reply.Utterance, reply.UtteranceId);
    }
Exemplo n.º 4
0
        private Name BuildEventNameFromDTO(EventDTO evt)
        {
            var actionEvent = evt as ActionEventDTO;

            if (actionEvent != null)
            {
                var state = (actionEvent.ActionState == ActionState.Start) ? AMConsts.ACTION_START : AMConsts.ACTION_END;
                return(Name.BuildName(
                           (Name)AMConsts.EVENT,
                           (Name)state,
                           (Name)actionEvent.Subject,
                           (Name)actionEvent.Action,
                           (Name)actionEvent.Target));
            }

            var pcEvent = evt as PropertyChangeEventDTO;

            if (pcEvent != null)
            {
                return(Name.BuildName(
                           (Name)AMConsts.EVENT,
                           (Name)AMConsts.PROPERTY_CHANGE,
                           (Name)pcEvent.Subject,
                           (Name)pcEvent.Property,
                           (Name)pcEvent.NewValue));
            }

            throw new Exception("Unknown Event DTO");
        }
Exemplo n.º 5
0
        private IEnumerable <DynamicPropertyResult> RoundtoTensMethodCalculator(IQueryContext context, Name x, Name digits)
        {
            var y_value = Convert.ToInt32(digits.ToString());
            var toTens  = Math.Pow(10, y_value);

            if (x.IsVariable)
            {
                foreach (var c in context.Constraints)
                {
                    foreach (var sub in c)
                    {
                        if (sub.Variable == x)
                        {
                            var toRet = Convert.ToDouble(sub.SubValue.ToString());
                            // Console.WriteLine("Round method calculation for: " + x.ToString() + " the value : " + toRet);
                            toRet = toRet / toTens;
                            toRet = Math.Round(toRet, 0);
                            toRet = toRet * toTens;
                            //      Console.WriteLine("Round method calculation for: " + x.ToString() + " rounded value " + sub.Value.ToString()+ " result : " + toRet);

                            yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(toRet)), c));
                        }
                    }
                }
            }
        }
            public void SetObjectData(ISerializationData dataHolder)
            {
                Id        = dataHolder.GetValue <uint>("Id");
                Type      = dataHolder.GetValue <Name>("Type");
                Subject   = dataHolder.GetValue <Name>("Subject");
                Property  = dataHolder.GetValue <Name>("Property");
                NewValue  = dataHolder.GetValue <string>("NewValue");
                Timestamp = dataHolder.GetValue <ulong>("Timestamp");

                if (m_linkedEmotions == null)
                {
                    m_linkedEmotions = new HashSet <string>();
                }
                else
                {
                    m_linkedEmotions.Clear();
                }
                var le = dataHolder.GetValue <string[]>("LinkedEmotions");

                if (le != null && le.Length > 0)
                {
                    m_linkedEmotions.UnionWith(le);
                }

                EventName = Name.BuildName(EVT_NAME, (Name)Type, (Name)Subject, Property, (Name)NewValue);
            }
            public SerializationTestClass()
            {
                NumValue    = ulong.MaxValue / 3;
                NumValue2   = 123;
                FloatValue  = 4.565e+25m;
                FloatValue2 = double.MaxValue / 5;
                EnumField   = SerializationEnumTest.Ok3 | SerializationEnumTest.Ok1;
                TimeField   = DateTime.UtcNow;

                TestHash2 = new HashSet <object>();
                TestHash2.Add(new object());
                TestHash2.Add(3);
                TestHash2.Add(5);
                TestHash2.Add(SerializationEnumTest.Ok2);

                TestHash = new HashSet <float>();
                TestHash.Add(1);
                TestHash.Add(2);
                TestHash.Add(3);

                TestDic    = new Dictionary <int, string>();
                TestDic[1] = "one";
                TestDic[2] = "two";
                TestDic[3] = "three";

                m_nullPointer  = null;
                m_circlePoiter = this;

                NameField = Name.BuildName("A(B,C,D(H,E(F)))");

                BackingProperty = "this is a property";

                SerializeType = typeof(DateTime);
            }
Exemplo n.º 8
0
        private IEnumerable <DynamicPropertyResult> GetEmotionsForEntity(IEmotionalState state,
                                                                         Name emotionName, IQueryable kb, Name perspective, IEnumerable <SubstitutionSet> constraints)
        {
            if (emotionName.IsVariable)
            {
                foreach (var emotion in state.GetAllEmotions())
                {
                    var sub = new Substitution(emotionName, new ComplexValue((Name)emotion.EmotionType));
                    foreach (var c in constraints)
                    {
                        if (c.Conflicts(sub))
                        {
                            continue;
                        }

                        var newConstraints = new SubstitutionSet(c);
                        newConstraints.AddSubstitution(sub);
                        yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(emotion.Intensity)), newConstraints));
                    }
                }
            }
            else
            {
                foreach (var resultPair in kb.AskPossibleProperties(emotionName, perspective, constraints))
                {
                    string emotionKey = resultPair.Item1.Value.ToString();
                    var    emotion    = state.GetEmotionsByType(emotionKey).OrderByDescending(e => e.Intensity).FirstOrDefault();
                    float  value      = emotion?.Intensity ?? 0;
                    foreach (var c in resultPair.Item2)
                    {
                        yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(value)), c));
                    }
                }
            }
        }
Exemplo n.º 9
0
        public void Add_Variable_Tag_SimpleWFN(string n1, string tag, string expectedResult, Refactorization r)
        {
            string result = string.Empty;

            if (r == Refactorization.New)
            {
                SimpleName name    = new SimpleName(n1);
                SimpleName resName = null;
                for (long i = 0; i < reps; i++)
                {
                    resName = SimpleWFN.AddVariableTag(name, tag);
                }
                result = resName.ToString();
            }
            else if (r == Refactorization.Current)
            {
                Name name    = Name.BuildName(n1);
                Name resName = null;
                for (long i = 0; i < reps; i++)
                {
                    resName = name.ReplaceUnboundVariables("_tag");
                }
                result = RemoveWhiteSpace(resName.ToString());
            }

            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 10
0
        public void Equals_NameWithEquivalentName(string nameString1, string nameString2)
        {
            var name1 = Name.BuildName(nameString1);
            var name2 = Name.BuildName(nameString2);

            Assert.That(name1.Equals(name2));
        }
        public void Contains_NameSearchTreeThatContainsName_True(string name, string value)
        {
            var tree = new NameSearchTree <string>();

            tree.Add(Name.BuildName(name), value);
            Assert.That(tree.ContainsKey(Name.BuildName(name)));
        }
Exemplo n.º 12
0
        public void Test_AskProperty_Self()
        {
            var kb    = new KB((Name)"John");
            var value = Name.BuildName(kb.AskProperty(Name.SELF_SYMBOL).Value.ToString());

            Assert.AreEqual(value, kb.Perspective);
        }
            protected override IEnumerable <SubstitutionSet> CheckActivation(KB kb, Name perspective, IEnumerable <SubstitutionSet> constraints)
            {
                //if (!m_other.HasModifier && (m_other.InnerName.IsVariable || m_other.InnerName.IsPrimitive))
                //{
                //	foreach (var constraint in constraints)
                //	{
                //		var sub = new Substitution(m_variable, m_other.InnerName);
                //		if (!constraint.Conflicts(sub))
                //		{
                //			var c = new SubstitutionSet(constraint);
                //			c.AddSubstitution(sub);
                //			yield return c;
                //		}
                //	}
                //}
                //else
                //{

                //}

                foreach (var result in m_other.Retrive(kb, perspective, constraints))
                {
                    var sub = new Substitution(m_variable, Name.BuildName(result.Item1));
                    if (result.Item2.AddSubstitution(sub))
                    {
                        yield return(result.Item2);
                    }
                }
            }
Exemplo n.º 14
0
        private Name BuildEventName(EventDTO evt)
        {
            var actionEvent = evt as ActionEventDTO;

            if (actionEvent != null)
            {
                return(Name.BuildName(
                           (Name)"Event",
                           (Name)"Action",
                           (Name)actionEvent.Subject,
                           (Name)actionEvent.Action,
                           (Name)actionEvent.Target));
            }

            var pcEvent = evt as PropertyChangeEventDTO;

            if (pcEvent != null)
            {
                return(Name.BuildName(
                           (Name)"Event",
                           (Name)"Property-Change",
                           (Name)pcEvent.Subject,
                           (Name)pcEvent.Property,
                           (Name)pcEvent.NewValue));
            }

            throw new Exception("Unknown Event DTO");
        }
Exemplo n.º 15
0
        public void Test_Tell_Pass_Basic_Property_With_ToM()
        {
            const string property = "ToM(Mary,ToM(Self,Has(Ball)))";
            var          kb       = new KB((Name)"John");

            kb.Tell((Name)property, Name.BuildName(true));
        }
Exemplo n.º 16
0
        private IEnumerable <Pair <PrimitiveValue, SubstitutionSet> > EventIdPropertyCalculator(KB kb, Name perspective, IDictionary <string, Name> args, IEnumerable <SubstitutionSet> constraints)
        {
            List <Pair <PrimitiveValue, SubstitutionSet> > results = new List <Pair <PrimitiveValue, SubstitutionSet> >();

            if (!perspective.Match(Name.SELF_SYMBOL))
            {
                return(results);
            }

            Name type    = GetArgument(args, "type");
            Name subject = GetArgument(args, "subject");
            Name def     = GetArgument(args, "def");
            Name target  = GetArgument(args, "target");

            var key = Name.BuildName(EVT_NAME, type, subject, def, target);

            foreach (var c in constraints)
            {
                foreach (var pair in m_typeIndexes.Unify(key, c))
                {
                    foreach (var id in pair.Item1)
                    {
                        results.Add(Tuples.Create((PrimitiveValue)id, new SubstitutionSet(pair.Item2)));
                    }
                }
            }
            return(results);
        }
Exemplo n.º 17
0
        public void ReplaceLiterals(string n1, string t1, string t2, string expectedResult, Refactorization r)
        {
            string resultStr = string.Empty;

            if (r == Refactorization.Current)
            {
                Name result = null;
                var  name   = Name.BuildName(n1);
                for (long i = 0; i < reps; i++)
                {
                    result = name.SwapTerms((Name)t1, (Name)t2);
                }
                resultStr = RemoveWhiteSpace(result.ToString());
            }
            else if (r == Refactorization.New)
            {
                SimpleName result = null;
                var        name   = new SimpleName(n1);
                for (long i = 0; i < reps; i++)
                {
                    result = SimpleWFN.ReplaceLiterals(name, t1, t2);
                }
                resultStr = result.ToString();
            }

            Assert.That(string.Equals(resultStr, expectedResult, StringComparison.InvariantCultureIgnoreCase));
        }
Exemplo n.º 18
0
        public void MakeGround_GroundedName(string n1, string var, string sub, string expectedResult, Refactorization r)
        {
            String result = string.Empty;

            if (r == Refactorization.New)
            {
                var        name       = new SimpleName(n1);
                SimpleName nameResult = null;
                Dictionary <string, SimpleName> subs = new Dictionary <string, SimpleName>();
                subs[var] = new SimpleName(sub);
                for (long i = 0; i < reps; i++)
                {
                    nameResult = SimpleWFN.MakeGround(name, subs);
                }
                result = nameResult.ToString();
            }
            else if (r == Refactorization.Current)
            {
                var             name       = Name.BuildName(n1);
                Name            nameResult = null;
                SubstitutionSet subSet     = new SubstitutionSet();
                subSet.AddSubstitution(new Substitution("[x]/J(I)"));
                for (long i = 0; i < reps; i++)
                {
                    nameResult = name.MakeGround(subSet);
                }
            }
            Assert.AreEqual(expectedResult, result);
        }
Exemplo n.º 19
0
        private void internal_RegistDynamicProperty(Name propertyName, MethodInfo surogate, DynamicPropertyCalculator converted)
        {
            if (!propertyName.IsPrimitive)
            {
                throw new ArgumentException("The property name must be a primitive symbol.", nameof(propertyName));
            }

            var p = surogate.GetParameters();
            var propertyParameters = p.Skip(1).Select(p2 => Name.BuildName("[" + p2.Name + "]")).ToArray();
            var template           = Name.BuildName(propertyParameters.Prepend(propertyName));

            var r = m_dynamicProperties.Unify(template).FirstOrDefault();

            if (r != null)
            {
                var t = r.Item1.DeclaringType;
                if (t == surogate.DeclaringType)
                {
                    return;
                }

                throw new ArgumentException("There is already a registed property with the name " + propertyName + " that receives " + (p.Length - 3) + "parameters.");
            }

            if (_willCollideDelegate(template))
            {
                throw new ArgumentException("There are already stored property values that will collide with the given dynamic property.");
            }

            m_dynamicProperties.Add(template, new DynamicKnowledgeEntry(converted, propertyParameters, surogate.DeclaringType));
        }
Exemplo n.º 20
0
            //public static int NumOfPersistentEntries()
            //{
            //	return MemoryData().Count(d =>
            //		d.Arguments.Length > 2 && (bool) d.Arguments[2]
            //		);
            //}

            public static KB PopulatedTestMemory()
            {
                KB kb = new KB((Name)"Me");

                foreach (var t in MemoryData())
                {
                    Name property = (Name)t.Arguments[0];
                    Name value    = Name.BuildName(t.Arguments[1]);
                    try
                    {
                        //if(t.Arguments.Length>2)
                        //	kb.Tell((Name)t.Arguments[0], PrimitiveValue.Cast(t.Arguments[1]),(bool)t.Arguments[2]);
                        //else
                        kb.Tell(property, value);
                    }
                    catch (Exception e)
                    {
                        if (t.Arguments.Length > 2)
                        {
                            Assert.AreEqual(e.GetType(), t.Arguments[2]);
                        }
                        else
                        {
                            Assert.Fail($"An exception was thrown unexpectedly while evaluating {property} = {value}: {e}");
                        }
                    }
                }
                return(kb);
            }
Exemplo n.º 21
0
        public void Test_RPC_Decide()
        {
            var kb = new KB((Name)"Matt");

            var rpc = BuildEmotionalRPCAsset();

            var edm = new EmotionalDecisionMakingAsset();

            edm.AddActionRule(new ActionLibrary.DTOs.ActionRuleDTO()
            {
                Action = (Name)"EnterRoom", Priority = Name.BuildName(3), Target = (Name)"[x]", Conditions = new Conditions.DTOs.ConditionSetDTO()
                {
                    ConditionSet = new string[] { "[x]!=SELF" }
                }
            });

            rpc.m_emotionalDecisionMakingAsset = edm;

            edm.RegisterKnowledgeBase(rpc.m_kb);

            PopulateEventSet(1);

            foreach (var eve in eventSets[1])
            {
                rpc.Perceive((Name)eve);
                rpc.Update();
            }

            var actions = rpc.Decide();

            Assert.IsNotNull(actions);
        }
Exemplo n.º 22
0
        private static KB CreateKB()
        {
            var kb = new KB((Name)"Agatha");

            kb.Tell((Name)"Strength(John)", Name.BuildName(5));
            kb.Tell((Name)"Strength(Mary)", Name.BuildName(3));
            kb.Tell((Name)"Strength(Leonidas)", Name.BuildName(500));
            kb.Tell((Name)"Strength(Goku)", Name.BuildName(9001f));
            kb.Tell((Name)"Strength(SuperMan)", Name.BuildName(ulong.MaxValue));
            kb.Tell((Name)"Strength(Saitama)", Name.BuildName(float.MaxValue));
            kb.Tell((Name)"Race(Saitama)", Name.BuildName("human"));
            kb.Tell((Name)"Race(Superman)", Name.BuildName("kriptonian"));
            kb.Tell((Name)"Race(Goku)", Name.BuildName("sayian"));
            kb.Tell((Name)"Race(Leonidas)", Name.BuildName("human"));
            kb.Tell((Name)"Race(Mary)", Name.BuildName("human"));
            kb.Tell((Name)"Race(John)", Name.BuildName("human"));
            kb.Tell((Name)"Job(Saitama)", Name.BuildName("super-hero"));
            kb.Tell((Name)"Job(Superman)", Name.BuildName("super-hero"));
            kb.Tell((Name)"Job(Leonidas)", Name.BuildName("Spartan"));
            kb.Tell((Name)"AKA(Saitama)", Name.BuildName("One-Punch_Man"));
            kb.Tell((Name)"AKA(Superman)", Name.BuildName("Clark_Kent"));
            kb.Tell((Name)"AKA(Goku)", Name.BuildName("Kakarot"));
            kb.Tell((Name)"Hobby(Saitama)", Name.BuildName("super-hero"));
            kb.Tell((Name)"Hobby(Goku)", Name.BuildName("training"));
            kb.Tell((Name)"IsAlive(Leonidas)", Name.BuildName(false));
            kb.Tell((Name)"IsAlive(Saitama)", Name.BuildName(true));
            kb.Tell((Name)"IsAlive(Superman)", Name.BuildName(true));
            kb.Tell((Name)"IsAlive(John)", Name.BuildName(true));

            return(kb);
        }
Exemplo n.º 23
0
 public AppraisalRule(AppraisalRuleDTO appraisalRuleDTO)
 {
     EventName        = Name.BuildName(appraisalRuleDTO.EventMatchingTemplate);
     Desirability     = appraisalRuleDTO.Desirability;
     Praiseworthiness = appraisalRuleDTO.Praiseworthiness;
     Conditions       = new ConditionSet(appraisalRuleDTO.Conditions.Select(c => Condition.Parse(c.Condition)));
 }
Exemplo n.º 24
0
        public void Unify_NonUnifiableNames_False(string n1, string n2, Refactorization r)
        {
            IEnumerable <Substitution> bindings = new List <Substitution>();
            var isUnifiable = true;

            if (r == Refactorization.Current)
            {
                var name1 = Name.BuildName(n1);
                var name2 = Name.BuildName(n2);
                for (int i = 0; i < unifierReps; i++)
                {
                    isUnifiable = Unifier.Unify(name1, name2, out bindings);
                }
            }
            else if (r == Refactorization.New)
            {
                var name1 = new SimpleName(n1);
                var name2 = new SimpleName(n2);
                for (int i = 0; i < unifierReps; i++)
                {
                    isUnifiable = SimpleUnifier.Unify(name1, name2, out bindings);
                }
            }
            Assert.That(!isUnifiable);
            Assert.That(bindings == null);
        }
        public void Remove_EmptyNameSearchTree_False(string name, string value)
        {
            var tree          = new NameSearchTree <string>();
            var removeSuccess = tree.Remove(Name.BuildName(name));

            Assert.That(!removeSuccess);
        }
Exemplo n.º 26
0
        public void Unify_UnifiableNames_True(string n1, string n2, string[] result, Refactorization r)
        {
            var expectedBindings = result.Select(s => new Substitution(s));
            IEnumerable <Substitution> bindings = null;
            var isUnifiable = false;

            if (r == Refactorization.Current)
            {
                var name1 = Name.BuildName(n1);
                var name2 = Name.BuildName(n2);
                for (int i = 0; i < unifierReps; i++)
                {
                    isUnifiable = Unifier.Unify(name1, name2, out bindings);
                }
            }
            else if (r == Refactorization.New)
            {
                var name1 = new SimpleName(n1);
                var name2 = new SimpleName(n2);

                for (int i = 0; i < unifierReps; i++)
                {
                    isUnifiable = SimpleUnifier.Unify(name1, name2, out bindings);
                }
            }
            Assert.That(isUnifiable);
            if (result.Any())
            {
                Assert.That(bindings, Is.EquivalentTo(expectedBindings));
            }
            else
            {
                Assert.That(bindings.Count() == 0);
            }
        }
Exemplo n.º 27
0
        private static IEnumerable <DynamicPropertyResult> MathPropertyCalculator(IQueryContext context, Name x, Name op, Name y)
        {
            if (op.IsVariable || op.IsComposed)
            {
                yield break;
            }

            //TODO: Make sure that every dynamic property checks for empty constraints set
            var constraintsSets = context.Constraints.Any() ? context.Constraints : new[] { new SubstitutionSet() };

            foreach (var subSet in constraintsSets)
            {
                foreach (var xSubs in context.AskPossibleProperties(x).ToList())
                {
                    foreach (var ySubs in context.AskPossibleProperties(y).ToList())
                    {
                        if (xSubs.Item1.Value == Name.NIL_SYMBOL || ySubs.Item1.Value == Name.NIL_SYMBOL)
                        {
                            throw new Exception("Trying to perform a MATH operation on a Nil value");
                        }

                        float i = 0;

                        if (!float.TryParse(xSubs.Item1.Value.ToString(), out i) || !float.TryParse(ySubs.Item1.Value.ToString(), out i))
                        {
                            yield break;
                        }


                        var xValue = float.Parse(xSubs.Item1.Value.ToString(), CultureInfo.InvariantCulture);
                        var yValue = float.Parse(ySubs.Item1.Value.ToString(), CultureInfo.InvariantCulture);

                        if (op.ToString().EqualsIgnoreCase("Plus"))
                        {
                            var res = xValue + yValue;
                            yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(res)), subSet));
                        }

                        if (op.ToString().EqualsIgnoreCase("Minus"))
                        {
                            var res = xValue - yValue;
                            yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(res)), subSet));
                        }

                        if (op.ToString().EqualsIgnoreCase("Times"))
                        {
                            var res = xValue * yValue;
                            yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(res)), subSet));
                        }

                        if (op.ToString().EqualsIgnoreCase("Div"))
                        {
                            var res = xValue / yValue;
                            yield return(new DynamicPropertyResult(new ComplexValue(Name.BuildName(res)), subSet));
                        }
                    }
                }
            }
        }
Exemplo n.º 28
0
 public void Add_EmptyNameSearchTree_True(string name, string value)
 {
     for (int i = 0; i < rep; i++)
     {
         var tree = new NameSearchTree <string>();
         tree.Add(Name.BuildName(name), value);
     }
 }
Exemplo n.º 29
0
 public void Contains_EmptySearchTree_False(string name, string value)
 {
     for (int i = 0; i < rep; i++)
     {
         var tree = new NameSearchTree <string>();
         Assert.That(!tree.ContainsKey(Name.BuildName(name)));
     }
 }
Exemplo n.º 30
0
        public void RemovePerspective_NameWithSELF_ClonedNameWithAgentName(string nameString, string namePerspective, string resultName)
        {
            var name       = Name.BuildName(nameString);
            var clonedName = name.RemovePerspective(namePerspective);

            Assert.That(clonedName.ToString() == resultName);
            Assert.That(!ReferenceEquals(name, clonedName));
        }