fork download
  1. State BeamSearch(State FirstState)
  2. {
  3. Heap<State> HNowStates = new Heap<State>();
  4. HNowStates.push(FirstState);
  5. int k = 100; //ビーム幅
  6.  
  7. for (int t = 0; t < MaxTurn; t++)
  8. {
  9. Heap<State> HNextStates = new Heap<State>();
  10. for (int i = 0; i < k; i++)
  11. {
  12. if (HNowStates.top == null) break;
  13. var NowState = HNowStates.pop();
  14. foreach (var NextState in NowState.GetAllNextState())
  15. {
  16. HNextStates.push(NextState);
  17. }
  18. }
  19. HNowStates = HNextStates;
  20.  
  21. }
  22. var BestState = HNowStates.pop();
  23. return BestState;
  24. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,4): error CS1525: Unexpected symbol `State'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty