| 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
- data Day
- cv2Day :: String -> [CV] -> Day
- _undefiner_Day :: a
- type SDay = SBV Day
- sMon :: SBV Day
- sTue :: SBV Day
- sWed :: SBV Day
- sThu :: SBV Day
- sFri :: SBV Day
- sSat :: SBV Day
- sSun :: SBV Day
- isMon :: SBV Day -> SBool
- isTue :: SBV Day -> SBool
- isWed :: SBV Day -> SBool
- isThu :: SBV Day -> SBool
- isFri :: SBV Day -> SBool
- isSat :: SBV Day -> SBool
- isSun :: SBV Day -> SBool
- sCaseDay :: Mergeable result => SBV Day -> result -> result -> result -> result -> result -> result -> result -> result
- isWeekend :: SDay -> SBool
- almostWeekend :: IO OptimizeResult
- weekendJustOver :: IO OptimizeResult
- firstWeekend :: IO OptimizeResult
Documentation
A simple enumeration
Instances
_undefiner_Day :: a Source #
Autogenerated definition to avoid unused-variable warnings from GHC.
sCaseDay :: Mergeable result => SBV Day -> result -> result -> result -> result -> result -> result -> result -> result Source #
Case analyzer for the type Day.
almostWeekend :: IO OptimizeResult Source #
Using optimization, find the latest day that is not a weekend. We have:
>>>almostWeekendOptimal 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:
>>>weekendJustOverOptimal 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:
>>>firstWeekendOptimal model: firstWeekend = Sat :: Day DayAsWord8(first-weekend) = 5 :: Word8 first-weekend = Sat :: Day