Exemplo n.º 1
0
    public void StartEA()
    {
        if (carKnowsDrag)
        {
            NUM_INPUTS = 6;
        }
        if (!randomDrag)
        {
            Trials = 1;
        }

        SetupNewExperiment();

        //		mapLength = (int)((maxRain - minRain) / rainInterval);
//		map = new NeatGenome[1];
        //loadBest ();


        // print("Loading: " + popFileLoadPath);
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        //   Time.fixedDeltaTime = 0.045f;
        _ea.StartContinue();
        EARunning = true;
    }
Exemplo n.º 2
0
    public void StartEA()
    {
        //update the location of the Target
        Target.transform.position = new Vector3(UnityEngine.Random.Range(-distaceTargetAllowed, distaceTargetAllowed), Target.transform.position.y, UnityEngine.Random.Range(-distaceTargetAllowed, distaceTargetAllowed));
        if (Utility.DebugLog)
        {
            Utility.Log("Starting PhotoTaxis experiment");
            // Utility.Log("Loading: " + popFileLoadPath);
        }
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        Generation = _ea.CurrentGeneration;


        var evoSpeed = timeScale;

        //   Time.fixedDeltaTime = 0.045f;
        Time.timeScale = evoSpeed;
        _ea.StartContinue();
        EARunning = true;
    }
Exemplo n.º 3
0
    /// <summary>
    /// Initializes our evolutionary algorithms (For instance, here the
    /// manual selection extension gets access to the genome-to-phenome
    /// decoder.
    /// Loads a genome population from a save file or calls the factory to
    /// create the first generation.
    /// </summary>
    public void StartGenomePopulation()
    {
        _ea = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        experiment.SetDecoderInManualEA(manual_ea);
        // We also pass the instance of NeatManualEvolution to
        // NeatEvolutionaryAlgorithm and vice versa
        _ea.Manual_ea = manual_ea;
        // Resets the current generation in case we are loading files.
        generation            = FindOldGeneration();
        _ea.CurrentGeneration = generation;

        // We pass a genome to the uiManager. For the schematic view all
        // genomes are exactly the same, so we can pass any we like.
        uiManager.UpdateModelGenome(_ea.GenomeList[0]);
    }
    public void StartEA()
    {
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        var evoSpeed = 100;

        Time.timeScale = evoSpeed;
        _ea.StartContinue();
        EARunning = true;
        trackLoader.startLoader();
    }
Exemplo n.º 5
0
    public void StartEA()
    {
        Utility.DebugLog = true;
        Utility.Log("Starting Flappy Birds experiment");
        // print("Loading: " + popFileLoadPath);
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        //   Time.fixedDeltaTime = 0.045f;
        Time.timeScale = SimulationSpeed;
        _ea.StartContinue();
        EARunning = true;
    }
Exemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        Debug.Log("Starting XOR experiment");
        SimpleExperiment experiment = new SimpleExperiment();

        XmlDocument xmlConfig = new XmlDocument();

        xmlConfig.Load(@"Assets\Scripts\xor.config.xml");
        experiment.Initialize("XOR", xmlConfig.DocumentElement);

        _ea = experiment.CreateEvolutionAlgorithm();

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);

        _ea.StartContinue();
    }
Exemplo n.º 7
0
    public void StartEA()
    {
        Utility.DebugLog = true;
        Utility.Log("Starting PhotoTaxis experiment");
        // print("Loading: " + popFileLoadPath);
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        var evoSpeed = 20;


        Time.timeScale = evoSpeed;
        _ea.StartContinue();
        EARunning = true;
    }
Exemplo n.º 8
0
    public void StartEA()
    {
        Camera.main.transform.position = new Vector3(5, 5, -10);
        contr.isGame     = true;
        ga.isGame        = false;
        Utility.DebugLog = true;
        Utility.Log("Starting PhotoTaxis experiment");
        // print("Loading: " + popFileLoadPath);
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        var evoSpeed = 25;

        //   Time.fixedDeltaTime = 0.045f;
        Time.timeScale = evoSpeed;
        _ea.StartContinue();
        EARunning = true;
    }
Exemplo n.º 9
0
    public void StartEA()
    {
        if (Utility.DebugLog)
        {
            Utility.Log("Starting PhotoTaxis experiment");
            // Utility.Log("Loading: " + popFileLoadPath);
        }
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        Generation = _ea.CurrentGeneration;


        var evoSpeed = timeScale;

        //   Time.fixedDeltaTime = 0.045f;
        Time.timeScale = evoSpeed;
        _ea.StartContinue();
        EARunning = true;
    }
Exemplo n.º 10
0
    public void StartEA()
    {
        Utility.DebugLog = true;
        Utility.Log("Starting PhotoTaxis experiment");
        // print("Loading: " + popFileLoadPath);
        _ea       = experiment.CreateEvolutionAlgorithm(popFileSavePath);
        startTime = DateTime.Now;

        _ea.UpdateEvent += new EventHandler(ea_UpdateEvent);
        _ea.PausedEvent += new EventHandler(ea_PauseEvent);

        //   Time.fixedDeltaTime = 0.045f;
        Time.timeScale = timeScale;
        _ea.StartContinue();
        EARunning = true;

        StreamWriter writer = new StreamWriter(SaveFileName + "_testResults.csv", true);

        writer.WriteLine();
        writer.WriteLine("Started");
        writer.WriteLine("Generation,Max Fitness,Mean Fitness");
        writer.Close();
    }