How do I use optimtool to optimize a tetris game?
Show older comments
Hello, I am trying to create a MATLAB adaptation of Tetris with an AI that efficiently plays the game. Currently I have a working AI, but it is lacking in terms of efficiency. I know that optimtool's fminsearch capability supposedly can help with finding correct weights, but the program that I have written, when loaded into fminsearch causes it to return the errors 'Error running optimization,' and 'Not enough input arguments.'
Any help with this endeavor would be hugely appreciated. Below is the program and the lines I put into optimtool's fminsearch.
@placementScore [-0.51,-0.36,0.16,-0.18]
function score = placementScore(agScore,holeScore,clearScore,bumpScore)
% uses agScore, holeScore, clearScore to make a composite score
score = (-.510066 * agScore) + (-.35663 * holeScore)+ (.161 * clearScore)+ (-.1845 * bumpScore);
Accepted Answer
More Answers (0)
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!