Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 3
0
 public override bool Equals(object obj)
 {
     if (obj is StateActionKey)
     {
         StateActionKey rhs = obj as StateActionKey;
         return(mUniqueId == rhs.GetHashCode());
     }
     return(false);
 }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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);
        }
Exemplo n.º 6
0
        public static StateActionKey Create(int state_id, int action_id)
        {
            StateActionKey key = new StateActionKey(state_id, action_id);

            return(key);
        }