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

IterativeSearchStateSpace() protected méthode

protected IterativeSearchStateSpace ( ) : ZingerResult
Résultat ZingerResult
        protected override ZingerResult IterativeSearchStateSpace()
        {
            //outer loop to search the state space iteratively
            do
            {
                //Increment the iterative bound
                ZingerConfiguration.zBoundedSearch.IncrementIterativeBound();

                try
                {
                    //set number of schedules explored to 0
                    ZingerConfiguration.numberOfSchedulesExplored = 0;

                    searchWorkers = new Task[ZingerConfiguration.DegreeOfParallelism];
                    //create parallel search threads
                    for (int i = 0; i < ZingerConfiguration.DegreeOfParallelism; i++)
                    {
                        searchWorkers[i] = Task.Factory.StartNew(SearchStateSpace, i);
                        System.Threading.Thread.Sleep(10);
                    }

                    //Wait for all search workers to finish
                    Task.WaitAll(searchWorkers);
                }
                catch (AggregateException ex)
                {
                    foreach (var inner in ex.InnerExceptions)
                    {
                        if ((inner is ZingException))
                        {
                            return lastErrorFound;
                        }
                        else
                        {
                            ZingerUtilities.PrintErrorMessage("Unknown Exception in Zing:");
                            ZingerUtilities.PrintErrorMessage(inner.ToString());
                            return ZingerResult.ZingRuntimeError;
                        }
                    }
                }

                ZingerStats.NumOfFrontiers = -1;
                ZingerStats.PrintPeriodicStats();
            }
            while (!ZingerConfiguration.zBoundedSearch.checkIfFinalCutOffReached());

            return ZingerResult.Success;
        }