private void OnFlicked(object sender, EventArgs e) { // 最近傍のノーツを処理すべきタイミング(sec) var noteSec = noteProperty.secBegin; // 処理すべきタイミングと // 実際にキーが押されたタイミングの差の絶対値 var differenceSec = Mathf.Abs(noteSec - PlayerController.CurrentSec); // 最近傍のノーツのOnKeyDownを呼び出し var judgementType = JudgementManager.GetJudgementType(differenceSec); // デバッグ用にコンソールに判定を出力 Debug.Log(judgementType); // 判定がMissでないとき(BAD以内のとき) if (judgementType != JudgementType.Miss) { // ヒット処理(スコア・コンボ数などを変更) EvaluationManager.OnHit(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); // 未処理ノーツ一覧から削除 PlayerController.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); // GameObject自体も削除 Destroy(gameObject); } }
private void OnReleased(object sender, EventArgs e) { // 最近傍のノーツを処理すべきタイミング(sec) var noteSec = noteProperty.secEnd; // 処理すべきタイミングと // 実際にキーが押されたタイミングの差の絶対値 var differenceSec = Mathf.Abs(noteSec - PlayerController.CurrentSec); // 最近傍のノーツのOnKeyUpを呼び出し var judgementType = JudgementManager.GetJudgementType(differenceSec); // 判定がBad以内のとき if (judgementType != JudgementType.Miss) { // ヒット処理 EvaluationManager.OnHit(judgementType); } // 判定がMissの時(MISS) else { // ミス処理 EvaluationManager.OnMiss(); } // コンソールに判定を表示 Debug.Log(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); // 処理中フラグを解除 isProcessed = false; //リストから削除 PlayerController.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); // GameObject自体も削除 Destroy(gameObject); }
private void CheckMiss() { //処理中でない状態で視点が判定ラインを通過し、 //Badの判定幅よりも離れるとノーツを削除 if (!isProcessed && noteProperty.secBegin - PlayerControllers.CurrentSec < -JudgementManager.JudgementWidth[JudgementType.Bad]) { //TODOミス処理(二回呼び出す) EvaluationManager.OnMiss(); //始点の分 EvaluationManager.OnMiss(); //終点の分 //リストから削除 PlayerControllers.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); //GameObject自体も削除 Destroy(gameObject); } // 処理中の状態で終点が判定ラインを通過し、 // BaDの判定幅よりも離れるとノーツを削除 if (isProcessed && noteProperty.secEnd - PlayerControllers.CurrentSec < -JudgementManager.JudgementWidth[JudgementType.Bad]) { //TODO ミス処理 EvaluationManager.OnMiss(); //処理中フラグを解除 isProcessed = false; //リストから削除 PlayerControllers.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); // GameObjectを削除 Destroy(gameObject); } }
private void OnPressed(object sender, EventArgs e) { // 最近傍のノーツを処理すべきタイミング(sec) var noteSec = noteProperty.secBegin; // 処理すべきタイミングと // 実際にキーが押されたタイミングの差の絶対値 var differenceSec = Mathf.Abs(noteSec - PlayerController.CurrentSec); // 最近傍のノーツのOnKeyDownを呼び出し var judgementType = JudgementManager.GetJudgementType(differenceSec); // デバッグ用にコンソールに判定を出力 Debug.Log(judgementType); // 判定がMissでないとき(BAD以内のとき) if (judgementType != JudgementType.Miss) { // ヒット処理 EvaluationManager.OnHit(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); // 処理中フラグを付ける isProcessed = true; // 通過オブジェクトを非表示にする Begin.material = Alpha; } }
//キーが離された時 public override void OnKeyUp(JudgementType judgementType) { //TODO 判定がBad以内の時 if (judgementType != JudgementType.Miss) { //ヒット処理 EvaluationManager.OnHit(judgementType); } //判定がmissのとき else { //ミス処理 EvaluationManager.OnMiss(); } //コンソールに判定を表示 Debug.Log(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); // 処理中フラグを解除 isProcessed = false; //リストから削除 PlayerControllers.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); //gameObjectも削除 Destroy(gameObject); }
public EndActivityTransition(GameObject root, EvaluationManager manager) { _manager = manager; _root = root; _transition = manager.ActivityTransition; _eventTrigger = root.GetComponent <ActivityTransitionFinished>(); _evaluationLights = _transition.GetComponentsInChildren <EvaluationLight>(); _ressi = GameObject.FindObjectOfType <RessiController>(); }
public EvaluationsController( EvaluationManager <ApplicationDbContext> evaluationManager, SubjectManager <ApplicationDbContext> subjectManager, UserManager <Student> userManager) { _evaluationManager = evaluationManager; _subjectManager = subjectManager; _userManager = userManager; }
public EndSectionTransition(Vector2 startCoordinates) { _content = ResourceLoader.InstantiatePrefabAtPosition(Constants.Resources.SectionTransition, new Vector2(startCoordinates.x - _placementOffsetx, startCoordinates.y), null); _manager = _content.GetComponent <EvaluationManager>(); _progressbar = _content.GetComponentInChildren <ShowProgress>(); _activityTransition = new EndActivityTransition(_content, _manager); SetEdges(); InitializeTriggers(); }
public EvaluationController(IEvaluationQuerier evaluationQuerier, IJobQuerier jobQuerier, EvaluationManager evaluationManager, InvestigationManager investigationManager, IServiceProvider serviceProvider) : base(serviceProvider) { _evaluationQuerier = evaluationQuerier; _jobQuerier = jobQuerier; _evaluationManager = evaluationManager; _investigationManager = investigationManager; }
// 見逃し検出 private void CheckMiss() { // 判定ラインを通過した後、BADの判定幅よりも離れるとノーツを削除 if (noteProperty.secBegin - PlayerController.CurrentSec < -JudgementManager.JudgementWidth[JudgementType.Bad]) { // ミス処理 EvaluationManager.OnMiss(); // 未処理ノーツ一覧から削除 PlayerController.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); // GameObject自体も削除 Destroy(gameObject); } }
private static void RunInEvaluationMode() { bool ifExit = false; while (!ifExit) { Console.WriteLine( "Please, specify analysis parameters"); string jsonModel = null; while (jsonModel == null) { Console.WriteLine( "Specify path to model file:"); string pathToFile = Console.ReadLine(); jsonModel = ParseModelFile(pathToFile); } List <int> sequence = null; while (sequence == null) { Console.WriteLine( "Specify path to sequence file:"); string pathToFile = Console.ReadLine(); sequence = ParseSequenceFile(pathToFile); } Console.WriteLine("Starting evaluation"); EvaluationManager manager = new EvaluationManager(); EvaluationResult result = manager.Evaluate(jsonModel, sequence); if (result.HasErrors()) { Console.WriteLine("Evaluation failed due to the following errors:" + String.Join(", ", result.Errors.ToArray())); } else { Console.WriteLine("Probability that the sequence has been generated by the model is " + result.Value); } Console.WriteLine("Do you want to continue? (y/n)"); ifExit = !ParseBoolean(Console.ReadLine()); } Console.WriteLine("Press Ctrl+C to exit..."); }
// キーが押された時 public override void OnKeyDown(JudgementType judgementType) { // コンソールに判定を表示 Debug.Log(judgementType); // 判定がMissでないとき(BAD以内のとき) if (judgementType != JudgementType.Miss) { // ヒット処理 EvaluationManager.OnHit(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); // 処理中フラグを付ける isProcessed = true; // 通過オブジェクトを非表示にする Begin.material = Alpha; } }
// First-time Initialization -- triggered through gameManager & GUI public void NewTrainingMode(Challenge.Type challengeType) { this.challengeType = challengeType; // Initialize int numPlayers = 1; switch (this.challengeType) { case Challenge.Type.Test: Debug.Log("Switch: Test"); numPlayers = 1; break; case Challenge.Type.Racing: Debug.Log("Switch: Racing"); numPlayers = 1; break; case Challenge.Type.Combat: Debug.Log("Switch: Combat"); numPlayers = 2; break; default: Debug.Log("Switch: Default"); break; } // environment is evolvable, 1 player: teamsConfig = new TeamsConfig(numPlayers, this.challengeType, 1, 1); playingCurGen = 0; evaluationManager = new EvaluationManager(); // Need to make sure all populations have their representatives set up before calling this: // Right now this is done through the teamsConfig Constructor evaluationManager.InitializeNewTraining(teamsConfig, challengeType); // should I just roll this into the Constructor? isTraining = true; //cameraEnabled = true; gameManager.uiManager.panelTraining.moduleViewUI.SetPendingGenomesFromData(this); }
// キーが押された時 public override void OnKeyDown(JudgementType judgementType) { // デバッグ用にコンソールに判定を出力 Debug.Log(judgementType); // 判定がMissでないとき(BAD以内のとき) if (judgementType != JudgementType.Miss) { // ヒット処理(スコア・コンボ数などを変更) EvaluationManager.OnHit(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); // 未処理ノーツ一覧から削除 PlayerController.ExistingNoteControllers.Remove( GetComponent <NoteControllerBase>() ); // GameObject自体も削除 Destroy(gameObject); } }
public void NewTrainingMode() { // Initialize int numPlayers = 2; // environment is evolvable, 1 player: teamsConfig = new TeamsConfig(numPlayers, 1, 1); playingCurGen = 0; evaluationManager = new EvaluationManager(); // Need to make sure all populations have their representatives set up before calling this: // Right now this is done through the teamsConfig Constructor evaluationManager.InitializeNewTraining(teamsConfig); // should I just roll this into the Constructor? isTraining = true; //cameraEnabled = true; //gameManager.uiManager.panelTraining.moduleViewUI.SetPendingGenomesFromData(this); }
// キーが押された時 public override void OnKeyDown(JudgementType judgementType) { // コンソールに判定を表示 Debug.Log(judgementType); // 判定がMissでないとき(BAD以内のとき) if (judgementType != JudgementType.Miss) { //ヒット再生 EvaluationManager.OnHit(judgementType); //効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); //処理中フラグを付ける isProcessed = true; // 色を反抗 objBegin.GetComponent <SpriteRenderer>().color = processedColorEdges; objEnd.GetComponent <SpriteRenderer>().color = processedColorEdges; objTrail.GetComponent <SpriteRenderer>().color = processedColorTrail; } }
//キーが押された時 public override void OnKeyDown(JudgementType judgementType) { //コンソールに判定表示 Debug.Log(judgementType); //判定がMiss出ない時(Bad以内の時) if (judgementType != JudgementType.Miss) { //TODOヒット処理 EvaluationManager.OnHit(judgementType); // 効果音再生 AudioSource.PlayClipAtPoint(clipHit, transform.position); //処理中フラグを付ける isProcessed = true; //色を変更 objBegin.GetComponent <SpriteRenderer>().color = processedColorEdges; objEnd.GetComponent <SpriteRenderer>().color = processedColorEdges; objTrail.GetComponent <SpriteRenderer>().color = processedColorTrail; } }
public DashboardAppService(EvaluationManager evaluationManager) { EvaluationManager = evaluationManager; }
// Use this for initialization void Start() { evaluationManager = GameObject.Find("EvaluationManager").GetComponent <EvaluationManager>(); StartCoroutine(WaitEvaluationSettingEnd()); }
public void LoadTrainingMode() { Debug.Log("LoadTrainingMode(TeamsConfig teamsConfig)!"); //Debug.Log(teamsConfig.environmentPopulation.environmentGenomeList[0]..ToString()); Debug.Log(teamsConfig.challengeType.ToString()); // Initialize! teamsConfig.InitializeFromLoadedData(); // Sets up non-serialized data so it's ready for training playingCurGen = 0; // for now - eventually I can save this too, but it doesn't seem critically important evaluationManager = new EvaluationManager(); // Need to make sure all populations have their representatives set up before calling this: // Right now this is done through the teamsConfig Constructor evaluationManager.InitializeNewTraining(teamsConfig, challengeType); // should I just roll this into the Constructor? isTraining = true; //cameraEnabled = true; /* * Challenge.Type challengeType = teamsConfig.challengeType; * * // Initialize * * // Setup Teams, Environment, and Populations - held inside teamsConfig * switch (challengeType) { * case Challenge.Type.Test: * //print("test challenge"); * * // should be saved/built already: * //teamsConfig = new TeamsConfig(true, 1, Challenge.Type.Test); * * playingCurGen = 0; * //playingCurAgent = 0; * * // Set up eval pairs: * evaluationPairsList = new List<EvaluationPair>(); * agentFitnessList = new List<float>(); * environmentFitnessList = new List<float>(); * * int numAgentReps = 1; * int numEnvironmentReps = 4; * // Hardcoded for ONE PLAYER!!!! Agent evals: * for (int i = 0; i < teamsConfig.playersList[0].agentGenomeList.Count; i++) { * for (int j = 0; j < numEnvironmentReps; j++) { * int[] pairIndices = new int[2]; * pairIndices[0] = j; // Environment Representative * pairIndices[1] = i; // Agent Index * EvaluationPair evalPair = new EvaluationPair(pairIndices, 1); // 2 populations (including environment) * evaluationPairsList.Add(evalPair); // append pair to list * } * agentFitnessList.Add(0f); * } * // Environment evals: * for (int i = 0; i < teamsConfig.environmentGenomesList.Count; i++) { * for (int j = 0; j < numAgentReps; j++) { * int[] pairIndices = new int[2]; * pairIndices[0] = i; // Environment Index * pairIndices[1] = j; // Agent Representative * EvaluationPair evalPair = new EvaluationPair(pairIndices, 0); // 2 populations (including environment) * evaluationPairsList.Add(evalPair); // append pair to list * } * environmentFitnessList.Add(0f); * } * * // Set up evaluation Instance Managers: * Vector3 arenaBounds = Challenge.GetChallengeArenaBounds(challengeType); * evaluationInstancesList = new List<EvaluationInstance>(); * for (int x = 0; x < maxInstancesX; x++) { * for (int z = 0; z < maxInstancesZ; z++) { * GameObject evalInstanceGO = new GameObject("EvaluationInstance [" + x.ToString() + "," + z.ToString() + "]"); * EvaluationInstance evaluationInstance = evalInstanceGO.AddComponent<EvaluationInstance>(); * evaluationInstance.particleCurves = particleTrajectories; * evalInstanceGO.transform.position = new Vector3(x * (arenaBounds.x + instanceBufferX), 0f, z * (arenaBounds.z + instanceBufferZ)); * evaluationInstancesList.Add(evaluationInstance); * * if (x == 0 & z == 0) { * evaluationInstance.visible = true; * } * else { * evaluationInstance.visible = false; * } * } * } * * isTraining = true; * * break; * default: * print("default"); * break; * } */ }