Ejemplo n.º 1
0
 public TrialData(string timeStamp, TrialConfig config, int outcome, TrialMetadata extra_info = null)
 {
     this.timeStamp  = timeStamp;
     this.config     = config;
     this.outcome    = outcome;
     this.extra_info = extra_info;
 }
Ejemplo n.º 2
0
        public IEnumerator Tell(TrialConfig trialConfig, int outcome, TrialMetadata metadata = null)
        {
            TrialWithOutcome message = new TrialWithOutcome(trialConfig, outcome);

            Request req;

            if (metadata != null)
            {
                req = new Request(message, RequestType.tell, metadata);
            }
            else
            {
                req = new Request(message, RequestType.tell);
            }
            yield return(StartCoroutine(this.SendRequest(JsonConvert.SerializeObject(req))));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Called when user makes a judgement and selects a response. Updates the AEPsych model with a new data point.
 /// </summary>
 public void ReportResultToServer(int outcome, TrialMetadata metadata = null)
 {
     if (recordToCSV)
     {
         TrialData trial = new TrialData(DateTime.Now.ToString("hh:mm:ss"), config, outcome, metadata);
         csvFile.WriteTrial(trial);
     }
     AEPsychClient.Log(string.Format("ReportResult: {0}", outcome));
     SetState(ExperimentState.WaitingForTellResponse);
     if (metadata != null)
     {
         StartCoroutine(client.Tell(config, outcome, metadata));
     }
     else
     {
         StartCoroutine(client.Tell(config, outcome));
     }
     if (useModelExploration)
     {
         queryModel.QueryEnabled(false);
     }
 }
Ejemplo n.º 4
0
 public Request(object message, RequestType type, TrialMetadata extra_info)
 {
     this.message    = message;
     this.type       = type;
     this.extra_info = extra_info;
 }
Ejemplo n.º 5
0
 public Request(object message, RequestType type)
 {
     this.message    = message;
     this.type       = type;
     this.extra_info = null;
 }