nOptimalObjectiveSignal ::
  (Vec.Zipper vec,Ord a,Show (vec Bool),Show (vec a),RealFloat a,
   Vec.Walker vec, Vec.Storage vec a) =>
  Type.InterpolationOfAllStates node vec a -> Sig.UTSignal vec a
genOptimalObjectiveSignal interpolation =
  Map.foldl' (Sig.zipWith (ModUt.maxByWithNaN id)) h t
  where objectiveSigPerState =
          Map.map Type.optObjectiveSignalOfState interpolation

        (h, t) = case Map.minView objectiveSigPerState of
                      Just x -> x
                      Nothing -> error "genOptimalObjectiveSignal: empty interpolation map"


genOptimalObjectiveSignal ::
  (Vec.Zipper vec,Ord a,Show (vec Bool),Show (vec a),RealFloat a,
   Vec.Walker vec, Vec.Storage vec a) =>
  Type.InterpolationOfAllStates node vec a -> Sig.UTSignal vec a
genOptimalObjectiveSignal interpolation =
  Map.foldl' (Sig.zipWith (ModUt.maxByWithNaN id)) h t
  where objectiveSigPerState =
          Map.map Type.optObjectiveSignalOfState interpolation

        (h, t) = case Map.minView objectiveSigPerState of
                      Just x -> x
                      Nothing -> error "genOptimalObjectiveSignal: empty interpolation map"
genOptimalObjectiveSignal interpolation =
  Map.foldl' (Sig.zipWith (ModUt.maxByWithNaN id)) h t
  where objectiveSigPerState =
          Map.map Type.optObjectiveSignalOfState interpolation

        (h, t) = case Map.minView objectiveSigPerState of
                      Just x -> x
                      Nothing -> error "genOptimalObjectiveSignal: empty interpolation map"