public Link GetCollectionFromEdge(LinkEdge link)
        {
            var collection = new Link();

            collection.From = _atomService.GetCollectionFromNode(link.From);
            collection.To   = _atomService.GetCollectionFromNode(link.To);
            return(collection);
        }
Пример #2
0
        public SGChromosome Crossover(SGChromosome pair)
        {
            List <LinkEdge> childLinks = new List <LinkEdge>();

            childLinks.AddRange(LinkEdge.ListClone(this.Molecule.LinkEdges.Take(this.Molecule.LinkEdges.Count / 2).ToList()));
            childLinks.AddRange(LinkEdge.ListClone(pair.Molecule.LinkEdges.Skip(childLinks.Count).ToList()));

            return(new SGChromosome(new MoleculeGraph(this.Molecule.Nomenclature, AtomNode.ListClone(this.Molecule.AtomNodes), childLinks)));
        }