Пример #1
0
    void onNewTopologyLoaded(SavedTopologyData savedTopologyData)
    {
        if (savedTopologyData != null && savedTopologyData.TopologyData != null && savedTopologyData.CarSimpleData != null)
        {
            NetworkTopologySimpleData newTopology = savedTopologyData.TopologyData;
            geneticsManager.SetNetworkTopology(newTopology);
            geneticsManager.ResetSimulation();
            geneticsManager.SetNewCars(savedTopologyData.CarSimpleData);
            geneticsManager.ResetCars();
            geneticsManager.ActivateCars();

            geneticsUIController.RefreshViews();
        }
    }
Пример #2
0
    void onTrainingFinishedPopupClosed(bool confirmed)
    {
        if (confirmed)
        {
            int carsCount                 = geneticsManager.CarsCount;
            List <CarSimpleData> cars     = new List <CarSimpleData> ();
            CarSimpleData        template = car.GetCarSimpleData();

            for (int i = 0; i < carsCount; i++)
            {
                cars.Add(template.GetCopy());
            }

            geneticsManager.SetNewCars(cars);
        }
        else
        {
        }
    }