private void Awake() { agentRef = FindObjectOfType <BilliardAgent>(); gameSystemRef = FindObjectOfType <BilliardGameSystem>(); heatmapRef = FindObjectOfType <HeatMap>(); trainerRef = FindObjectOfType <TrainerMimic>(); agentDecisionRef = agentRef.GetComponent <DecisionMAES>(); if (agentDecisionRef && agentDecisionRef.GetComponent <ESOptimizer>()) { defaultMAESInitStep = agentDecisionRef.GetComponent <ESOptimizer>().initialStepSize; } }
public void OnPlayModeChanged(int mode) { if (agentDecisionRef == null) { return; } if (mode == 0) { agentDecisionRef.useHeuristic = false; agentDecisionRef.useDecision = true; agentDecisionRef.GetComponent <ESOptimizer>().initialStepSize = defaultMAESInitStep; // trainerRef.isTraining = false; } else if (mode == 1) { //trainerRef.isTraining = true; agentDecisionRef.useDecision = false; } else if (mode == 2) { agentDecisionRef.useHeuristic = true; agentDecisionRef.useDecision = true; //trainerRef.isTraining = true; } }