where to start
PHP Code:
for(i=0;i<numServers[currentPeriod-1];i++){
//if server i is in B, update remaining work, update the delay
if(workRemain[i] > 0){
workRemain[i] -= timeToNextEvent;
delta[i][currentPeriod-1] -= (timeToNextEvent/serviceRate);
}
}
the delta[i][] = is the prime suspect so far, check your code to make sure that you have the space you think you do for the stored data.
PHP Code:
delta.resize(maxServers);
for(i=0; i<maxServers;i++){
delta[i].resize(totalPeriods);
}
I can't decide if just VCs vector class trying to be clever, but in here lies a dangling pointer, since its just a resize its probably ok though.