diff --git a/Icfpc2023/Scoring.fs b/Icfpc2023/Scoring.fs index 11a0f9c..623b1f8 100644 --- a/Icfpc2023/Scoring.fs +++ b/Icfpc2023/Scoring.fs @@ -26,6 +26,12 @@ let private CalculateAttendeeScore (musicians: Musician[]) (attendee: Attendee): else CalculateAttendeeMusicianScore attendee musician ) +let private CalculateAttendeeNoBlockingScore (musicians: Musician[]) (attendee: Attendee): Score = + Seq.indexed musicians + |> Seq.sumBy(fun (i, musician) -> + CalculateAttendeeMusicianScore attendee musician + ) + let CalculateScore(problem: Problem) (solution: Solution): Score = let musicians = problem.Musicians @@ -33,3 +39,11 @@ let CalculateScore(problem: Problem) (solution: Solution): Score = |> Seq.map(fun(p, i) -> { Instrument = i; Location = p }) |> Seq.toArray problem.Attendees |> Array.sumBy(CalculateAttendeeScore musicians) + +let CalculateNoBlockingScore(problem: Problem) (solution: Solution): Score = + let musicians = + problem.Musicians + |> Seq.zip solution.Placements + |> Seq.map(fun(p, i) -> { Instrument = i; Location = p }) + |> Seq.toArray + problem.Attendees |> Array.sumBy(CalculateAttendeeNoBlokingScore musicians)