Exemple #1
0
        //Link between Cell and ALS
        public void QSearch_Cell2ALS_Link( )
        {
            if (ALSLst == null)
            {
                PrepareALSLinkMan(1);
            }
            if (LinkCeAlsLst != null)
            {
                return;
            }
            LinkCeAlsLst = new List <LinkCellALS> [81];
            if (ALSLst == null || ALSLst.Count < 2)
            {
                return;
            }

            foreach (var PA in ALSLst.Where(P => P.singly))
            {
                foreach (var no in PA.FreeB.IEGet_BtoNo())
                {
                    int   noB = (1 << no);
                    Bit81 H   = new Bit81(true);
                    foreach (var P in PA.UCellLst.Where(q => (q.FreeB & noB) > 0))
                    {
                        H &= pConnectedCells[P.rc];
                    }
                    if (H.IsZero())
                    {
                        continue;
                    }
                    foreach (var P in H.IEGetUCeNoB(pBDL, noB))
                    {
                        var Q = new LinkCellALS(P, PA, no);
                        if (LinkCeAlsLst[P.rc] == null)
                        {
                            LinkCeAlsLst[P.rc] = new List <LinkCellALS>();
                        }
                        LinkCeAlsLst[P.rc].Add(Q);
                    }
                }
            }
            for (int rc = 0; rc < 81; rc++)
            {
                if (LinkCeAlsLst[rc] != null)
                {
                    LinkCeAlsLst[rc].Sort();
                }
            }
        }
        public int CompareTo(object obj)
        {
            LinkCellALS A = obj as LinkCellALS;

            return(this.ALS.ID - A.ALS.ID);
        }