Copyright | (c) Levent Erkok |
---|---|
License | BSD3 |
Maintainer | erkokl@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Documentation.SBV.Examples.Optimization.Enumerate
Description
Demonstrates how enumerations can be used with optimization, by properly defining your metric values.
Synopsis
Documentation
A simple enumeration
Instances
almostWeekend :: IO OptimizeResult Source #
Using optimization, find the latest day that is not a weekend. We have:
>>>
almostWeekend
Optimal model: almostWeekend = Fri :: Day DayAsWord8(last-day) = 4 :: Word8 last-day = Fri :: Day
weekendJustOver :: IO OptimizeResult Source #
Using optimization, find the first day after the weekend. We have:
>>>
weekendJustOver
Optimal model: weekendJustOver = Mon :: Day DayAsWord8(first-day) = 0 :: Word8 first-day = Mon :: Day
firstWeekend :: IO OptimizeResult Source #
Using optimization, find the first weekend day: We have:
>>>
firstWeekend
Optimal model: firstWeekend = Sat :: Day DayAsWord8(first-weekend) = 5 :: Word8 first-weekend = Sat :: Day