Skip to content

Commit

Permalink
fix eta
Browse files Browse the repository at this point in the history
  • Loading branch information
dk14 committed Jan 25, 2021
1 parent e9d83c9 commit f637f2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions marlowe-actus/src/Language/Marlowe/ACTUS/Analysis.hs
Expand Up @@ -25,15 +25,15 @@ genProjectedCashflows :: ContractTerms -> [CashFlow]
genProjectedCashflows = sampleCashflows (const $ RiskFactors 1.0 1.0 1.0 0.0)

postProcessSchedule :: ContractTerms -> [(EventType, ShiftedDay)] -> [(EventType, ShiftedDay)]
postProcessSchedule ct s =
postProcessSchedule ct =
let trim = L.dropWhile (\(_, d) -> calculationDay d < ct_SD ct)
prioritised = [AD, IED, PR, PI, PRF, PY, FP, PRD, TD, IP, IPCI, IPCB, RR, PP, CE, MD, RRF, SC, STD, DV, XD, MR]
priority :: (EventType, ShiftedDay) -> Integer
priority (event, _) = fromJust $ M.lookup event $ M.fromList (zip prioritised [1..])
simillarity (_, l) (_, r) = calculationDay l == calculationDay r
regroup = L.groupBy simillarity
overwrite = map (L.head . sortOn priority) . regroup
in (overwrite . trim) s
in overwrite . trim


sampleCashflows :: (Day -> RiskFactors) -> ContractTerms -> [CashFlow]
Expand Down

0 comments on commit f637f2d

Please sign in to comment.