Пример #1
0
 def response_training_response(self):
     """ Analyzes the user's performance on a given grip, returns a string appropriate to their success/failure"""
     training_response = Mglove_str_gen.training_response(
         self.user_stats.get_followup(),
         self.user_stats.get_grip_avg(grip_number=self.user_stats.get_followup(), old=True),
         self.user_stats.get_grip_avg(grip_number=self.user_stats.get_followup()))
     self._last_response = training_response[0]
     return training_response[1]
Пример #2
0
 def response_positive(self):
     """ Returns a scaled string telling the user that their overall reaction time is good/great"""
     self._last_response = "positive_response"
     print("Positive Response")
     #print("scale =", self.user_stats.find_best_grip_scale(grip_times(self._all_grips)))
     return Mglove_str_gen.positive_response(self.user_stats.find_best_grip_scale(grip_times(self._all_grips)))
Пример #3
0
 def response_negative(self):
     """ Returns a scaled string telling the user they need to improve their overall reaction time"""
     print("Negative Response")
     self._last_response = "negative_response"
     #print("scale = ", self.user_stats.find_worst_grip_scale(grip_times(self._all_grips)))
     return Mglove_str_gen.negative_response(self.user_stats.find_worst_grip_scale(grip_times(self._all_grips)))
Пример #4
0
 def response_training_prompt(self):
     """ Analyzes user's last 30 seconds, returns string prompt suggesting a grip to work on (the worst grip)"""
     self._last_response = "training_prompt"
     print("Training Prompt")
     self.user_stats.set_followup(self._last_worst_grip)
     return Mglove_str_gen.training_prompt(self.user_stats.get_followup())
Пример #5
0
            #print(key)
            return "Song Played: " + key + '\n'
    return "Unrecognized Song\n"

def abs_val_list(user_list: []) -> []:
    '''takes a list of floats or ints, takes the abs() of each item and makes a new list'''
    return [abs(i) for i in user_list]


if __name__ == '__main__':
    print("To run experiments please run 'RIVA_Main.py'")
    test_csv = [['1', '1', '-16.823999999999614'], ['4', '4', '-35.30199999999968'], ['3', '3', '-85.779999999999745'],
                ['3', '3', '5.2640000000001237'], ['3', '3', '18.786000000000058'], ['2', '2', '48.307999999999993'],
                ['2', '2', '13.829999999999927'], ['3', '3', '42.113000000001193'], ['2', '2', '39.39600000000064'],
                ['1', '1', '5.9179999999996653'], ['2', '2', '-44.559999999999491'], ['1', '1', '9.5280000000002474'],
                ['4', '4', '-8.9499999999989086'], ['3', '3', '-11.427999999998065'], ['3', '3', '-48.383999999998196'],
                ['3', '3', '-2.8619999999973516'], ['2', '2', '-37.339999999996508'], ['2', '2', '-23.817999999999302'],
                ['3', '3', '-43.534999999999854'], ['2', '2', '-31.252000000000407'], ['1', '1', '-65.730000000003201'],
                ['2', '2', '-20.208000000002357'], ['3', '3', '-3.3590000000040163'], ['2', '2', '-7.0760000000045693'],
                ['1', '1', '-9.5540000000073633'], ['1', '1', '19.967999999993481'], ['4', '4', '61.375999999992928'],
                ['3', '3', '-5.2600000000056752'], ['2', '2', '9.1039999999957217'], ['1', '1', '-25.532000000002881'],
                ['1', '1', '-15.168000000001484'], ['4', '4', '175.51399999999921'], ['3', '3', '30.195999999999913'],
                ['3', '3', '-52.440000000002328'], ['3', '3', '-5.7580000000016298'], ['2', '2', '-55.076000000000931'],
                ['2', '2', '-40.394000000000233'], ['3', '3', '-26.370999999999185'], ['2', '2', '-60.347999999998137'],
                ['1', '1', '-45.665999999997439'], ['2', '2', '-30.98399999999674'], ['1', '1', '11.744000000006054']]
    test_info = gather_info(parse_csv(test_csv))
    print(Mglove_str_gen.worst_grip_str_generator(evaluate_worst_grip(gather_info(parse_csv(test_csv)), 0)))
    print(Mglove_str_gen.worst_grip_str_generator(evaluate_worst_grip(gather_info(parse_csv(test_csv)), 4)))
    print(Mglove_str_gen.worst_grip_str_generator(evaluate_worst_grip(gather_info(parse_csv(test_csv)), 1)))
    print(Mglove_str_gen.summary_generator(evaluate_worst_grip(test_info, 0), evaluate_best_grip(test_info)))
    print("To run experiments please run 'RIVA_Main.py'")