Hello, everyone! I am trying to generate a random number with Java, but random with the fix number of reviewers per object.Example: I have 5 reviewers(r(i)) and 5 objects(o(j)), a[j] is the evaluation score that reviewer(r(i)) has evaluated object(o(j)), and my question is i want to labeled each object should have evaluated only 3 reviewers.
I have tried the following code, but I still have problems: the result was: each object are evaluated by all reviewers.
double[][] a= new double[5][5];
int i,j;
int [] m= new int[5];
Random rand=new Random();
for(i=0; i<5; i++ ){
for(j=0; j<5; j++){
do{
a[i][j]= rand.nextDouble();
if(a[i][j]>0.0)
m[j]++;
System.out.println("a[" + i + "][" + j + "] = " +a[i][j]);
}while( m[j]==3);
}
}
}
}
Could you suggest how to solve my problem, or point me to some references?
Thanks in advance!!!!