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