mjtb49 / StrongholdTrainer

MIT License
22 stars 10 forks source link

ML output should be cached instead of recomputed. #28

Closed mjtb49 closed 3 years ago

mjtb49 commented 3 years ago

Currently, statistics based on the ML's policy in a given room need to call the ML after the stronghold has been routed. Instead, the policy should be cached somehow.

fsharpseven commented 3 years ago

Described below is a proposed solution for this, recording here for posterity.

This involves integrating this functionality into StrongholdPath (would probably be renamed to something like StorngholdPathRecord). ML methods, instead of returning double arrays, would consume and modify the latest entry in the record to include the ML's policy. Then MixinMinecraftServer would store the de facto record of the current nav, with anything that needs the ML's policy and/or the path that the player has taken now retrieving that data from there. The class would also need to be expanded to include functionality for keeping track of time as well as allowing data access at any point in the nav. With this solution, the class with the new functionality would need to be moved out of ml and into somewhere more common. Additionally, great care would need to be taken to ensure complete thread-safety.