Any hints what Im doing wrong here, please? Its running okay, - TopicsExpress



          

Any hints what Im doing wrong here, please? Its running okay, but the output values are far too large and identical across the types, so Ive obviously asked it for the wrong thing at some stage. int [] totalgroupsizes = new int [2]; for (int i = 0; i < boids.size(); ++i) { Agent boid = (Agent) boids.get(i); if (boid.type == 1) { for (int b = 0; b < transGroupSize.length; b++) { totalgroupsizes[0] += transGroupSize[b]; } } else if (boid.type == 2) { for (int b = 0; b < transGroupSize.length; b++) { totalgroupsizes[1] += transGroupSize[b]; } } } int [] meangroupsize = new int [2]; meangroupsize [0] = totalgroupsizes[0] / countNormal(); meangroupsize [1] = totalgroupsizes[1] / countParasitized(); meanGroupSizePerType[0].add(meangroupsize[0]); meanGroupSizePerType[1].add(meangroupsize[1]); System.out.println(Mean Group Size Per Type Per Timestep,); printMeanGroupSizePerType(meanGroupSizePerType);
Posted on: Tue, 01 Apr 2014 17:08:36 +0000

Trending Topics



Recently Viewed Topics




© 2015