Exemplo n.º 1
0
        public void TestItShouldFindTwelveMapsForBenzeneOntoBenzene()
        {
            IMapper mapper = new VFMapper(benzene, true);
            var     maps   = mapper.GetMaps(benzene);

            Assert.AreEqual(12, maps.Count);
        }
Exemplo n.º 2
0
        public void TestItShouldFindTwentyFourMapsForBenzeneOntoNaphthalene()
        {
            IMapper mapper = new VFMapper(benzene, true);
            var     maps   = mapper.GetMaps(naphthalene);

            Assert.AreEqual(24, maps.Count);
        }
Exemplo n.º 3
0
        public void TestItShouldFindAMapForEquivalentFormsOfToluene()
        {
            IMapper mapper = new VFMapper(toluene, true);
            var     map    = mapper.GetFirstMap(toluene4);

            Assert.AreEqual(7, map.Count);
        }
Exemplo n.º 4
0
        public void TestItShouldFindTwoMapsForEquivalentFormsOfToluene()
        {
            IMapper mapper = new VFMapper(toluene, true);
            var     maps   = mapper.GetMaps(toluene4);

            Assert.AreEqual(2, maps.Count);
        }
Exemplo n.º 5
0
        public void TestItShouldMapSixAtomsOfBenzeneOntoBenzene()
        {
            IMapper mapper = new VFMapper(benzene, true);
            var     map    = mapper.GetFirstMap(benzene);

            Assert.AreEqual(6, map.Count);
        }
Exemplo n.º 6
0
        private void SearchVFMappings()
        {
            //        Console.Out.WriteLine("searchVFMappings ");
            IQuery  query  = null;
            IMapper mapper = null;

            vfLibSolutions = new Dictionary <INode, IAtom>();
            if (queryMol != null)
            {
                query  = new QueryCompiler(queryMol).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var map = mapper.GetFirstMap(GetProductMol());
                    if (map != null)
                    {
                        foreach (var e in map)
                        {
                            vfLibSolutions[e.Key] = e.Value;
                        }
                    }
                }
                SetVFMappings(true, query);
            }
            else if (GetReactantMol().Atoms.Count <= GetProductMol().Atoms.Count)
            {
                query  = new QueryCompiler(mol1, IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var map = mapper.GetFirstMap(GetProductMol());
                    if (map != null)
                    {
                        foreach (var e in map)
                        {
                            vfLibSolutions[e.Key] = e.Value;
                        }
                    }
                }
                SetVFMappings(true, query);
            }
            else
            {
                query  = new QueryCompiler(GetProductMol(), IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetReactantMol()))
                {
                    var map = mapper.GetFirstMap(GetReactantMol());
                    if (map != null)
                    {
                        foreach (var e in map)
                        {
                            vfLibSolutions[e.Key] = e.Value;
                        }
                    }
                }
                SetVFMappings(false, query);
            }
        }
Exemplo n.º 7
0
        public void TestItShouldFindTwoMapsFromHexaneToHexane()
        {
            IMapper mapper = new VFMapper(hexane, true);

            var maps = mapper.GetMaps(hexane);

            Assert.AreEqual(2, maps.Count);
        }
Exemplo n.º 8
0
        public void TestItShouldNotMatchBenzeneToPyridine()
        {
            IMapper mapper = new VFMapper(benzene, true);

            Assert.IsFalse(mapper.HasMap(pyridine));

            mapper = new VFMapper(pyridine, true);

            Assert.IsFalse(mapper.HasMap(benzene));
        }
Exemplo n.º 9
0
        private void SearchVFMappings()
        {
            IQuery  query  = null;
            IMapper mapper = null;

            vfLibSolutions = new List <IReadOnlyDictionary <INode, IAtom> >();
            if (queryMol != null)
            {
                query  = new QueryCompiler(queryMol).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var maps = mapper.GetMaps(GetProductMol());
                    if (maps != null)
                    {
                        vfLibSolutions.AddRange(maps);
                    }
                }
                SetVFMappings(true, query);
            }
            else if (GetReactantMol().Atoms.Count <= GetProductMol().Atoms.Count)
            {
                query  = new QueryCompiler(mol1, IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetProductMol()))
                {
                    var maps = mapper.GetMaps(GetProductMol());
                    if (maps != null)
                    {
                        vfLibSolutions.AddRange(maps);
                    }
                }
                SetVFMappings(true, query);
            }
            else
            {
                query  = new QueryCompiler(GetProductMol(), IsBondMatchFlag).Compile();
                mapper = new VFMapper(query);
                if (mapper.HasMap(GetReactantMol()))
                {
                    var maps = mapper.GetMaps(GetReactantMol());
                    if (maps != null)
                    {
                        vfLibSolutions.AddRange(maps);
                    }
                }
                SetVFMappings(false, query);
            }
        }
Exemplo n.º 10
0
        public void TestItShouldMatchHexaneToHexaneWhenUsingMolecule()
        {
            IMapper mapper = new VFMapper(hexane, true);

            Assert.IsTrue(mapper.HasMap(hexane));
        }
Exemplo n.º 11
0
        public void TestItShouldMatchBenzeneToBenzene()
        {
            IMapper mapper = new VFMapper(benzene, true);

            Assert.IsTrue(mapper.HasMap(benzene));
        }
Exemplo n.º 12
0
        public void TestItShouldNotMatchPyridazineToNaphthalene()
        {
            IMapper mapper = new VFMapper(pyridazine, true);

            Assert.IsFalse(mapper.HasMap(naphthalene));
        }
Exemplo n.º 13
0
        public void TestItShouldNotMatchChlorobenzeneTo4ChloroIsoquinoline()
        {
            IMapper mapper = new VFMapper(chlorobenzene, true);

            Assert.IsFalse(mapper.HasMap(chloroisoquinoline4));
        }
Exemplo n.º 14
0
        public void TestItShouldCountTwoMapsForTolueneOntoToluene()
        {
            IMapper mapper = new VFMapper(toluene, true);

            Assert.AreEqual(2, mapper.CountMaps(toluene));
        }
Exemplo n.º 15
0
        public void TestItShouldCountTwelveMapsForBenzeneOntoBenzene()
        {
            IMapper mapper = new VFMapper(benzene, true);

            Assert.AreEqual(12, mapper.CountMaps(benzene));
        }
Exemplo n.º 16
0
        public void TestItShouldNotMatchTolueneToBenzene()
        {
            IMapper mapper = new VFMapper(toluene, true);

            Assert.IsFalse(mapper.HasMap(benzene));
        }
Exemplo n.º 17
0
        public void TestItShouldNotMatchTolueneToPhenol()
        {
            IMapper mapper = new VFMapper(toluene, true);

            Assert.IsFalse(mapper.HasMap(phenol));
        }
Exemplo n.º 18
0
        public void TestItShouldMatchPropaneToCyclopropane()
        {
            IMapper mapper = new VFMapper(propane, true);

            Assert.IsTrue(mapper.HasMap(cyclopropane));
        }
Exemplo n.º 19
0
        public void TestItShouldMatchAcetoneToAcetone()
        {
            IMapper mapper = new VFMapper(acetone, true);

            Assert.IsTrue(mapper.HasMap(acetone));
        }