Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
シミュレートされたアニーリング メソッドの問題を解決する Java コードを書いています。パラメータが指定されている場合、true確率 exp(a/b) のみでランダムを生成する方法が必要です。ab
true
a
b
ありがとう。
a/bこれが true を返す確率のパーセンテージであると仮定すると、次のようになります。
a/b
public boolean exp(double probabilityTrue) { return Math.random() >= 1.0 - probabilityTrue; }