mirror of
https://github.com/Noratrieb/monte-carlo-tree-search.git
synced 2026-01-14 15:25:09 +01:00
lol
This commit is contained in:
parent
dff9ca7c2d
commit
ae7c64c624
1 changed files with 24 additions and 3 deletions
27
src/lib.rs
27
src/lib.rs
|
|
@ -109,11 +109,32 @@ mod mcts {
|
||||||
node.children.set(children);
|
node.children.set(children);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn simulate_random_playout<S>(_node: &Node<'_, S>) -> u64 {
|
fn back_propagation<S>(node: &Node<'_, S>, _playout_result: u64) {
|
||||||
todo!()
|
let mut temp_node = Some(node);
|
||||||
|
|
||||||
|
while let Some(node) = temp_node {
|
||||||
|
// todo increment visit
|
||||||
|
// todo increment win count if we won
|
||||||
|
temp_node = node.parent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn back_propagation<S>(_node: &Node<'_, S>, _playout_result: u64) {
|
fn simulate_random_playout<S>(_node: &Node<'_, S>) -> u64 {
|
||||||
|
/*
|
||||||
|
Node tempNode = new Node(node);
|
||||||
|
State tempState = tempNode.getState();
|
||||||
|
int boardStatus = tempState.getBoard().checkStatus();
|
||||||
|
if (boardStatus == opponent) {
|
||||||
|
tempNode.getParent().getState().setWinScore(Integer.MIN_VALUE);
|
||||||
|
return boardStatus;
|
||||||
|
}
|
||||||
|
while (boardStatus == Board.IN_PROGRESS) {
|
||||||
|
tempState.togglePlayer();
|
||||||
|
tempState.randomPlay();
|
||||||
|
boardStatus = tempState.getBoard().checkStatus();
|
||||||
|
}
|
||||||
|
return boardStatus;
|
||||||
|
*/
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue