module Types where import Heap type Time = Int -- ms type HeapUpdateFunc = Time -> Time -> (Heap Unit, Heap Unit) -> (Heap Unit, Heap Unit) type CreateHeapFunc = [Time] -> Heap Unit packet_size = 1 :: Double -- kb cbr = 50 :: Double packet_t = (ceiling . (1000*) . (1/)) cbr :: Time data Unit = Unit {metric :: Double, period :: Time, rem_p :: Int, sent_p :: Int} deriving Show instance Eq Unit where (==) a b = (metric a) == (metric b) instance Ord Unit where (<=) a b = (metric a) <= (metric b)