%% Update Score Logic with Hit
% Create a score-based logic with default confirmation and deletion thresholds.

scoreLogic = trackScoreLogic;

% Specify the probability of detection (pd), the probability of false alarm (pfa), the volume of a sensor detection bin (volume), and the new target rate in a unit volume (beta).

pd = 0.9;
pfa = 1e-6;
volume = 1.3;
beta = 0.1;

% Initialize the logic using these parameters. The first update to the logic is a hit.

init(scoreLogic,volume,beta,pd,pfa);
disp(['Score and MaxScore: ', num2str(output(scoreLogic))]);

% Specify the likelihood that the detection is assigned to the track.

likelihood = 0.05 + 0.05*rand(1);

% Update the logic with a hit. The current score and maximum score increase.

hit(scoreLogic,volume,likelihood)
disp(['Score and MaxScore: ', num2str(output(scoreLogic))])

% Copyright 2018 The MathWorks, Inc.