Microsoft.Zing.ZingExplorerDelayBoundedSampling.SearchStateSpace C# (CSharp) Méthode

SearchStateSpace() protected méthode

protected SearchStateSpace ( object obj ) : void
obj object
Résultat void
        protected override void SearchStateSpace(object obj)
        {
            int myThreadId = (int)obj;
            //maximum number of schedules per iteration = c1 + c2^d.
            // c1 = ZingerConfiguration.MaxSchedulesPerIteration.
            // c2 = 3 as we found that to work the best.
            int maxSchedulesPerIteration = ZingerConfiguration.MaxSchedulesPerIteration + ZingerConfiguration.zBoundedSearch.IterativeCutoff;
            int delayBudget = 0;
            Stack<TraversalInfo> searchStack = new Stack<TraversalInfo>();
            //frontier
            FrontierNode startfN = new FrontierNode(StartStateTraversalInfo);
            TraversalInfo startState = startfN.GetTraversalInfo(StartStateStateImpl, myThreadId);

            while (ZingerConfiguration.numberOfSchedulesExplored < maxSchedulesPerIteration)
            {
                //kil the exploration if bug found
                //Check if cancelation token triggered
                if (CancelTokenZingExplorer.IsCancellationRequested)
                {
                    //some task found bug and hence cancelling this task
                    return;
                }

                delayBudget = ZingerConfiguration.zBoundedSearch.IterativeCutoff;

                //increment the schedule count
                Interlocked.Increment(ref ZingerConfiguration.numberOfSchedulesExplored);

                ZingerStats.IncrementNumberOfSchedules();

                searchStack = new Stack<TraversalInfo>();
                searchStack.Push(startState);
                int lastStartPoint = 1;
                while (delayBudget > 0)
                {
                    RunToCompletionWithDelayZero(searchStack);
                    lastStartPoint = RandomBackTrackAndDelay(searchStack, lastStartPoint);
                    if (lastStartPoint == -1)
                    {
                        break;
                    }
                    delayBudget--;
                }
            }
        }