@@ -55,6 +55,17 @@ class KArmedBanditAgent {
5555 */
5656 void set_step (float gamma, int move_lim);
5757
58+ // / @brief Returns the action (arm) selected by the most recent propose_action() call.
59+ size_t last_action () const { return last_action_; }
60+
61+ // / @brief Overrides the action credited by the next process_outcome() call.
62+ // / See MoveGenerator::save_proposal_state() for the intended usage.
63+ void set_last_action (size_t action) { last_action_ = action; }
64+
65+ // / @brief Copies the learned state (Q-values, action counts, step size) from `other`.
66+ // / Both agents must have been constructed with identical configurations.
67+ void copy_state_from (const KArmedBanditAgent& other);
68+
5869 protected:
5970 /* *
6071 * @brief Converts an action index to a move type.
@@ -252,6 +263,15 @@ class SimpleRLMoveGenerator : public MoveGenerator {
252263
253264 // Receives feedback about the outcome of the previously proposed move
254265 void process_outcome (double reward, e_reward_function reward_fun) override ;
266+
267+ // / @brief Saves/restores the agent action behind the most recent proposal.
268+ // / See MoveGenerator::save_proposal_state() for the intended usage.
269+ size_t save_proposal_state () const override { return karmed_bandit_agent->last_action (); }
270+ void restore_proposal_state (size_t state) override { karmed_bandit_agent->set_last_action (state); }
271+
272+ // / @brief Copies the agent state from another SimpleRLMoveGenerator.
273+ // / See MoveGenerator::copy_state_from() for the intended usage.
274+ void copy_state_from (const MoveGenerator& other) override ;
255275};
256276
257277template <class T , class >
0 commit comments