@@ -19,62 +19,6 @@ namespace restart
1919 LOG_TRACE (enqueue_exercise_deffunction);
2020 [[maybe_unused]] auto build_enqueue_exercise_df_err = Build (get_env (), enqueue_exercise_deffunction);
2121 assert (build_enqueue_exercise_df_err == BE_NO_ERROR);
22-
23- try
24- {
25- [[maybe_unused]] auto &usr = cc.get_type (" CognitiveDomain" );
26- }
27- catch (const std::exception &e)
28- {
29- LOG_WARN (" Initializing RESTART database" );
30-
31- [[maybe_unused]] auto &cd_type = cc.create_type (" CognitiveDomain" , {}, json::json{{" name" , {" type" , " string" }}}, json::json ());
32- // auto &memory_cd = cc.create_item(cd_type, json::json{{"name", "Memory"}});
33- // auto &attention_cd = cc.create_item(cd_type, json::json{{"name", "Attention"}});
34- // auto &executive_functions_cd = cc.create_item(cd_type, json::json{{"name", "ExecutiveFunctions"}});
35- // auto &general_cd = cc.create_item(cd_type, json::json{{"name", "General"}});
36-
37- [[maybe_unused]] auto &ct_type = cc.create_type (" CognitiveTest" , {}, json::json{{" name" , {" type" , " string" }}, {" domain" , {{" type" , " item" }, {" domain" , " CognitiveDomain" }}}}, json::json ());
38- // [[maybe_unused]] auto &moca_ct = cc.create_item(ct_type, json::json{{"name", "MoCA"}, {"domain", general_cd.get_id()}});
39- // [[maybe_unused]] auto &attention_matrices_ct = cc.create_item(ct_type, json::json{{"name", "AttentionMatrices"}, {"domain", attention_cd.get_id()}});
40- // [[maybe_unused]] auto &trial_making_test_a_ct = cc.create_item(ct_type, json::json{{"name", "TrialMakingTestA"}, {"domain", executive_functions_cd.get_id()}});
41- // [[maybe_unused]] auto &trial_making_test_b_ct = cc.create_item(ct_type, json::json{{"name", "TrialMakingTestB"}, {"domain", executive_functions_cd.get_id()}});
42- // [[maybe_unused]] auto &trial_making_test_b_a_ct = cc.create_item(ct_type, json::json{{"name", "TrialMakingTestBA"}, {"domain", executive_functions_cd.get_id()}});
43- // [[maybe_unused]] auto &semantic_fluency_ct = cc.create_item(ct_type, json::json{{"name", "SemanticFluency"}, {"domain", executive_functions_cd.get_id()}});
44- // [[maybe_unused]] auto &phonological_fluency_ct = cc.create_item(ct_type, json::json{{"name", "PhonologicalFluency"}, {"domain", executive_functions_cd.get_id()}});
45- // [[maybe_unused]] auto &modified_wisconsin_card_sorting_test_ct = cc.create_item(ct_type, json::json{{"name", "ModifiedWisconsinCardSortingTest"}, {"domain", executive_functions_cd.get_id()}});
46- // [[maybe_unused]] auto &short_story_ct = cc.create_item(ct_type, json::json{{"name", "ShortStory"}, {"domain", memory_cd.get_id()}});
47-
48- [[maybe_unused]] auto &ce_type = cc.create_type (" CognitiveExercise" , {}, json::json{{" name" , {" type" , " string" }}, {" duration" , {{" type" , " int" }, {" min" , 0 }, {" max" , 60 }}}, {" domain" , {{" type" , " item" }, {" domain" , " CognitiveTest" }}}}, json::json ());
49- // [[maybe_unused]] auto &visual_memory_ce = cc.create_item(ce_type, json::json{{"name", "VisualMemory"}, {"duration", 5}, {"domain", memory_cd.get_id()}});
50- // [[maybe_unused]] auto &attention_ce = cc.create_item(ce_type, json::json{{"name", "Attention"}, {"duration", 5}, {"domain", attention_cd.get_id()}});
51- // [[maybe_unused]] auto &executive_functions_ce = cc.create_item(ce_type, json::json{{"name", "ExecutiveFunctions"}, {"duration", 5}, {"domain", executive_functions_cd.get_id()}});
52-
53- [[maybe_unused]] auto &usr_type = cc.create_type (" User" , {}, json::json{{" name" , {" type" , " string" }}}, json::json ());
54- [[maybe_unused]] auto &t_done_type = cc.create_type (" TestDone" , {}, json::json{{" user" , {{" type" , " item" }, {" domain" , " User" }}}, {" test" , {{" type" , " item" }, {" domain" , " CognitiveTest" }}}, {" score" , {{" type" , " int" }, {" min" , 0 }, {" max" , 6 }}}}, json::json ());
55- [[maybe_unused]] auto &ex_done_type = cc.create_type (" ExerciseDone" , {}, json::json{{" user" , {{" type" , " item" }, {" domain" , " User" }}}, {" exercise" , {{" type" , " item" }, {" domain" , " CognitiveExercise" }}}, {" done" , {{" type" , " int" }, {" min" , 0 }, {" default" , 0 }}}, {" level" , {{" type" , " int" }, {" min" , 0 }, {" max" , 6 }}}, {" score" , {{" type" , " float" }, {" min" , 0 }, {" max" , 1 }}}}, json::json ());
56-
57- auto &robot_type = cc.create_type (" Robot" , {}, json::json{{" name" , {" type" , " string" }}}, json::json{{" current_command" , {{" type" , " symbol" }, {" values" , {" welcome" , " rot" , " training" , " goodbye" }}}}, {" current_modality" , {{" type" , " symbol" }, {" values" , std::vector<json::json>{" formal" , " informal" }}}}, {" command_completed" , {{" type" , " symbol" }, {" values" , {" welcome" , " rot" , " training" , " goodbye" }}}}, {" current_user" , {{" type" , " item" }, {" domain" , " User" }}}, {" current_exercise" , {{" type" , " item" }, {" domain" , " CognitiveExercise" }}}, {" current_level" , {{" type" , " int" }, {" min" , 0 }, {" max" , 10 }}}, {" current_score" , {{" type" , " float" }, {" min" , 0 }, {" max" , 1 }}}});
58- [[maybe_unused]] auto &robot = cc.create_item (robot_type, json::json{{" name" , " RESTART" }});
59-
60- cc.create_reactive_rule (" robot_session" , start_session_rule);
61- cc.create_reactive_rule (" robot_rot" , start_rot_rule);
62- {
63- std::ifstream file (" src/start_training.clp" );
64- std::stringstream buffer;
65- buffer << file.rdbuf ();
66- cc.create_reactive_rule (" start_training" , buffer.str ());
67- }
68- {
69- std::ifstream file (" src/exercise_done.clp" );
70- std::stringstream buffer;
71- buffer << file.rdbuf ();
72- cc.create_reactive_rule (" exercise_done" , buffer.str ());
73- }
74- cc.create_reactive_rule (" robot_end_session" , end_session_rule);
75-
76- // create_user("TestUser", json::json{{"MoCA", 2}, {"AttentionMatrices", 1}, {"TrialMakingTestA", 4}, {"TrialMakingTestB", 3}, {"TrialMakingTestBA", 0}, {"SemanticFluency", 2}, {"PhonologicalFluency", 4}, {"ModifiedWisconsinCardSortingTest", 1}, {"ShortStory", 3}});
77- }
7822 }
7923
8024 std::vector<domain> restart::get_domains () noexcept
0 commit comments