260323_01_ENH: 분석 도중 비효율적인 코드 수정 및 추출 조정 수정

This commit is contained in:
2026-03-23 14:56:40 +09:00
parent 520bf62896
commit df3cf8bb75
2 changed files with 31 additions and 16 deletions

View File

@@ -532,16 +532,20 @@ namespace Keps.WinForms.Services
List<PollingPlaceRecord> clusterPopulation = populationRows.Where(x => x.ClusterValue == allocation.ClusterNo).ToList();
List<PollingPlaceRecord> clusterExtracted = extractedRows.Where(x => x.ClusterValue == allocation.ClusterNo).ToList();
decimal clusterExtracted1 = Round1(ComputeCandidateRatioExact(clusterExtracted, candidateMeta[0].VoteKey));
decimal clusterExtracted2 = Round1(ComputeCandidateRatioExact(clusterExtracted, candidateMeta[1].VoteKey));
decimal clusterExtracted3 = Round1(ComputeCandidateRatioExact(clusterExtracted, candidateMeta[2].VoteKey));
decimal clusterExtractedSource1 = ComputeCandidateRatioExact(clusterExtracted, candidateMeta[0].VoteKey);
decimal clusterExtractedSource2 = ComputeCandidateRatioExact(clusterExtracted, candidateMeta[1].VoteKey);
decimal clusterExtractedSource3 = ComputeCandidateRatioExact(clusterExtracted, candidateMeta[2].VoteKey);
decimal clusterExtracted1 = Round1(clusterExtractedSource1);
decimal clusterExtracted2 = Round1(clusterExtractedSource2);
decimal clusterExtracted3 = Round1(clusterExtractedSource3);
decimal clusterActual1 = Round1(Round2(ComputeCandidateRatioExact(clusterPopulation, candidateMeta[0].VoteKey)));
decimal clusterActual2 = Round1(Round2(ComputeCandidateRatioExact(clusterPopulation, candidateMeta[1].VoteKey)));
decimal clusterActual3 = Round1(Round2(ComputeCandidateRatioExact(clusterPopulation, candidateMeta[2].VoteKey)));
totalExtractedWeighted1 += allocation.Ratio * ComputeCandidateRatioExact(clusterExtracted, candidateMeta[0].VoteKey);
totalExtractedWeighted2 += allocation.Ratio * ComputeCandidateRatioExact(clusterExtracted, candidateMeta[1].VoteKey);
totalExtractedWeighted3 += allocation.Ratio * ComputeCandidateRatioExact(clusterExtracted, candidateMeta[2].VoteKey);
totalExtractedWeighted1 += allocation.Ratio * clusterExtractedSource1;
totalExtractedWeighted2 += allocation.Ratio * clusterExtractedSource2;
totalExtractedWeighted3 += allocation.Ratio * clusterExtractedSource3;
decimal overallError1 = Round1(clusterExtracted1 - totalActual1);
decimal overallError2 = Round1(clusterExtracted2 - totalActual2);