Example #1
0
        public virtual void Update()
        {
            solver = solver ?? new Solver <T>();
            if (policies.Block(status) || IsActing())
            {
                return;
            }
            var s    = status;
            var next = (solver.status != S.Running) ? StartSolving()
                   : solver.Iterate(config.frameBudget);

            if (next != null)
            {
                handler.Effect(next.Head(), this);
            }
            policies.OnResult(status, ObjectName(this));
            if (s != status)
            {
                NotifyPropertyChanged(nameof(status));
            }
        }
Example #2
0
        [Test] public void NoActionCases(
            [Values(S.Done, S.Running, S.MaxIterExceeded,
                    S.CapacityExceeded)] S s,
            [Values(true, false)] bool warnOnFail,
            [Values(true, false)] bool warnOnOverflow)
        {
            x.warnOnFail     = warnOnFail;
            x.warnOnOverflow = warnOnOverflow;
        #if UNITY_2018_1_OR_NEWER
            switch (s)
            {
            case S.MaxIterExceeded:
                LogAssert.Expect(LogType.Error, ": MaxIterExceeded");
                break;

            case S.CapacityExceeded:
                LogAssert.Expect(LogType.Error, ": CapacityExceeded");
                break;
            }
        #endif
            x.OnResult(s);
            o(x.Block(s), s == S.MaxIterExceeded || s == S.CapacityExceeded);
        }