Exemple #1
0
        private void SetQEntry(int state_id, int action_id, double Q)
        {
            mStateSet.Add(state_id);
            FindActionSetAtState(state_id).Add(action_id);
            StateActionKey key = StateActionKey.Create(state_id, action_id);

            mQMatrix[key] = Q;
        }
Exemple #2
0
        public override void SetAlpha(int state_id, int action_id, double newValue)
        {
            mStateSet.Add(state_id);
            FindActionSetAtState(state_id).Add(state_id);
            StateActionKey key = StateActionKey.Create(state_id, action_id);

            mAlphaMatrix[key] = newValue;
        }
Exemple #3
0
        private double FindQEntry(int state_id, int action_id)
        {
            StateActionKey key = StateActionKey.Create(state_id, action_id);

            if (mQMatrix.ContainsKey(key))
            {
                return(mQMatrix[key]);
            }
            return(mInitialQ);
        }
Exemple #4
0
        public override double GetAlpha(int state_id, int action_id)
        {
            StateActionKey key   = StateActionKey.Create(state_id, action_id);
            double         alpha = -1;

            if (mAlphaMatrix.ContainsKey(key))
            {
                alpha = mAlphaMatrix[key];
            }
            if (alpha < 0)
            {
                return(mAlphaValue);
            }
            return(alpha);
        }