public void Init() { stats = new Stats(0, 0, 0, 0, 0); dataManager = DataManager.GetInstance(); url = dataManager.GetAWSURL(); uiStatsRaderChart.SetStats(stats); reset(); animationTimes = dataManager.GetAnimationTimes(); all_knn_results = dataManager.GetAll_Knn_Results(); CalculateScore(animationTimes, all_knn_results); netTime = new double[6]; foreach (double[] time in animationTimes) { for (int i = 0; i < 6; i++) { netTime[i] += time[i]; } } times = new double[6]; times = netTime; temp = new double[5]; for (int i = 0; i < 5; i++) { temp[i] = ((times[i] / times[5]) * 100); temp[i] = 100 - temp[i]; } chartIndex = 0; }
void CalculateScore(List <double[]> aniTimes, All_Knn_Results all_Knn) { double[] totalTime = new double[6]; List <double[]> performScore = new List <double[]>(); foreach (double[] time in aniTimes) { double[] score = new double[5]; for (int i = 0; i < 6; i++) { totalTime[i] += time[i]; if (i != 5) { score[i] = (time[i] / time[5]) * 100; score[i] = 100 - score[i]; } } performScore.Add(score); } double[] totalScore = new double[5]; for (int i = 0; i < 5; i++) { totalScore[i] = ((totalTime[i] / totalTime[5]) * 100); totalScore[i] = 100 - totalScore[i]; } List <string> performname = dataManager.GetItemNameList(); Debug.Log("이름수 : " + performname.Count + ", 부위별점수개수 : " + performScore.Count + ", 평균점수개수 : " + all_Knn.Count()); for (int i = 0; i < performScore.Count; i++) { StartCoroutine(PostScoreToAWS(performname[i], performScore[i], all_Knn.GetEachResult(i).GetScore())); } }
All_Knn_Results all_knn_results; // knn결과 종합 /// 호성이꺼 끝 private void Awake() { if (dataManager == null) { dataManager = this; url = "http://ec2-3-35-168-80.ap-northeast-2.compute.amazonaws.com"; dataFileList = new DataFileList(); dataFileList.Init(); } else if (dataManager != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); this.all_knn_results = new All_Knn_Results(); //호성 }
// Start is called before the first frame update public void Init() { dataManager = DataManager.GetInstance(); url = dataManager.GetAWSURL(); itemNameList = dataManager.GetItemNameList(); itemIndex = GameObject.Find("DataManager").GetComponent <DataManager>().GetItemIndex(); animationTimes = dataManager.GetAnimationTimes(); palyTimes = dataManager.GetPlayTimes(); initTitleText(itemIndex); all_knn_results = new All_Knn_Results(); all_knn_results = this.dataManager.GetAll_Knn_Results(); initPoseNameText("종합"); this.ResultText.text = all_knn_results.GetEvaluation(); ResultText.GetComponent <ContentSizeFitter>().verticalFit = ContentSizeFitter.FitMode.PreferredSize; ResultGraphIndex = 0; if (!Directory.Exists(Application.dataPath + "/Resources/Transforms/RecordData/")) { Directory.CreateDirectory(Application.dataPath + "/Resources/Transforms/RecordData/"); } // File.Create(Application.dataPath + "/Resources/Transforms/RecordData/" + fileName + ".txt"); FileStream fs = new FileStream(Application.dataPath + "/Resources/Transforms/RecordData/hou.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter writer = new StreamWriter(fs, System.Text.Encoding.Unicode); for (int i = 0; i < animationTimes.Count; i++) { writer.WriteLine("교정운동" + (i + 1).ToString()); for (int j = 0; j < animationTimes[i].Length - 1; j++) { writer.WriteLine("디바이스 번호 : " + j.ToString() + ",오류 시간 값 : " + animationTimes[i][j].ToString("0.00")); } writer.WriteLine("전체 수행 시간 : " + palyTimes[i].ToString("0.00")); } writer.Close(); }
public void ResetKnnInstance() { this.all_knn_results = new All_Knn_Results(); }