5
5
std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> create_move_generators (PlacerState& placer_state,
6
6
const t_placer_opts& placer_opts,
7
7
int move_lim,
8
- double noc_attraction_weight) {
8
+ double noc_attraction_weight,
9
+ vtr::RngContainer& rng) {
9
10
e_reward_function reward_fun = string_to_reward (placer_opts.place_reward_fun );
10
11
std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> move_generators;
11
12
@@ -66,12 +67,14 @@ std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> create
66
67
VTR_LOG (" Using simple RL 'Epsilon Greedy agent' for choosing move and block types\n " );
67
68
karmed_bandit_agent1 = std::make_unique<EpsilonGreedyAgent>(first_state_avail_moves,
68
69
e_agent_space::MOVE_BLOCK_TYPE,
69
- placer_opts.place_agent_epsilon );
70
+ placer_opts.place_agent_epsilon ,
71
+ rng);
70
72
} else {
71
73
VTR_LOG (" Using simple RL 'Epsilon Greedy agent' for choosing move types\n " );
72
74
karmed_bandit_agent1 = std::make_unique<EpsilonGreedyAgent>(first_state_avail_moves,
73
75
e_agent_space::MOVE_TYPE,
74
- placer_opts.place_agent_epsilon );
76
+ placer_opts.place_agent_epsilon ,
77
+ rng);
75
78
}
76
79
karmed_bandit_agent1->set_step (placer_opts.place_agent_gamma , move_lim);
77
80
move_generators.first = std::make_unique<SimpleRLMoveGenerator>(placer_state,
@@ -82,7 +85,8 @@ std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> create
82
85
// agent's 2nd state
83
86
karmed_bandit_agent2 = std::make_unique<EpsilonGreedyAgent>(second_state_avail_moves,
84
87
e_agent_space::MOVE_TYPE,
85
- placer_opts.place_agent_epsilon );
88
+ placer_opts.place_agent_epsilon ,
89
+ rng);
86
90
karmed_bandit_agent2->set_step (placer_opts.place_agent_gamma , move_lim);
87
91
move_generators.second = std::make_unique<SimpleRLMoveGenerator>(placer_state,
88
92
reward_fun,
@@ -95,11 +99,13 @@ std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> create
95
99
if (placer_opts.place_agent_space == e_agent_space::MOVE_BLOCK_TYPE) {
96
100
VTR_LOG (" Using simple RL 'Softmax agent' for choosing move and block types\n " );
97
101
karmed_bandit_agent1 = std::make_unique<SoftmaxAgent>(first_state_avail_moves,
98
- e_agent_space::MOVE_BLOCK_TYPE);
102
+ e_agent_space::MOVE_BLOCK_TYPE,
103
+ rng);
99
104
} else {
100
105
VTR_LOG (" Using simple RL 'Softmax agent' for choosing move types\n " );
101
106
karmed_bandit_agent1 = std::make_unique<SoftmaxAgent>(first_state_avail_moves,
102
- e_agent_space::MOVE_TYPE);
107
+ e_agent_space::MOVE_TYPE,
108
+ rng);
103
109
}
104
110
karmed_bandit_agent1->set_step (placer_opts.place_agent_gamma , move_lim);
105
111
move_generators.first = std::make_unique<SimpleRLMoveGenerator>(placer_state,
@@ -109,7 +115,8 @@ std::pair<std::unique_ptr<MoveGenerator>, std::unique_ptr<MoveGenerator>> create
109
115
placer_opts.place_high_fanout_net );
110
116
// agent's 2nd state
111
117
karmed_bandit_agent2 = std::make_unique<SoftmaxAgent>(second_state_avail_moves,
112
- e_agent_space::MOVE_TYPE);
118
+ e_agent_space::MOVE_TYPE,
119
+ rng);
113
120
karmed_bandit_agent2->set_step (placer_opts.place_agent_gamma , move_lim);
114
121
move_generators.second = std::make_unique<SimpleRLMoveGenerator>(placer_state,
115
122
reward_fun,
0 commit comments