Jimboom7 / AlphaJong

A Mahjong AI for Mahjong Soul
GNU General Public License v3.0
396 stars 54 forks source link

About Parameters #40

Closed Gengzi-Isu closed 2 years ago

Gengzi-Isu commented 2 years ago

Can you provide the numerical range of each Parameters?And how high or low values will affect bot.For example, how high the value will drive bot crazy.In addition, which values determine whether bot is riichi or not?I look forward to your answer to my doubts.Thank you.

Gengzi-Isu commented 2 years ago

Another question, will the values influence each other?For example, if I enlarge several values such as yaku and safety in the same proportion, will the behavior of bot remain the same?Or is it that the behavior of bot determined by the value of each value is basically independent, or both?In the process of my use, I enlarged the safety value, efficiency value, yaku value and dora value in the same proportion, but there was a situation that bot was always not riichi.So I guess, although I enlarge the value in the same proportion, the weight of each value is still increased.The increase of safety value affects riichi's situation.Is this right?If so, what kind of behavior does the high or low value of each item roughly correspond to?For example, how high is the safety value will bot choose tenpai that is not riichi?or folded?I hope you can answer my doubts.Your project has helped me a lot, and I hope it will be more and more successful.Thanks.

Jimboom7 commented 2 years ago

The values are mainly used in this formula:

return ((efficiency * EFFICIENCY_VALUE * placementFactor) + (yaku * YAKU_VALUE) + (doraValue * DORA_VALUE) +
        (safety * SAFETY_VALUE * placementFactor)) / ((EFFICIENCY_VALUE * placementFactor) + YAKU_VALUE + DORA_VALUE + (SAFETY_VALUE * placementFactor));

So yes, they influence each other. There is no hardcoded numerical range, but I would not recommend to use anything outside of 0 to maybe 2 or 3. For really high or low values it will probably break some things, since there are some checks in the code that use hardcoded numbers on the result of this. That is bad code and I will fix it sometime. I'm currently rewriting most of the code anyway, so I will probably also make the parameters easier to use and document them better.

Sorry that I can't go into detail about some of your questions. It is not easy to tell when the bot is choosing riichi or fold based on these parameters since they influence lots of little things. The only way to find out is to try some values and see what happens.

Gengzi-Isu commented 2 years ago

Thank you for answering my confusion.At least I know the range of suggested values.