Value function for Nelder Mead needs refactoring
Code part:
-
Comment by @BZoennchen : "dirty hack, fix it" Not sure what is meant there, but this should be solved, given that this is an important part of Nelder Mead.- I guess for the
seeSmallWall
case, getting all obstacles in each value evaluation is costly.
- I guess for the
-
There are three Math.pow(..., 2)
calls which may be very costly compared to simple multiplication, i.e. (x * x
vs.pow(x, 2)
). It may be possible that the Java compiler replaces this, but it is safer to not rely on it https://bytewrangler.blogspot.com/2011/10/mathpowx2-vs-x-x.html -
There are magic numbers, at least a comment, why they are needed, why they are chosen like it, etc. pp. - this is: result=100000
and an additional+ 0.00001
Edited by Ghost User