예제 #1
0
        public void Run()
        {
            Reasoner reasoner = GetReasoner();

            while (running)
            {
                if (reasoner.GetSettings().IsSync())
                {
                    //WaitSyncSignal();
                    ReasoningCycle();
                    bool isBreakPoint = false;
                    try
                    {
                        isBreakPoint = reasoner.GetCircumstance().GetSelectedOption().GetPlan().HasBreakpoint();
                    }
                    catch (NullReferenceException e)
                    {
                        // no problem, there is no sel opt, no plan ....
                    }
                    InformCycleFinished(isBreakPoint, GetCycleNumber());
                }
                else
                {
                    GetUserAgArch().IncCycleNumber();
                    ReasoningCycle();
                    if (reasoner.CanSleep())
                    {
                        Sleep();
                    }
                }
            }
        }