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.
23 lines
569 B
Haskell
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)
|