Exemplo n.º 1
0
 public void CreateRandomBrainPressed()
 {
     _brain          = new AINeuralPlayer2();
     _prevBrain      = (AINeuralPlayer2)_brain.Clone();
     _trainingsCount = 0;
     Debug.Log("Created ai");
 }
Exemplo n.º 2
0
    public override Player Clone()
    {
        AINeuralPlayer2 clone = new AINeuralPlayer2();

        clone._whereToGoDecider     = _whereToGoDecider.Clone();
        clone._getUsedHumansDecider = _getUsedHumansDecider.Clone();
        return(clone);
    }
Exemplo n.º 3
0
 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;
 }
Exemplo n.º 5
0
 public void OnRevertToPrevPressed()
 {
     _brain = (AINeuralPlayer2)_prevBrain.Clone();
     UpdateView();
 }