This repository has been archived on 2026-10-21. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
PICKA_python/crm/crm_run.py
T
2026-09-22 11:52:03 +02:00

43 lines
1.3 KiB
Python

import os
from crm_options import expe_options as crmOptions
from scipy.io import savemat
from crm_robot import robot
from crm_build_conditions import expe_build_conditions as buildConditions
from tools.load_matrix import loadmat
def main(options, subject, phase, lang, p_exists, ip, port):
options = {}
options["subject_name"] = subject
options = crmOptions(options)
options["language"] = lang
res_filename = os.path.join(options["result_path"], '{}{}_{}_robot.mat'.format(
options["result_prefix"], lang.lower(), subject))
options["res_filename"] = res_filename
res_tracker = os.path.join(
options["result_path"], '{}_tracker.mat'.format(subject))
options["res_tracker"] = res_tracker
if not os.path.exists(res_tracker):
track = {}
track["experiment_begin"] = 1
track["experiments"] = {}
track["experiments"]["fishy"] = 0
track["experiments"]["gender"] = 0
track["experiments"]["emotion"] = 0
track["experiments"]["crm"] = 0
savemat(res_tracker, mdict={"tracker": track})
if not os.path.exists(res_filename):
expe, options = buildConditions(options)
else:
mat = loadmat(options["res_filename"])
expe = mat["expe"]
options = mat["options"]
robot(ip, port, lang, options, phase)