income.setAmount(randint(1400)+200);
income.setEarned(earned[i]);
}
Client genClient(Job job, int ageLimit){
Client client = new Client();
job.getCase().getClients().add(client);
int age = randint(ageLimit);
String gender = flip()?"male":"female";
client.setAge(age);
client.setGender(gender);
client.setLivesAtResidence(chance(90)?true:false);
boolean citizen = chance(66);
client.setValidatedCitizenship(citizen);
if(!citizen){
client.setValidatedImmigrationStatus(chance(90));
}
boolean pregnant = gender.equals("female")&&age>15&&chance(30);
client.setPregnant(pregnant);
if(pregnant){
client.setExpectedChildren(chance(80)?1: chance(80)?2:3);
}else{
client.setExpectedChildren(0);
}
client.setDisabled(chance(10)?true:false);
client.setApplying(age<20? (chance(90)?true:false):false);
if(client.getApplying())job.addApplying();
boolean uninsured = chance(90);
client.setUninsured(uninsured);
if(uninsured){
cal.setTime(currentdate);
int months = randint(24);
cal.add(Calendar.MONTH, -months);
client.setLostInsuranceDate(cal.getTime());
}
client.setEligibleForMedicaid(chance(10)?true:false);
int icnt = randint(4);
for(int i = 0; age > 18 && i < icnt; i++){
addIncome(job, client);
}