I am having trouble determining a proper way to divide resources evenly in a excel-like table [closed]

StackOverflow https://stackoverflow.com/questions/8968434

Pergunta

I will try to explain this the best way I can, but feel free to ask for clarifications.

First, I will try to explain the problem.

I need to calculated the number of resource cost (points) for any given iteration.That being said, picture an excel document. The left-most column has a list of releases, or projects that are needing to completed. On the top row, the column headers are iterations.

I have the following information. I have the number of resources needed for each individual release. But, since a release can span multiple iterations, I need a way of splitting those resources required fairly over each iteration.

E.g. A release may begin one day before the next iteration, so I must allot only a small percentage of resource to that release/iteration combination.

I have included in an image what I have so far. For some reason, I cannot properly calculate the right amount, most likely due to my poor math skills. I hope this is trivial for one of you, and am thanking for any attempts.

This is my first attempt at javascript so feel free to throw in any suggestions as well.

What I have now is roughly this.

for (var i = 0; i < results.Iterations.length; i++) {
var iteration = results.Iterations[i];
for (var z = 0; z < results.Releases.length; z++) {
    var release = results.Releases[z];
    release[iteration.Name] = release[iteration.Name] || 0;

    if (dates.inRange(iteration.StartDate, release.ReleaseStartDate, release.ReleaseDate) 
    || dates.inRange(iteration.EndDate, release.ReleaseStartDate, release.ReleaseDate))
    {
       var availableReleaseDays = dates.workingDaysBetweenDates(release.ReleaseStartDate, release.ReleaseDate);
       var availableIterationDays = dates.workingDaysBetweenDates(iteration.StartDate, iteration.EndDate);
       var iterations = calculateIterations(release, results.Iterations, dates);
       var resources = Math.round(release.Resources/iterations );

       release[iteration.Name] += resources;
    }

}

Current View

Foi útil?

Solução

I've worked up code that does what I think you are asking. It's in this gist.

The basic idea is that for each release, I divided all of it's resources over all of the work days between its start and end. I then walk through each day and if that day is in an iteration, I add those resources to that iteration. Is that what you are trying to do?

The former Agile Coach in me wants to question the approach. It feels like a bit too much long range planning with a level of precision in the calculations that exceeds the resource estimate accuracy... but I've held back those instincts enough to give you usable code.

It's probably overkill for this situation but the solution uses a library I'm working on called ChartTime. ChartTime allows you to do date and timebox manipulation and calculations. It has the ability to knockout holidays and weekends, which I've used in my example solution to your problem even though that precision wasn't needed. It also has timezone precision, which I did not use.

ChartTime is written in CoffeeScript and my solution to your problem is also written in CoffeeScript. CoffeeScript is just a cleaner syntax for JavaScript and it compiles to JavaScript so you can use the ChartTime library directly from JavaScript. I'm working on it every weekend/evening and it works well. The docs are pretty good but not complete yet.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top