haskell scheduling

Hi Hope that You are doing fine. I am stuck at this problem if you have any idea kindly help me out. I want to output the schedule for a given task and method for one hyper period....like (o, just (T4 3 1 3 1), (1, Just (T2 5 1 51) etc Regards Nowshad data Task = T4 Phase Period Execution Deadline | T2 Period Execution deriving (Show ,Eq) type Phase = TimeUnit type Period = TimeUnit type Execution = TimeUnit type Deadline = TimeUnit type TimeUnit = Int data Method = RM | DM | EDF deriving (Show , Eq) periodicSchedule :: Method -> [Task] -> [(TimeUnit, Maybe Task)]

Not sure if this is what you're looking for but it sounds like you
need some kind of zip :
zip [0..] [Just (T4 3 1 3 1), Just (T2 5 1), Nothing]
=> [(0,Just (T4 3 1 3 1)),(1,Just (T2 5 1)),(2,Nothing)]
-deech
On Thu, Sep 16, 2010 at 7:08 PM, Nowshad
Hi Hope that You are doing fine. I am stuck at this problem if you have any idea kindly help me out. I want to output the schedule for a given task and method for one hyper period....like (o, just (T4 3 1 3 1), (1, Just (T2 5 1 51) etc
Regards Nowshad data Task = T4 Phase Period Execution Deadline | T2 Period Execution deriving (Show ,Eq) type Phase = TimeUnit type Period = TimeUnit type Execution = TimeUnit type Deadline = TimeUnit type TimeUnit = Int data Method = RM | DM | EDF deriving (Show , Eq) periodicSchedule :: Method -> [Task] -> [(TimeUnit, Maybe Task)]
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

Firstly this sounds like a homework question, and I think people expect you
to mention this, if it really is the case.
Secondly, you put your problem as "outputting the schedule".
On 17 September 2010 01:08, Nowshad
I want to output the schedule ...
Considering the fact that you do not have a schedule at hand, your problem is not about *outputting* the schedule. To the best of my knowledge, RM, DM and EDF are different heuristics (~algorithms) for scheduling. If I were you, I'd start by trying to understand what each technique suggests. Then think about how to implement them is Haskell. Since the input and output formats (types) of your scheduling function are fixed, they can guide and help you in this process. Please do ask if you have any other question, after making an attempt. Hope this helps, Ozgur
participants (3)
-
aditya siram
-
Nowshad
-
Ozgur Akgun