Problema 4 parte 2 done, so falta relatorio e fix no consolidate

This commit is contained in:
Tiago Sousa 2023-01-09 23:32:06 +00:00
parent 90a22239fe
commit e4d839885a

View file

@ -1308,7 +1308,7 @@ gcarp = (nil -|- (split (curry sierpinski ((0,0),32)) id)) . outNat
\xymatrix@@C=2cm{ \xymatrix@@C=2cm{
(|Square|^*)^* (|Square|^*)^*
& &
1 + (|Square|)^* + (|Square|^*)^* 1 + |Square|^* \times (|Square|^*)^*
\ar[l]_-{|inList|} \ar[l]_-{|inList|}
\\ \\
|Nat0| |Nat0|
@ -1367,9 +1367,10 @@ pairup = either nil (conc . split (uncurry pairs) (pairup . p2)) . outList where
pairs x [] = [] pairs x [] = []
pairs x (y:ys) = (x,y) : pairs x ys pairs x (y:ys) = (x,y) : pairs x ys
matchResult crit m@(t1,t2) = teamPoints (crit m) where matchResult crit m@(t1,t2) = teamPoints m (crit m)
teamPoints Nothing = [(t1,1),(t2,1)]
teamPoints (Just t) = [(t,3)] teamPoints (t1,t2) Nothing = [(t1,1),(t2,1)]
teamPoints (t1,t2) (Just t) = if t1 == t then [(t1,3),(t2,0)] else [(t2,3),(t1,0)]
glt = (id -|- ((cons >< id) . assocl . (id >< divideList))) . out where glt = (id -|- ((cons >< id) . assocl . (id >< divideList))) . out where
divideList l = (take (length l `div` 2) l, drop (length l `div` 2) l) divideList l = (take (length l `div` 2) l, drop (length l `div` 2) l)
@ -1378,12 +1379,15 @@ glt = (id -|- ((cons >< id) . assocl . (id >< divideList))) . out where
\end{code} \end{code}
\subsubsection*{Versão probabilística} \subsubsection*{Versão probabilística}
\begin{code} \begin{code}
pinitKnockoutStage = undefined pinitKnockoutStage matches = do {return (initKnockoutStage matches)}
pgroupWinners :: (Match -> Dist (Maybe Team)) -> [Match] -> Dist [Team] pgroupWinners :: (Match -> Dist (Maybe Team)) -> [Match] -> Dist [Team]
pgroupWinners = undefined pgroupWinners criteria = fmap (fmapBody) . sequence . map (pmatchResult criteria)
fmapBody = best 2 . consolidate . concat
pmatchResult crit m = do {dist <- crit m ; return (teamPoints m dist)}
pmatchResult = undefined
\end{code} \end{code}
%----------------- Índice remissivo (exige makeindex) -------------------------% %----------------- Índice remissivo (exige makeindex) -------------------------%