Skip to content

Instantly share code, notes, and snippets.

Created March 10, 2013 20:32
Show Gist options
  • Save anonymous/5130307 to your computer and use it in GitHub Desktop.
Save anonymous/5130307 to your computer and use it in GitHub Desktop.
public void updateStats(double dt)
{
if(TNOW>endTime*warmUp)
{
double totalinsystemdt = serversLevels[1].size()+2*serversLevels[2].size()+3*serversLevels[3].size()+4*serversLevels[4].size()+queueVector.size();
//if(TNOW>9950){
//System.out.println("-----------------------");
//System.out.println("Time elapsed: " +dt);
//System.out.println("Z1: "+serversLevels[1].size()+" Z2: "+serversLevels[2].size()+" Z3: "+serversLevels[3].size()+" Z4: "+serversLevels[4].size()+" Q: "+queueVector.size()+ " Total: "+totalinsystemdt);
//}
queueTotal+=(double)queueVector.size()*dt;
for(int i=0;i<serversLevels.length;i++)
noBusyServers[i]+=(double)serversLevels[i].size()*dt;
double tn=TNOW-endTime*warmUp;
tn=tn/ti;
tn=tn*5;
int a=(int) tn;
//System.out.println("TNOW="+ TNOW+"a="+a);
for(int i=0;i<serversLevels.length;i++)
batchStatsNoBusyServers[a][i]+=(double)serversLevels[i].size()*dt;
//totalInSystemSquared+=Math.pow(((double)queueVector.size()+(double)serversLevels[1].size()+(double)serversLevels[2].size()*2+(double)serversLevels[3].size()*3+(double)serversLevels[4].size()*4),2)*dt;
totalInSystemSquared+=Math.pow(((double)serversLevels[1].size()+(double)serversLevels[2].size()*2+(double)serversLevels[3].size()*3+(double)serversLevels[4].size()*4),2)*dt;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment