PutWeights() public méthode

public PutWeights ( List weights ) : void
weights List
Résultat void
Exemple #1
0
    // Update is called once per frame
    void Update()
    {
        timeTicker -= Time.deltaTime;

        Time.timeScale = 2;

        if (timeTicker < 0)
        {
            generationCount++;
            UpdateGenerationText();

            population = genAlg.Epoch(ref population);


            for (int i = 0; i < noOfLoaders; ++i)
            {
                NeuralNetwork    neuralNetwork    = loaders[i].GetComponent <NeuralNetwork>();
                LoaderController loaderController = loaders[i].GetComponent <LoaderController>();

                float        randomX = Random.Range(-4.5f, 4.5f);
                float        randomZ = Random.Range(-4.5f, 4.5f);
                List <float> weights = new List <float>(population[i].GetWeights());

                neuralNetwork.PutWeights(ref weights);

                Debug.Log(i);

                loaders[i].transform.position = new Vector3(randomX, 0.3f, randomZ);
                loaderController.ResetFitness();
                weights.Clear();
            }

            timeTicker = timeLeft;
        }
    }
 public void PutWeights(List <double> weights)
 {
     brain.PutWeights(weights);
 }
 public void PutWeights(List <float> iWeights)
 {
     mTankBrain.PutWeights(iWeights);
 }