本文整理汇总了C#中HRSim.Playfield.printBoard方法的典型用法代码示例。如果您正苦于以下问题:C# Playfield.printBoard方法的具体用法?C# Playfield.printBoard怎么用?C# Playfield.printBoard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HRSim.Playfield
的用法示例。
在下文中一共展示了Playfield.printBoard方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: getMove
public override Action getMove()
{
bestValue = float.MinValue;
bestBoard = new Playfield(board);
currentState = new Node(board, null, 0);
if (expand(currentState) == 1) return null; // no moves
bool isEndReachedBefore = isEndReached;
for (int i = 0; i < 500; i++)
{
//Helpfunctions.Instance.logg("try: " + i);
//counter++;
//if (counter == 10) {
// Helpfunctions.Instance.logg("try: " + i);
// counter = 0;
//}
//if (i == 752) {
// int debug = 1;
//}
if (isEndReachedBefore != isEndReached)
{
//Helpfunctions.Instance.logg("try: " + i + " reach");
break;
}
else
{
//Helpfunctions.Instance.logg("try: " + i + " not reach");
}
UCTRun(currentState, 0.7f);
//currentState.state = new Playfield(board);
}
if (isEndReachedBefore != isEndReached)
{
currentState = new Node(board, null, 0);
if (expand(currentState) == 1) return null; // no moves
for (int i = 0; i < 10000; i++)
{
UCTRun(currentState, 0.7f);
currentState.state = new Playfield(board);
}
}
int maxVisit = 0;
Action selectedMove = null;
Node selectedChild = null;
foreach (Node child in currentState.children)
{
//child.move.print();
//Helpfunctions.Instance.logg("count = " + child.numVisited);
if (child.numVisited > maxVisit)
{
maxVisit = child.numVisited;
selectedMove = child.move;
selectedChild = child;
}
}
//Helpfunctions.Instance.logg("Turn of child:" + selectedChild.state.isOwnTurn);
//currentState.printChildren();
Helpfunctions.Instance.logg("best value:" + bestValue);
bestBoard.printBoard();
return selectedMove;
}