Пример #1
0
        public DroneMove(SystemRandomSource rndGenerator, string fromTask) : base(rndGenerator)
        {
            angleRandomRotation = new float[7] {
                2, 10, 20, 30, 40, 50, 60
            };
            medianThreshold = new float[7] {
                70, 70, 70, 70, 70, 70, 70
            };
            bestThreshold = new float[7] {
                170, 170, 170, 170, 170, 170, 170
            };
            if (fromTask == "Stabilization")
            {
                rowIndex = 12;
            }
            else if (fromTask == "Move")
            {
                rowIndex = 0;
            }
            this.fromTask = fromTask;

            deltaDistribution = new ContinuousUniform(-5, 5, rndGenerator);
            shapes            = new List <int>()
            {
                12, 4
            };
            signal         = new UCSignal(shapes[0]);
            individualSize = 0;

            for (int i = 0; i < shapes.Count - 1; i++)
            {
                individualSize += (shapes[i] + 1) * shapes[i + 1];
            }
        }
Пример #2
0
    public void SendUCSignal(UCSignal signal)
    {
        UCSignal result = signal;

        foreach (Drone.Hardware.Component <UCSignal> component in UCSignalBus)
        {
            result = component.ProcessSignal(result);
        }
    }
 /**
  * \brief Simple constructor of the task. Build all the hyper parameters of the model (Genetic algorithm + MLP). Define the shapes of the MLp and the size of an individual for the genetic part.
  */
 public DroneStabilizationNoVelocity(SystemRandomSource rndGenerator, string fromTask) : base(rndGenerator)
 {
     fromTask = "StabilizationNoVelocity";
     rowIndex = 0;
     shapes   = new List <int>()
     {
         7, 4
     };
     signal         = new UCSignal(shapes[0]);
     individualSize = 0;
     for (int i = 0; i < shapes.Count - 1; i++)
     {
         individualSize += (shapes[i] + 1) * shapes[i + 1];
     }
 }
Пример #4
0
 /**
  * \brief Simple constructor of the task. Build all the hyper parameters of the model (Genetic algorithm + MLP). Define the shapes of the MLp and the size of an individual for the genetic part.
  */
 public DroneStabilization(SystemRandomSource rndGenerator, string fromTask) : base(rndGenerator)
 {
     float mean = 0.0f;
     float stdDev = 1.0f;
     float deltaT = 0.02f;
     noise = new NoiseSensor(mean, stdDev, stdDev, deltaT, rndGenerator);
     lowNoise = new NoiseSensor(mean, stdDev/5.0f, stdDev/5.0f, deltaT, rndGenerator);
     this.fromTask = "Stabilization";
     //Debug.Log(this.fromTask);
     rowIndex = 0;
     shapes = new List<int>() {9, 4};
     signal = new UCSignal(shapes[0]);
     individualSize = 0;
     for (int i = 0; i < shapes.Count - 1; i++)
     {
         individualSize += (shapes[i] + 1) * shapes[i + 1];
     }
 }