Exemplo n.º 1
0
        public override void UpdateStatus(ref IdaPoint pnt, SingleRunJob.Status theStatus)
        {
            //iterate through all points to find the order
            var im      = pnt.Im;
            var edp     = pnt.Edp;
            var dvrgFlg = pnt.DivergFlag;
            var nn      = TheGraph.TakeWhile(kvp => kvp.Value.Im < im).Count();

            StageChanged = false;
            var stage0 = CurStage;

            if (CurStage != Stage.Fill)
            {
                pnt.Slope = (pnt.Im - ImStable) / (edp - EdpStable);
                pnt.Slope = Math.Abs(pnt.Slope);
                if (nn == 1 && Math.Abs(InitSlope) < 1e-3)
                {
                    InitSlope = pnt.Slope;
                }
                pnt.RelSlope = pnt.Slope / InitSlope;
                if (edp > TetaLimit || pnt.RelSlope < 0.2 || dvrgFlg)
                {
                    pnt.CollapseFlag = true;
                    CurStage         = Stage.Bracket;
                    if (pnt.Im < ImCollapse)
                    {
                        ImCollapse   = pnt.Im;
                        ImForNexts   = ImStable + (ImCollapse - ImStable) / 3;
                        StageChanged = true;
                    }
                }
                else
                {
                    if (pnt.Im > ImStable)
                    {
                        ImStable  = pnt.Im;
                        EdpStable = edp;
                    }
                    if (CurStage == Stage.Hunt)
                    {
                        NLastStable = nn;
                    }
                }
                if (CurStage == Stage.Bracket)
                {
                    var clpseRsln = (ImCollapse - ImStable) / ImStable;
                    if (clpseRsln < MaxClpsRsltn)
                    {
                        CurStage     = Stage.Fill;
                        StageChanged = true;
                        ImForNexts   = (TheGraph[NLastStable].Im + TheGraph[NLastStable - 1].Im) / 2.0;
                        NLastStable--;
                        if (NLastStable < 1)
                        {
                            Continue = false;
                        }
                    }
                }
            }
            pnt.StringOut = string.Format("{0} {1}", CurStage, theStatus);
            pnt.Order     = nn;
            EndStatusUpdate(pnt);
        }
Exemplo n.º 2
0
 public abstract void UpdateStatus(ref IdaPoint pnt, SingleRunJob.Status theStatus);