Esempio n. 1
0
        public void TestItShouldFindTwoMapsForEquivalentFormsOfToluene()
        {
            IMapper mapper = new VFMapper(toluene, true);
            var     maps   = mapper.GetMaps(toluene4);

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

            Assert.AreEqual(24, maps.Count);
        }
Esempio n. 3
0
        public void TestItShouldFindTwelveMapsForBenzeneOntoBenzene()
        {
            IMapper mapper = new VFMapper(benzene, true);
            var     maps   = mapper.GetMaps(benzene);

            Assert.AreEqual(12, maps.Count);
        }
Esempio n. 4
0
        public void TestItShouldFindTwoMapsFromHexaneToHexane()
        {
            IMapper mapper = new VFMapper(hexane, true);

            var maps = mapper.GetMaps(hexane);

            Assert.AreEqual(2, maps.Count);
        }
        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);
            }
        }