Results 1 to 8 of 8
  1. #1
    matzahboy is offline Member
    Join Date
    Nov 2008
    Posts
    67
    Rep Power
    0

    Default Creating the evaluation function for Minimax

    For a game I am making, I want to use the Minimax algorithm to program the AI. The 2 players have 2 different evaluation options (because the way player1 and player2 win are different).

    Can player1's evaluation function return values from 1-10, while player2 returns from 1-20? Or will this mess up the Minimax algorithm? Basically, my question is: Do the 2 evaluation functions have to be on the same scale (so a 5 in one is the same as a 5 in the other)?

  2. #2
    Lizzip is offline Member
    Join Date
    Oct 2009
    Posts
    12
    Rep Power
    0

    Default

    Im not quite sure I understand Minimax exactly, but from looking at it I assume that they could return different values as long as you then compare the outputs to seperate winning conditions for each player

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default

    If you strictly use one evaluation function for the even levels and the other one for the odd levels it doesn't matter whether or not they return values from different ranges.

    kind regards,

    Jos

  4. #4
    fgm1 is offline Member
    Join Date
    Nov 2009
    Posts
    23
    Rep Power
    0

    Default

    I'm not 100% certain, but I really think you might run into problems by having a different set of evaluation values for White and Black. One of the key aspects of minimax algorithm is that you need a consistent way of determining whether a position favors White or Black. I don't see how you can do that when you return a different set of values for each. How are you gonna compare the values? I'm nt saying it can't be done, just that It's not clear to me that you understand the key concept of deciding who is better.

    That being said JosAH says no problem. So maybe he knows something I don't. So Jos, how do you respond to my point?

    regards.

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by fgm1 View Post
    That being said JosAH says no problem. So maybe he knows something I don't. So Jos, how do you respond to my point?

    regards.
    If the 'other' evaluation function is a linear combination of the 'first' evaluation function (that's what I understood from the OP), i.e. E2(x) == a*E1(x)+b it doesn't matter whether or not you use E2 of E1, otherwise if E2(x) is completely different from E1(x) a different move can/will be selected. Both evaluation functions aim at a best move for a player so the combination E1 and E2 will behave as reasonable as both evaluation functions are.

    kind regards,

    Jos

  6. #6
    fgm1 is offline Member
    Join Date
    Nov 2009
    Posts
    23
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    If the 'other' evaluation function is a linear combination of the 'first' evaluation function (that's what I understood from the OP), i.e. E2(x) == a*E1(x)+b it doesn't matter whether or not you use E2 of E1, otherwise if E2(x) is completely different from E1(x) a different move can/will be selected. Both evaluation functions aim at a best move for a player so the combination E1 and E2 will behave as reasonable as both evaluation functions are.

    kind regards,

    Jos
    OK fine, I guess I can see how that would work, although it seems to me that if one eval function was a linear combination of the other, then it we should just as easily be able to do the combining ( or scaling) of the values within a single eval function, so that it returns a consistent set of values for both sides. That shouldn't be hard, since we should easily be able to pass (side to move to the single eval function)

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,541
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by fgm1 View Post
    OK fine, I guess I can see how that would work, although it seems to me that if one eval function was a linear combination of the other, then it we should just as easily be able to do the combining ( or scaling) of the values within a single eval function, so that it returns a consistent set of values for both sides. That shouldn't be hard, since we should easily be able to pass (side to move to the single eval function)
    Yes, true, but it was the OP who wanted to use two different evaluation functions ;-) If E2(x) == a*E1(x)+b then the function E1(x) == (E2(x)-b)/a might have been used as well.

    kind regards,

    Jos

  8. #8
    fgm1 is offline Member
    Join Date
    Nov 2009
    Posts
    23
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    Yes, true, but it was the OP who wanted to use two different evaluation functions ;-) If E2(x) == a*E1(x)+b then the function E1(x) == (E2(x)-b)/a might have been used as well.

    kind regards,

    Jos
    ok cool, we agree. Personally I'd much prefer to let my eval function deal with all of that, in order to simplify my minimax/alphaBeta code, but yeah if the OP wants two separate eval functions, then it can be made to work.

    cheers.

Similar Threads

  1. [SOLVED] Boolean Expression Evaluation Framework
    By priyanka.dandekar in forum Advanced Java
    Replies: 8
    Last Post: 03-27-2010, 02:35 PM
  2. Creating files stopped creating...
    By Dieter in forum Advanced Java
    Replies: 3
    Last Post: 09-25-2009, 11:45 PM
  3. building a complete online evaluation system
    By pmminov in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 04-07-2009, 09:04 PM
  4. Postfix Evaluation using a Stack, Help?
    By dalangley in forum New To Java
    Replies: 2
    Last Post: 02-16-2009, 10:43 PM
  5. help creating two classes that function together
    By sinreaver in forum New To Java
    Replies: 6
    Last Post: 10-01-2008, 03:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •