Sequential drug decision problems in long-term medical conditions: a case Study of Primary Hypertension Eunju Kim ba, ma, msc


IF itry >= MaxTries || Success >= MaxSuccess; IF



Yüklə 10,52 Mb.
səhifə41/116
tarix04.01.2022
ölçüsü10,52 Mb.
#58520
1   ...   37   38   39   40   41   42   43   44   ...   116
IF itry >= MaxTries || Success >= MaxSuccess;

IF T < StopTemp || Consec >= MaxConsRej;

Finished = 1;

total_iter = total_iter + itry;

Break;

ELSE

T = CoolSched(T); % Decrease T according to ‘CoolSched’.

total_iter = total_iter + itry;

itry = 1; Success = 1;



END

END
% Random generation of new policy and the reward from the new policy.

nPolicy = round(1+(rand(1)*5));

[NewReward] = function_SemiMarkov(nPolicy);

incNewReward = NewReward-OldReward;


% If the new solution is better than the old solution, replace the old solution with the new solution.

IF (incNewReward > 1e-6)

cPolicy = nPolicy; OldReward = NewReward;

Success = Success+1; Consec = 0;
% Otherwise, accept the new solution with a probability, which follows the Boltzmann distribution.

ELSE

IF (rand > exp((-incNewReward)/(k*T)));

cPolicy = nPolicy;

OldReward = NewReward;

Success = Success+1;



ELSE

Consec = Consec+1;



END

END

END
% Identification of the optimal solution and the maximum value.

OptSol = cPolicy; OptValue = OldReward;



Figure ‎3.. Pseudo-code of the SA used for the simple hypothetical case


Yüklə 10,52 Mb.

Dostları ilə paylaş:
1   ...   37   38   39   40   41   42   43   44   ...   116




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©muhaz.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin