You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

23 lines
569 B
Haskell

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)