public void CreateRandomBrainPressed() { _brain = new AINeuralPlayer2(); _prevBrain = (AINeuralPlayer2)_brain.Clone(); _trainingsCount = 0; Debug.Log("Created ai"); }
public override Player Clone() { AINeuralPlayer2 clone = new AINeuralPlayer2(); clone._whereToGoDecider = _whereToGoDecider.Clone(); clone._getUsedHumansDecider = _getUsedHumansDecider.Clone(); return(clone); }
public void LoadTraining() { using (Stream stream = File.Open(FilePath, FileMode.Open)) { var binaryFormatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter(); _trainingModels = (List <TrainingDecisionModel>)binaryFormatter.Deserialize(stream); _brain = (AINeuralPlayer2)binaryFormatter.Deserialize(stream); _prevBrain = (AINeuralPlayer2)_brain.Clone(); } UpdateView(); InitTrainers(); Debug.Log("Training loaded"); }
public void Init(DecisionType type, List <TrainingDecisionModel> trainingModels, AINeuralPlayer2 player) { _trainingModels = new List <TrainingDecisionModel> (); foreach (var model in trainingModels) { if (model.Type == type && model.RewardPercent > 0.5f) { _trainingModels.Add(model); } } _trainingsDataSize.text = _trainingModels.Count.ToString(); _decider = player.GetChooserDecider(type); _trainingsCount = 0; }
public void OnRevertToPrevPressed() { _brain = (AINeuralPlayer2)_prevBrain.Clone(); UpdateView(); }