chore: remove traces

This commit is contained in:
Gregor Kleen 2020-01-29 21:46:16 +01:00
parent 3bd7520087
commit 7140618a5c

View File

@ -1,5 +1,3 @@
{-# OPTIONS_GHC -fno-warn-deprecations #-}
module Handler.Utils.Exam
( fetchExamAux
, fetchExam, fetchExamId, fetchCourseIdExamId, fetchCourseIdExam
@ -365,14 +363,14 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
= breakCost (wordIx # pred j) (wordIx # j)
| otherwise
= 0
traceM $ show ( i
, j
, potWidth
, w
, (fromRational :: Rational -> Centi) <$> prevMin
, (fromRational :: Rational -> Centi) <$> widthCost potWidth w
, (fromRational :: Rational -> Centi) <$> breakCost'
)
-- traceM $ show ( i
-- , j
-- , potWidth
-- , w
-- , (fromRational :: Rational -> Centi) <$> prevMin
-- , (fromRational :: Rational -> Centi) <$> widthCost potWidth w
-- , (fromRational :: Rational -> Centi) <$> breakCost'
-- )
when (isFinite cost) $ do
minCost <- ST.readArray minima j
when (cost < minCost) $ do
@ -381,13 +379,13 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
go i' $ succ j
| otherwise = return ()
in go i' $ succ i'
traceM . show . map (fmap (fromRational :: Rational -> Centi)) =<< ST.getElems minima
traceM . show =<< ST.getElems breaks
-- traceM . show . map (fmap (fromRational :: Rational -> Centi)) =<< ST.getElems minima
-- traceM . show =<< ST.getElems breaks
let accumResult lineIx j (accCost, accMap) = do
i <- ST.readArray breaks j
accCost' <- (+) accCost <$> ST.readArray minima j
traceM $ show ((fromRational :: Rational -> Centi) <$> accCost', lineIx, (i, pred j))
-- traceM $ show ((fromRational :: Rational -> Centi) <$> accCost', lineIx, (i, pred j))
let accMap' = (lineIxs List.!! lineIx, map (review wordIx) [i .. pred j]) : accMap
if
| i > 0 -> accumResult (succ lineIx) i (accCost', accMap')