Browse Source

增加难度选项

dk 1 year ago
parent
commit
98feff011e
2 changed files with 14 additions and 3 deletions
  1. 0 0
      backend/general_grasp_training.psyexp
  2. 14 3
      backend/general_grasp_training.py

File diff suppressed because it is too large
+ 0 - 0
backend/general_grasp_training.psyexp


+ 14 - 3
backend/general_grasp_training.py

@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
 """
 This experiment was created using PsychoPy3 Experiment Builder (v2023.2.3),
-    on 十一月 22, 2023, at 14:37
+    on Tue Nov 28 19:22:54 2023
 If you publish work using this script the most relevant publication is:
 
     Peirce J, Gray JR, Simpson S, MacAskill M, Höchenberger R, Sogo H, Kastman E, Lindeløv JK. (2019) 
@@ -95,6 +95,11 @@ def parse_args():
         type=float
     )
     parser.add_argument(
+        '--difficulty',
+        help='Task difficultys',
+        type=str
+    )
+    parser.add_argument(
         '--model-path',
         dest='model_path',
         help='Path to model file',
@@ -123,7 +128,13 @@ controller = Controller(args.virtual_feedback_rate,
                         args.model_path, 
                         state_change_threshold=args.state_change_threshold)
 # Run 'Before Experiment' code from decision
+cnt_threshold_table = {
+    'easy': 3,
+    'mid': 4,
+    'hard': 5
+}
 
+cnt_threshold = cnt_threshold_table[args.difficulty]
 
 # --- Setup global variables (available in all functions) ---
 # Ensure that relative paths start from the same directory as this script
@@ -199,7 +210,7 @@ def setupData(expInfo, dataDir=None):
     thisExp = data.ExperimentHandler(
         name=expName, version='',
         extraInfo=expInfo, runtimeInfo=None,
-        originPath='C:\\Users\\asena\\Desktop\\kraken\\backend\\general_grasp_training.py',
+        originPath='/Users/dingkunliu/Projects/MI-BCI-Proj/kraken/backend/general_grasp_training.py',
         savePickle=True, saveWideText=True,
         dataFileName=dataDir + os.sep + filename, sortColumns='time'
     )
@@ -904,7 +915,7 @@ def run(expInfo, thisExp, win, inputs, globalClock=None, thisSession=None):
             if d == current_true_label:
                 cnt += 1
         
-        if cnt >= 3:
+        if cnt >= cnt_threshold:
             feedback_time = 10
         else:
             feedback_time = 2

Some files were not shown because too many files changed in this diff