Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

262 modify the reply or not algorithm (F6FVY) #263

Merged
merged 2 commits into from Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions DxOper.pas
Expand Up @@ -148,12 +148,14 @@ procedure TDxOperator.SetState(AState: TOperatorState);

function TDxOperator.IsMyCall: TCallCheckResult;
const
W_X = 2; W_Y = 2; W_D = 2;
W_X = 1; W_Y = 1; W_D = 1;
var
C, C0: string;
M: array of array of integer;
x, y: integer;
T, L, D: integer;

P: integer;
begin
C0 := Call;
C := Tst.Me.HisCall;
Expand Down Expand Up @@ -187,13 +189,15 @@ function TDxOperator.IsMyCall: TCallCheckResult;
M[x,y] := MinIntValue([T,D,L]);
end;

//classify by penalty
case M[High(M), High(M[0])] of
0: Result := mcYes;
1,2: Result := mcAlmost;
else Result := mcNo;
end;
P := M[High(M), High(M[0])];

if (P = 0) then
Result := mcYes
else if (((Length(C0) <= 4) and (Length(C0) - P >= 3)) or
((Length(C0) > 4) and (Length(C0) - P >= 4))) then
Result := mcAlmost
else
Result := mcNo;

//callsign-specific corrections

Expand Down