Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine Valid action helper #46

Closed
peter1591 opened this issue Jun 24, 2017 · 3 comments
Closed

Refine Valid action helper #46

peter1591 opened this issue Jun 24, 2017 · 3 comments

Comments

@peter1591
Copy link
Owner

Refines on state::State:

  • PrepareValidActions() --> returns ValidActionHelper()
    • Do some process
    • Selection stage can save the board after this is called
  • ApplyAction(ValidActionHelper const* = nullptr)

Requirement

  • No overhead. Keep the simulation quick.

Notes

  • Even in selection stage, the board after 'PrepareValidActions()' is not saved in memory
    • Only save the BoardView
  • Since there's hidden information, a determination phase runs before each episode. So even the board is saved, we will not run that exactly board at following episodes.
  • But, in fact, the hidden information should get nothing to do with the prepare action.
  • So, maybe the valid action helper should not be implemented within the state::State. It should be related to BoardView.
@peter1591
Copy link
Owner Author

Another way:
Refine the simulation engine. If an action is invalid...

  1. Return kResultInvalid
  2. and, do not modify the game state

@peter1591
Copy link
Owner Author

It makes logic too complicated if we want to enforce the constant-state at compile time
If we just leave it as a mandatory, things might blow up after a long-term maintenance

Could we made the game state to be copy-on-write?

  1. Make things copy-on-write
  2. Investigate which fields are possibly changed for an invalid action

@peter1591
Copy link
Owner Author

Close this issue.
Open another issue to profile the time of state copying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant