示例#1
0
            /// <summary>
            /// 次の状態を記録する
            /// </summary>
            /// <param name="state">次の状態</param>
            /// <param name="appended">次の状態に紐付く添付オブジェクト</param>
            /// <remarks></remarks>
            private void Memorize(string state, object appended = null)
            {
                if (!_pastToExpected.ContainsKey(_currentState))
                {
                    _pastToExpected.Add(_currentState, new ExpectedStates());
                }
                _pastToExpected[_currentState].AddExpectedState(state, appended);

                _currentState = _currentState.GetNextPastStates(state);
            }
示例#2
0
            private ExpectedState[] GetExpectedStateRank(PastStates currentState, double provably, int depth)
            {
                if (depth <= 0)
                {
                    return(new ExpectedState[] { });
                }

                if (!_pastToExpected.ContainsKey(currentState))
                {
                    return(new ExpectedState[] { });
                }

                ExpectedState[] nextExpectedStates = _pastToExpected[currentState].GetExpectedStateRank(provably, _predictWidth);
                foreach (ExpectedState nextExpectedState in nextExpectedStates)
                {
                    _bestRank.AddRange(this.GetExpectedStateRank(currentState.GetNextPastStates(nextExpectedState.State), nextExpectedState.Provably, depth - 1));
                }

                return(nextExpectedStates);
            }