artificial intelligence - Algorithm to beat bots moving towards prizes predictably -
for game, there 10x10 board , few different prizes values 1 9, there few simple bots playing 1 goes after closest prize, , goes prize greatest number of points assigned it. bots , prizes placed randomly on board. task create simple ai collects highest number of points total , wins game.
how go picking between prize points , prize distance allow new ai win game? thinking favor closer prizes, go towards larger prize if 2 larger closest one, doesn't win.
the bots not know bots , if 1 bot moves 8 spaces 1 prize can move 8 spaces , collect multiple prizes during time. bots move @ once , can move diagonally. game ends once there no more prizes on board.
there no way guarantee win. if bots/prizes placed randomly, there surely random placements put far away prizes before other bots them.
since know exact behavior of other bots, can model future moves make given board. can enumerate possible moves tree, , board states, @ leaves , find 1 gives winning score. in other words, each branch move make, , node represents board state including move other bots make. also, won't binary tree, each node branch based on directions move turn. build tree before make single actual move, have outcome of game predicted once choose optimum path. possible because other bots move in predictable manner.
also move, can add checks ensure other bots moving predicted, debugging feature. depending on how system operates, may see move before decide move, depending on if moves simultaneously, or 1 @ time. either way can done, have make sure model of how move accurate.
note there might other leaves have larger score lose because 1 of other bots dominated other. i.e. (you:12, a:1, b:17) vs. (you:11, a:10, b:9)
the paths succeed ones exploit behavior of other bots, example, grabbing highest prize when closer you, causing greedy bot loose moves going towards it. , sidetracking prizes on way if have enough moves so. won't have code behavior though, because when create tree , find optimum series of moves, occur implicitly.
Comments
Post a Comment