Esempio 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;
 }
Esempio 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))));
        }
Esempio 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);
     }
 }
Esempio n. 4
0
 public Request(object message, RequestType type, TrialMetadata extra_info)
 {
     this.message    = message;
     this.type       = type;
     this.extra_info = extra_info;
 }
Esempio n. 5
0
 public Request(object message, RequestType type)
 {
     this.message    = message;
     this.type       = type;
     this.extra_info = null;
 }