Exemplo n.º 1
0
        public void SetChromosome(ShooterChromosome chromosome, ShooterSampleConfig config)
        {
            Chromosome = chromosome;
            //Debug.Log("Setting Chromosome : " + Chromosome);

            Chromosome.MinDistanceFromTarget = DistanceFromTarget();
            chromosome.Evaluated             = false;

            m_startTime = Time.time;

            transform.rotation = Quaternion.identity;
            m_config           = config;

            var phenotypes = chromosome.GetPhenotypes();
            var str        = phenotypes.Select(p => p.ThrowingVector).ToArray();

            Y       = str[0].y;
            Z       = str[0].z;
            Strengh = str[0].x;

            if (m_cam != null)
            {
                m_cam.StartFollowing(gameObject);
            }

            SetBallColor(Color.green);


            //Appliquer la force
            StartCoroutine(Throwing());

            //Calculer Fin de la Mesure
            StartCoroutine(CheckTimeout());
        }
Exemplo n.º 2
0
        private void Awake()
        {
            if (s_config != null)
            {
                Config = s_config;
            }

            NumberOfSimultaneousEvaluations = SimulationsGrid.x * SimulationsGrid.y;
        }
Exemplo n.º 3
0
        public ShooterChromosome(ShooterSampleConfig config)
        {
            m_config = config;

            var phenotypeEntities = new ShootVectorPhenotypeEntity[config.iteration];

            for (int i = 0; i < phenotypeEntities.Length; i++)
            {
                phenotypeEntities[i] = new ShootVectorPhenotypeEntity(config, i);
            }

            SetPhenotypes(phenotypeEntities);
            CreateGenes();
        }
Exemplo n.º 4
0
 public ShootVectorPhenotypeEntity(ShooterSampleConfig config, int entityIndex)
 {
     Phenotypes = new IPhenotype[]
     {
         new Phenotype("Vector_Y_Shoot", Shoot_Y_VectorBits_Bits)
         {
             MinValue = 0,
             MaxValue = config.Max_VectorAngle
         },
         new Phenotype("Vector_Z_Shoot", Shoot_Z_VectorBits_Bits)
         {
             MinValue = 0,
             MaxValue = config.Max_VectorAngle
         },
         new Phenotype("Vector_Strengh", Shoot_VectorStrengh_Bits)
         {
             MinValue = 0,
             MaxValue = config.MaxStrengh
         }
     };
 }
Exemplo n.º 5
0
        //private PrefabPool

        public static void SetConfig(ShooterSampleConfig config)
        {
            s_config = config;
        }