示例#1
0
        public void ComplexTest()
        {
            Atom A = new AllHave(new PropertyCheckers.PropertyHasValue("Face", "One"));
            Atom B = new ExistsOneHas(new PropertyCheckers.PropertyHasValue("Colour", "Black"));
            Rule rule1 = new Rule(new Not(new Not(new Or(new Not(new And(A,B)), B))));

            Assert.AreEqual("NOT (NOT ((NOT ((AllHave [Face == One]) AND (ExistsOneHas [Colour == Black]))) OR (ExistsOneHas [Colour == Black])))", rule1.ToString());

            Assert.AreEqual("((ExistsOneHas [NOT (Face == One)]) OR (AllHave [NOT (Colour == Black)])) OR (ExistsOneHas [Colour == Black])", rule1.ToNormalForm().ToString());
        }
示例#2
0
        public void ComplexTest()
        {
            Atom A     = new AllHave(new PropertyCheckers.PropertyHasValue("Face", "One"));
            Atom B     = new ExistsOneHas(new PropertyCheckers.PropertyHasValue("Colour", "Black"));
            Rule rule1 = new Rule(new Not(new Not(new Or(new Not(new And(A, B)), B))));

            Assert.AreEqual("NOT (NOT ((NOT ((AllHave [Face == One]) AND (ExistsOneHas [Colour == Black]))) OR (ExistsOneHas [Colour == Black])))", rule1.ToString());

            Assert.AreEqual("((ExistsOneHas [NOT (Face == One)]) OR (AllHave [NOT (Colour == Black)])) OR (ExistsOneHas [Colour == Black])", rule1.ToNormalForm().ToString());
        }
    // Use this for initialization
    void Start()
    {
        Atom A     = new AllHave(new PropertyCheckers.PropertyHasValue("Face", "One"));
        Atom B     = new ExistsOneHas(new PropertyCheckers.PropertyHasValue("Colour", "Black"));
        Rule rule1 = new Rule(new Not(new And(A, B)));
        Rule rule2 = new Rule(new Or(A.Negate(), B.Negate()));

        Debug.Log(rule1.ToString());
        Debug.Log(rule2.ToString());

        Debug.Log(rule1.ToNormalForm().ToString());
        Debug.Log(rule2.ToNormalForm().ToString());

        Debug.Log("Unormalised - " + rule1.Equals(rule2));
        Debug.Log("Normalised - " + rule1.ToNormalForm().Equals(rule2.ToNormalForm()));
    }
	// Use this for initialization
	void Start ()
	{
		Atom A = new AllHave(new PropertyCheckers.PropertyHasValue("Face","One"));
		Atom B = new ExistsOneHas(new PropertyCheckers.PropertyHasValue("Colour", "Black"));
		Rule rule1 = new Rule(new Not(new And(A,B)));
		Rule rule2 = new Rule(new Or(A.Negate(), B.Negate()));

		Debug.Log (rule1.ToString());
		Debug.Log (rule2.ToString());

		Debug.Log (rule1.ToNormalForm().ToString());
		Debug.Log (rule2.ToNormalForm().ToString());

		Debug.Log ("Unormalised - " + rule1.Equals(rule2));
		Debug.Log ("Normalised - " + rule1.ToNormalForm().Equals(rule2.ToNormalForm()));
	}
示例#5
0
 void Awake()
 {
     node = new ExistsOneHas(null);
     filterSelector.OnCheckerSelected += SetPropertyFilter;
     checkSelector.OnCheckerSelected  += SetPropertyCheck;
 }
示例#6
0
	void Awake()
	{
		node = new ExistsOneHas(null);
		filterSelector.OnCheckerSelected += SetPropertyFilter;
		checkSelector.OnCheckerSelected += SetPropertyCheck;
	}