class Study { String name, gender, obj, obj2, relation, genderC; int n, y, k; float p; // Constructor Study() { // Person String[] names = { "Neo", "Jake", "Mr. Anderson", "Lisa Simpson", "Bart Simpson", "Homer Simpson", "Ted Mosby", "Robin Scherbatsky", "Roger", "Rachel", "Carol", "Samantha", "Nathan", "Morpheus" }; String[] genders = { "he", "he", "he", "she", "he", "he", "he", "she", "he", "she", "she", "she", "he", "he" }; String[] gendersC = { "He", "He", "He", "She", "He", "He", "He", "She", "He", "She", "She", "She", "He", "He" }; int i = int(random(names.length)); name = names[i]; gender = genders[i]; genderC = gendersC[i]; // Object String[] objs = { "own an iPad 3", "play tennis", "use Windows 8", "have an Android phone", "smoke" }; String[] objs2 = { "owns an iPad 3", "plays tennis", "uses Windows 8", "has an Android phone", "smokes" }; int i2 = int(random(objs.length)); obj = objs[i2]; obj2 = objs2[i2]; // Sample int[] ns = { 200, 500, 1000, 2000, 5000 }; n = ns[int(random(ns.length))]; y = int(random(20, n-20)); p = float((10 * y / n) + int(random(-1, 2))) / 10; p = constrain(p, 0.1, 0.9); // Relation and Known Variance String[] relations= { "less than", "greater than", "different from" }; k = int(random(relations.length)); relation = relations[k]; } }