comparison TrainingScoreManager.h @ 43:4ad0d218f890

can skip runs if it crashed etc.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Mon, 15 Dec 2014 12:51:09 +0000
parents 96ff7b41923a
children a62e033117fa
comparison
equal deleted inserted replaced
42:2bd658b44c2d 43:4ad0d218f890
56 band = 4; 56 band = 4;
57 57
58 }else if (dist < TARGET_SCORE_CC_BAND*6*dimComp){ // 30 58 }else if (dist < TARGET_SCORE_CC_BAND*6*dimComp){ // 30
59 59
60 band = 5; 60 band = 5;
61
62
63 }else if (dist < TARGET_SCORE_CC_BAND*9*dimComp){ // 45 61 }else if (dist < TARGET_SCORE_CC_BAND*9*dimComp){ // 45
64 62
65 band = 6; 63 band = 6;
66
67
68 }else{ 64 }else{
69 65
70 band = 7; 66 band = 7;
71 67
72 68
134 int timeAllowed, 130 int timeAllowed,
135 int difficulty, 131 int difficulty,
136 int whichInSequence, 132 int whichInSequence,
137 int presetIndex, 133 int presetIndex,
138 int tempoLevel, 134 int tempoLevel,
139 int runNumber) { 135 int seqLength) {
140 TrainingTestResult result; 136 TrainingTestResult result;
141 stringstream msg; 137 stringstream msg;
142 int score = 0; 138 int score = 0;
143 // work out euc distance from actual point 139 // work out euc distance from actual point
144 140
160 156
161 157
162 result.realDistanceToTarget = dist; 158 result.realDistanceToTarget = dist;
163 result.targetBandHit = band; // eg bullseye = 0 edge = 7 159 result.targetBandHit = band; // eg bullseye = 0 edge = 7
164 result.timeAllowed = timeAllowed; 160 result.timeAllowed = timeAllowed;
165 result.score = int(round(TP*10.0)); 161 result.score = int(round(TP));
166 result.displayText = msg.str(); 162 result.displayText = msg.str();
167 result.difficultyLevel = difficulty; 163 result.difficultyLevel = difficulty;
168 result.colorBand = getColorForBand(band); 164 result.colorBand = getColorForBand(band);
169 165
170 if(result.score > 0) totalScored += result.score; 166 if(result.score > 0) totalScored += result.score;
179 details.push_back(difficulty); 175 details.push_back(difficulty);
180 details.push_back(whichInSequence); 176 details.push_back(whichInSequence);
181 details.push_back(initDist*1000); 177 details.push_back(initDist*1000);
182 details.push_back(presetIndex); 178 details.push_back(presetIndex);
183 details.push_back(tempoLevel); 179 details.push_back(tempoLevel);
184 details.push_back(runNumber); 180 details.push_back(seqLength);
185 eventLogger.logEvent(TRAINING_RESULT, details); 181 eventLogger.logEvent(TRAINING_RESULT, details);
186 details.clear(); 182 details.clear();
187 details.insert(details.begin(), targetParams.begin(), targetParams.end()); 183 details.insert(details.begin(), targetParams.begin(), targetParams.end());
188 details.insert(details.end(), answer.begin(), answer.end()); 184 details.insert(details.end(), answer.begin(), answer.end());
189 eventLogger.logEvent(TARGET_AND_MATCH, details); 185 eventLogger.logEvent(TARGET_AND_MATCH, details);