File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
mjpc/planners/sample_gradient Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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
166166void 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 );
You can’t perform that action at this time.
0 commit comments