And Then The Coding Begins

As I mentioned yesterday, I have finally managed to complete (read: almost complete) the analytical component of my BTP. Now I need to implement the algorithm and get the results.

It has been a great night out. I have already written ~450 lines of code in C. I have tried the modular approach, breaking things into functions. This way, I test each function individually and am sure that they will work when used together.

Also I have added a new feature in my code this time. Learning from my troubles the last time I coded such a complex algorithm, I realised that a log file proves to be handy. It clearly defines the flow of control, the manipulations and the decisions taken within a loop. Everytime I enter a function, I make a note of it in the log file. Whenever I leave the function, it is noted into the log. All that occurs within the function is properly indented. At the present though I have used a rather brute force method for indenting the log file. I print spaces in the log file using the for loop. I need to find a better way.

Below is the log file that I generated running the incomplete algorithm.

  Number of Processors : 1
  Number of Tasks : 4
  Frame Size : 10
  Number of Groups : 1

  Task   1: e =  18 p =  30 wt = 0.60
  Task   2: e =  18 p =  90 wt = 0.20
  Task   3: e =  18 p = 150 wt = 0.12
  Task   4: e =  18 p = 225 wt = 0.08

  Proc   1: cap =  10

      < <>>naf: 0

      < <>>shr: 6

    Task 1, Frame 0, Share 6

      Frame 0 inserted after -1
      Task 1 inserted into bucket 5 first

      < <>>naf: 0

      < <>>shr: 2

    Task 2, Frame 0, Share 2

      Task 2 inserted into bucket 1 first

      < <>>naf: 0

      < <>>shr: 1

    Task 3, Frame 0, Share 1

      Task 3 inserted into bucket 0 first

      < <>>naf: 1

      < <>>shr: 1

    Task 4, Frame 1, Share 1

      Frame 1 inserted after 0
      Task 4 inserted into bucket 0 first

    < <>>leastFrame: 1

Popularity: 1% [?]

Related posts:

  1. A Logger In C
  2. Getting Started With My BTP
  3. And So It Begins …