Commit b1b56952 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢

Fix compiler warnings

parent d1dbb592
......@@ -20,9 +20,6 @@ import qualified Data.Text.Lazy.Builder.RealFloat
as Build
import Data.Vector ( Vector )
import qualified Data.Vector as V
import qualified Data.Vector.Algorithms.Intro as V
import Data.Text ( Text )
import qualified Data.Text as T
import Lens.Micro.Platform
import Mdp.Types
......@@ -70,10 +67,10 @@ transitionsB partition ts =
in foldMap (uncurry (choicesB partition)) (M.toList stateMap)
choicesB :: Maybe Partition -> Int -> [Transition] -> Build.Builder
choicesB partition source ts =
choicesB partition src ts =
let choiceMap :: IntMap [Transition] =
foldl' (\m t -> M.insertWith (++) (t ^. choice) [t] m) M.empty ts
in stateB source
in stateB src
<> ": "
<> partStart partition
<> "{"
......@@ -85,14 +82,14 @@ choicesB partition source ts =
where
partStart Nothing = ""
partStart (Just part) =
"(" <> Build.decimal (stateAssignment part V.! source) <> ", "
"(" <> Build.decimal (stateAssignment part V.! src) <> ", "
partEnd Nothing = ""
partEnd (Just _) = ")"
transitionB :: Int -> [Transition] -> Build.Builder
transitionB choice successors =
transitionB choi successors =
"("
<> Build.decimal choice
<> Build.decimal choi
<> ", {"
<> fold (intersperse ", " (map successorB successors))
<> "})"
......@@ -185,7 +182,6 @@ convertToValmari2 maybePart mdp =
let
nums = mdp ^. numStates
(numa, transMap) = mkValmariMap mdp
numc = mdp ^. numChoices
actions = V.fromList (concatMap mkChoices (M.toList transMap))
probs = V.fromList (concatMap mkTransitions (transMap ^.. each . each))
stateByChoice = M.fromListWith
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment