Пример #1
0
        public When_mine_is_called_the_apriori_algorithm()
        {
            var mockFactsGenerators = new List <IFactsGenerator <string> >()
            {
                new MockFactsGenerator()
            };

            apriori = new Apriori <string>(new SelfJoinAndPruneGenerator <string>(), mockFactsGenerators);
            factA   = new MockSimpleFact("A");
            factB   = new MockSimpleFact("B");
            factC   = new MockSimpleFact("C");
        }
Пример #2
0
        public int CompareTo(IFact <T> that)
        {
            if (that == null)
            {
                return(-1);
            }

            if (!Object.ReferenceEquals(this.GetType(), that.GetType()))
            {
                return(this.GetType().ToString().CompareTo(that.GetType().ToString()));
            }
            else
            {
                return(CompareSameFact(that));
            }
        }
Пример #3
0
 private bool HasImplication(IFact <T> fact1, IFact <T> fact2)
 {
     return(fact1.Implies(fact2) || fact2.Implies(fact1));
 }
 public When_GeneratePowerSet_is_called()
 {
     factA = new MockSimpleFact("A");
     factB = new MockSimpleFact("B");
     factC = new MockSimpleFact("C");
 }
Пример #5
0
 public virtual int CompareSameFact(IFact <T> that)
 {
     return(this.Value.CompareTo(that.Value));
 }
Пример #6
0
 public abstract bool Implies(IFact <T> that);