aqtech-ca / mctreesearch4j

MIT License
7 stars 1 forks source link

Add adversarial solver implementation #12

Closed JunTaoLuo closed 3 years ago

JunTaoLuo commented 3 years ago

Currently it is implemented as a stateless solver and is manually tested with a Connect4 implementation.

A few items that might be added:

  1. adversarial stateful solver
  2. ability to play Connect4 as second player.
larkz commented 3 years ago

@JunTaoLuo can you please address the merge conflicts, I tried to rebase, but there seems to be a conflict with how you are using the lib

> Task :compileKotlin FAILED
e: /Users/eric/code/KotExp/app/src/main/kotlin/ConnectFourMDP.kt: (34, 34): Return type of 'initialState' is not a subtype of the return type of the overridden member 'public abstract fun initialState(): ConnectFourState defined in MDP'
e: /Users/eric/code/KotExp/app/src/main/kotlin/ConnectFourMDP.kt: (70, 68): Return type of 'transition' is not a subtype of the return type of the overridden member 'public abstract fun transition(state: ConnectFourState, action: Int): ConnectFourState defined in MDP'
e: /Users/eric/code/KotExp/app/src/main/kotlin/GridworldMDP.kt: (7, 34): Return type of 'initialState' is not a subtype of the return type of the overridden member 'public abstract fun initialState(): GridworldState defined in MDP'
e: /Users/eric/code/KotExp/app/src/main/kotlin/GridworldMDP.kt: (38, 78): Return type of 'transition' is not a subtype of the return type of the overridden member 'public abstract fun transition(state: GridworldState, action: GridworldAction): GridworldState defined in MDP'
e: /Users/eric/code/KotExp/app/src/main/kotlin/main.kt: (118, 23): Unresolved reference: AdversarialStatelessSolver

FAILURE: Build failed with an exception.
larkz commented 3 years ago

@JunTaoLuo I resolved the merge conflicts, please check the updates to the lib, mainly the IDistribution is not being used to return a distribution, but the actual next state.

Also, please write a test for the connect4 and put it into junit.