private void arrivalInit(double[] aarr, double[] barr, 
    		double[] anum, double[] bnum, int start_hour, double weights[][]) {
    	
    	int idx, moveto = CYCLIC_DAY_START;
    	double[] mean = new double[] {0,0};

    	for(int i=0; i<weights.length; i++) {
    		for(int j=0; j<weights[i].length; j++) {
    			weights[i][j] = 0;
    		}
    	}
    	
    	current_[BATCH_JOBS] = 
    		current_[INTERACTIVE_JOBS] = start_hour * BUCKETS / HOURS_IN_DAY; 

    	/* 
    	 * for both batch and interactive calculate the propotion of each bucket ,
    	 * and their mean */
    	for (int j=0 ; j<=1 ; j++) {
    		for (int i=moveto ; i<BUCKETS+moveto ; i++) {
    			idx = (i-1)%BUCKETS; /* i-1 since array indices are 0..47 and not 1..48 */
    			weights[j][idx] =  
    				gamcdf(((double)i)+0.5, anum[j], bnum[j]) - gamcdf(((double)i)-0.5, anum[j],bnum[j]);
    			mean[j] += weights[j][idx];
    		}
    		mean[j] /= BUCKETS;
    	}

    	/* normalize it so we associates between seconds and points correctly */
    	for (int j=0 ; j<=1 ; j++) {
    		for (int i=0 ; i<BUCKETS ; i++) {
    			weights[j][i] /= mean[j];
    		}
    	}

      	calcNextArrival(BATCH_JOBS ,weights,aarr,barr);
      	calcNextArrival(INTERACTIVE_JOBS,weights,aarr,barr);
    }