Commit e3417478 authored by Xiaoying Pu's avatar Xiaoying Pu

heap of code, part 1

parent 006350c2
......@@ -14,6 +14,12 @@
<group/>
<group>
<file>file:/Users/pxy/dm_task/src/util/Trial.java</file>
<file>file:/Users/pxy/dm_task/src/tracker/PrimaryTaskController.java</file>
<file>file:/Users/pxy/dm_task/src/tracker/MouseTrackerFacade.java</file>
<file>file:/Users/pxy/dm_task/src/tracker/Decision.java</file>
</group>
</open-files>
</project-private>
......@@ -12,3 +12,7 @@
"|"
(for [token splited]
(str "2*" token))))))
(defn get-list
[s]
(clojure.string/split s #", "))
......@@ -26,6 +26,11 @@ public class Decision {
private final String CONDITION_HIGH = "HWL|HWL|HWL|HWL|HWL|HWL|HWL";
private final String CONDITION_LOW = "LWL|LWL|LWL|LWL|LWL|LWL|LWL";
/**
* Not that useful
*/
private final String[] MIXED_TYPICAL_PART1 = new String[]{"2,Humanities,"};
private final String[] MIXED_TYPICAL_PART2 = new String[]{",,1,2,Man|Science,Female|Arts"};
/**
* Not used
*/
......@@ -35,6 +40,71 @@ public class Decision {
private final String rand = "1";
/**
* Coding like a psychologist.
* type,stim,cond,rand,correct,default-compare,resp_1,resp_2
*
* @param condition
* @return
*/
public String getMixTypical(String condition) {
String[] maleList = male.split(", ");
String[] femaleList = female.split(", ");
String[] artsList = arts.split(", ");
String[] scienceList = unsplitScience.split(", ");
List<String> result = new ArrayList<>();
result.add(typeChar);
int isArtsOrFemale = ThreadLocalRandom.current().nextInt(0, 2);
int oneIsRight = ThreadLocalRandom.current().nextInt(0, 2);
String stimulus;
int choice = ThreadLocalRandom.current().nextInt(0, 2);
if (isArtsOrFemale == 1) {
int randInt = ThreadLocalRandom.current().nextInt(0, femaleList.length);
String femaleStimuli = femaleList[randInt];
randInt = ThreadLocalRandom.current().nextInt(0, artsList.length);
String artStim = artsList[randInt];
stimulus = choice == 1 ? artStim : femaleStimuli;
} else {
int randInt = ThreadLocalRandom.current().nextInt(0, maleList.length);
String maleS = maleList[randInt];
randInt = ThreadLocalRandom.current().nextInt(0, scienceList.length);
String scienceS = scienceList[randInt];
stimulus = choice == 1 ? scienceS : maleS;
}
result.add(stimulus);
result.add(condition);
result.add(" ");// TODO this may break it, randomize trial block
if (oneIsRight == 1) {
result.add("1");
result.add("2");
if (isArtsOrFemale == 1) {
result.add("Female|Art");
result.add("Male|Science");
} else {
result.add("Male|Science");
result.add("Female|Art");
}
} else {
result.add("2");
result.add("1");
if (isArtsOrFemale == 1) {
result.add("Male|Science");
result.add("Female|Art");
} else {
result.add("Female|Art");
result.add("Male|Science");
}
}
return String.join(",", result);
}
public String getCategory1(String condition) {
List<String> result = new ArrayList<>();
result.add(typeRandomPick);
......@@ -133,12 +203,6 @@ public class Decision {
return String.join(",", result);
}
public String getMix() {
// let me hard code this
String[] result = new String[]{};
return String.join(",", result);
}
public String getBreak() {
List<String> result = new ArrayList<>();
// type pause only needs three col's
......
......@@ -50,7 +50,7 @@ public class DecisionTest {
System.out.println("getMix");
Decision instance = new Decision();
String expResult = "";
String result = instance.getMix();
String result = instance.getMixTypical("HWL");
System.out.println(result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment