Skip to content

Commit 0cea53c

Browse files
committed
address yuval comments
1 parent 6b881d3 commit 0cea53c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mjpc/planners/sample_gradient/planner.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void SampleGradientPlanner::SetState(const State& state) {
162162
&this->time);
163163
}
164164

165-
// optimize nominal policy using random sampling
165+
// optimize nominal policy using random sampling and gradient search
166166
void SampleGradientPlanner::OptimizePolicy(int horizon, ThreadPool& pool) {
167167
// if num_trajectory_ has changed, use it in this new iteration.
168168
// num_trajectory_ might change while this function runs. Keep it constant
@@ -214,7 +214,7 @@ void SampleGradientPlanner::OptimizePolicy(int horizon, ThreadPool& pool) {
214214
// start timer
215215
auto policy_update_start = std::chrono::steady_clock::now();
216216

217-
// sort candidate policies and trajectories by score
217+
// initial order for partial sort
218218
for (int i = 0; i < num_trajectory; i++) {
219219
trajectory_order[i] = i;
220220
}
@@ -254,7 +254,7 @@ void SampleGradientPlanner::OptimizePolicy(int horizon, ThreadPool& pool) {
254254
times_scratch);
255255
}
256256

257-
// improvement: compare nominal to elite average
257+
// improvement: compare nominal to winner
258258
improvement = mju_max(
259259
trajectory[idx_nominal].total_return - trajectory[winner].total_return,
260260
0.0);

0 commit comments

Comments
 (0)