Differences From Artifact [4176698dd9ba368b]:
- File
src/solver.d
- 2012-07-15 22:56:00 - part of checkin [9a93aeb664] on branch trunk - Adoptive replanning. (user: kinaba) [annotate]
To Artifact [469e63844195a7a0]:
- File
src/solver.d
- 2012-07-15 22:57:43 - part of checkin [fa2f8e21f2] on branch trunk - messages to stderr. (user: kinaba) [annotate]
345 345 // If the future is bad, correct.
346 346 if( plan_state==Tentative_Stuck && plan.length<PredictFuture )
347 347 replan();
348 348
349 349 // Follow the predicted plan.
350 350 if( plan.empty )
351 351 return 'A';
352 -writeln(plan, " ", plan_state);
352 +stderr.writeln(plan, " ", plan_state);
353 353 char c = plan[0];
354 354 plan = plan[1..$];
355 355 current_game.command(c);
356 356 return c;
357 357 }
358 358
359 359 void force(char c)
................................................................................
388 388 plan_state = (sub_solver.g.dead ? Tentative_Stuck :
389 389 sub_solver.g.cleared ? Fixed : Tentative);
390 390 }
391 391 }
392 392
393 393 void replan()
394 394 {
395 -writeln("replan!");
395 +stderr.writeln("replan!");
396 396 // Try to replace every step of the plan by another move.
397 397 Game g = current_game.clone();
398 398 Tuple!(long, SubSolver, string, int) cand =
399 399 tuple(sub_solver.g.score, sub_solver, plan, Tentative_Stuck);
400 400 for(int i=0; i<plan.length; ++i) {
401 401 foreach(string prefix; ["U","D","L","R","UD","DU","LR","RL"])
402 402 if(prefix[0] != plan[i]) {