Ejemplo n.º 1
0
    private IEnumerator CreatePopulation()
    {
        AICreatesInitialPopulationTurn = false;
        GameObject IndividualCompositionSet = Instantiate(Individual, this.transform.position, this.transform.rotation);

        IndividualCompositionSet.GetComponent <BrainGA>().Init();
        BrainGA b = IndividualCompositionSet.GetComponent <BrainGA>();

        b.MoveComposition();

        counterForPopulation++; // COUNTER

        yield return(new WaitForSeconds(secondToWaitForPopGeneration));

        openCVmanager.CallForOpenCVCalculationUpdates(); // to update the score pixels balance of opencv..
        gameManagerNotOpenCV.CallTOCalculateNOTOpenCVScores();

        //inferenceScoreFeatures.CallTOCalculateFeaturesAllScores();
        //inferenceNNfomDATABASE.CallTOCalculateNNFrontTopcore();
        //inferenceCompositionML.CallTOCalculateMobileNetScore();
        //inferenceFinalOut.CallTOCalculateFinalOutScore();

        barracudaCNNModel.CallTOCalculateBarracudaCNNScore();
        barracudaNNfromDatabase.CallTOCalculateBarracudaNNFrontTopcore();
        barracudaOpenCvFeature.BarracudaCallTOCalculateOpencvFeaturesScore();
        barracudaFinalOut.BarracudaCallTOCalculateFinalOutScore();

        IndividualCompositionSet.GetComponent <BrainGA>().CalculateTotalScore(); /// this is where the score is updated
        population.Add(IndividualCompositionSet);


        if (counterForPopulation < populationSize)
        {
            AICreatesInitialPopulationTurn          = true;
            GenerateNewPopulatoinOffsprings_trigger = false;
        }
        else
        {
            AICreatesInitialPopulationTurn          = false; // STOP FIRST INITIAL POPULATION
            GenerateNewPopulatoinOffsprings_trigger = true;  // START NEW BREEDING to produce offsprings
        }
    }
        public void OnFingerUp(LeanFinger finger)
        {
            //Debug.Log("Finger " + finger.Index + " finished touching the screen");

            openCVManager.CallForOpenCVCalculationUpdates();
            gameManagerNotOpenCV.CallTOCalculateNOTOpenCVScores();



            barracudaCNNModel.CallTOCalculateBarracudaCNNScore();
            barracudaNNfromDatabase.CallTOCalculateBarracudaNNFrontTopcore();
            barracudaOpenCvFeature.BarracudaCallTOCalculateOpencvFeaturesScore();
            barracudaFinalOut.BarracudaCallTOCalculateFinalOutScore();
        }