특정 조건에서 정상적으로 반복되고 다른 조건에서 확률 e^(E/온도)로 반복되어야하는 재귀 검색 기능을 설계하고 있습니다. 뭔가가 일정 확률확률 단계를 취하는 방법?
Node Search(Node start)
{//first, calculate temperature. count will keep timestep
count++;
double temperature = 1000 * (Math.Pow(.995,count));//CALCULATES TEMP
for (int i = 0; i < start.state.Length; i++)
{
string temp = StateReturn(start.state, i);
if (temp.Length > 1 && temp != start.state
&&visited.Contains(temp) == false)
{
list.Add(new Node(start, temp));
visited.Add(temp);
}
}
//add all relevant nodes to list.
Random gen = new Random();
int rand = gen.Next(list.Count);//think this should work
//random number has been taken. now just to pull rand node from list
Node next = list.ElementAt(rand);
list.RemoveAt(rand);
double E = -(next.wrongNum - start.wrongNum); //we want less wrong
// if next has
if (E> 0)
{
//standard recursion
}
else //recurse with probability e^(E/t)
{
}
}
당신이 의미하는 바를 "확률 e^(E/t)"라고 기술해야합니다. 재귀 확률이 e^(E/t)에서 1이되어야한다고 말하고 있습니까? –
@Spencer 아니요, 실제로는 분명해야합니다. 적어도 확률 이론에서는 표준 표기법입니다. 재사용의 확률 * P *는 –
@SpencerRuport : Konrad의 진술을 명확히하기 위해 : 누군가가 "확률 p를 가지고"라고 말하면, p는 0과 하나는 0이 아닌 기회, 1은 확실, 0.25는 하나에 4 등입니다. –