Commit 426d6f73 authored by Xiaoying Pu's avatar Xiaoying Pu

fixed one BUG

parent 0e1576e4
......@@ -18,6 +18,7 @@ public class TestUDPController {
UDPController cntrl = new UDPController();
cntrl.setUp();
cntrl.sendTrialAndRecvResponse("DAF");
//for (int i = 0; i < util.UDPConstants.TrialSet.length; i++) {
// not useable any more because of the interface change
// cntrl.sendTrialAndRecvResponse(i);
......
......@@ -58,6 +58,7 @@ public class UDPHandler {
String messageOut = "";
try {
// create socket
//TODO: Socket creation failec here
DatagramSocket socket = new DatagramSocket(port);
socket.setSoTimeout(udpTimeout);
socket.setReuseAddress(true);
......
......@@ -56,10 +56,10 @@ public class MouseTrackerFacade {
this.theController.endDecision();
System.out.println("Let's say the decision is done");
handleEvent(EventType.DECISION_FINISHED);
//handleEvent(EventType.DECISION_FINISHED);
}
public void endExperiment(){
public void endExperiment() {
this.theController.endEntireExperiment();
}
......
......@@ -61,7 +61,7 @@ public class PrimaryTaskController {
public void startDecision(WLState state) {
Runnable task = () -> {
while (!this.timeIsUp) {
while (!timeIsUp) {
String msg = this.theModel.getDecision(DecisionType.GETMIXATYPICAL, state.toString());
this.udpHandle.sendTrialAndRecvResponse(msg);
System.out.println("Decision started, waiting for response.. ");
......@@ -81,7 +81,7 @@ public class PrimaryTaskController {
}
public void endDecision() {
this.timeIsUp = false;
this.timeIsUp = true;
}
public void connect() {
......
......@@ -88,6 +88,7 @@ public class Trial extends Thread {
case DECISION_FINISHED:
sFacade.startRecallingDigit();
pFacade.endDecision();
break;
case DIGITINPUT_FINISHED:
//TODO how does trial know??????????????
......@@ -145,8 +146,8 @@ public class Trial extends Thread {
} catch (InterruptedException ex) {
Logger.getLogger(Dm_task.class.getName()).log(Level.SEVERE, null, ex);
}
pFacade.endDecision();
// WHY IS THIS LINE FULL
//pFacade.endDecision();
System.out.println("SLEEP ends at -------->" + System.currentTimeMillis() / 1000L);
// own goal
......@@ -189,8 +190,7 @@ public class Trial extends Thread {
}
// start UDP to MouseTracker
// go look at the mousetracker!!!
// TODO why is this not sleeping/???/
System.out.println("WHY ARE YOU NOT SLEEPING");
actionQueue.add(new SleepForDecisions(ActionType.SLEEP_FOR_DECISIONS));
pFacade.startAndWait(curState);
}
......
......@@ -9,7 +9,7 @@ tSTask = 1000
tPause = 4000
tDecisions = 5000
tDecisions = 10000
nTrials = 3
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