Nin*_*ina 6 java simulated-annealing stochastic
我正在编写java代码来解决模拟退火方法的问题.我需要一种true只用概率exp(a/b)生成随机的方法,其中a和b给定参数.
谢谢.
小智 11
假设这a/b是返回true的百分比概率:
public boolean exp(double probabilityTrue)
{
return Math.random() >= 1.0 - probabilityTrue;
}
Run Code Online (Sandbox Code Playgroud)