// Create a RepFR open-stim word list from specified lists of words to be // repeated and list of words to use once. public static StimWordList Generate( List <RepWordList> repeats, RepWordList singles, bool do_stim, double top_percent_spaced = 0.2) { if (do_stim) { // Open-loop stim assigned here. foreach (var rw in repeats) { AssignRandomStim(rw); } AssignRandomStim(singles); } StimWordList prepared_words = SpreadWords(repeats, top_percent_spaced); foreach (var word_stim in singles) { int insert_at = InterfaceManager.rnd.Next(prepared_words.Count + 1); prepared_words.Insert(insert_at, word_stim); } return(prepared_words); }
protected void Encoding(StimWordList encodingList, int index) { int interval; WordStim word = encodingList[index]; int[] limits = manager.GetSetting("stimulusInterval").ToObject <int[]>(); interval = InterfaceManager.rnd.Next(limits[0], limits[1]); Dictionary <string, object> data = new Dictionary <string, object>(); data.Add("word", word.word); data.Add("serialpos", index); data.Add("stim", word.stim); ReportEvent("word stimulus", data); SendHostPCMessage("WORD", data); manager.Do(new EventBase <string, string>(manager.ShowText, "word stimulus", word.word)); DoIn(new EventBase(() => { manager.Do(new EventBase(manager.ClearText)); ReportEvent("clear word stimulus", new Dictionary <string, object>()); SendHostPCMessage("ISI", new Dictionary <string, object>() { { "duration", interval } }); this.DoIn(new EventBase(Run), interval); }), (int)manager.GetSetting("stimulusDuration")); }
public RepRun(StimWordList encoding_list, StimWordList recall_list, bool set_encoding_stim = false, bool set_recall_stim = false) { encoding = encoding_list; recall = recall_list; encoding_stim = set_encoding_stim; recall_stim = set_recall_stim; }
protected void DoEncoding() { StimWordList currentList = currentSession[state.listIndex].encoding; if (state.wordIndex >= currentList.Count) { state.wordIndex = 0; state.mainLoopIndex++; Run(); return; } Encoding(currentList, state.wordIndex); state.wordIndex++; }