I assume that you are talking abou the code:
CODE
for (i = 1; i < count; ++i)
{
//Set Boundary To Only Those Processes That Have Come In During Previous Execution
temp = totalBurstTime;
if (temp > 30)
temp = 30;
if (newData[i].completionFlag != 1)
{
for (j = 0; j < temp; j++)
{
//If this is the smallest data in within the boundaries
if ((newData[i].burstTime < newData[j].burstTime) && ((newData[i].completionFlag != 1 || newData[j].completionFlag != 1)))
{
//Set this job to process nextProcessMarker = i;
}
}
}
spacificly.
I not that the if-statement makes the
&& ((newData[i ].completionFlag != 1 || newData[j].completionFlag != 1)) a little redundant since we already know that
newData[i ].completionFlag != 1 from the outer if-statment.
I guess I don't really see how the inner loop works... I think you are trying to loop though and find the smallest burstTime such that the completionFlag is not set.
I think that something like:
CODE
int smallest = 0;
for (i=1; i < count; ++i)
{
if (newData[i].completionFlag != 1 && smallest == 0)
{
smallest = i;
} else if (newData[i].completionFlag != 1 && (newData[i].burstTime <newData[smallest].burstTime)) { smallest = i; }
}
}
nextProcessMarker = smallest;
Of course, since I don't
really understand what you are doing I may be way off base here.
This post has been edited by NickDMax: 17 Mar, 2007 - 08:32 PM