Beispiel #1
0
        public override void FromStorage(Storage.Storage storage, Storage.Records.Optimizer optimizer, Storage.Records.Solution solution, Optimization.Solution sol)
        {
            base.FromStorage(storage, optimizer, solution, sol);

            if (d_loadingFromStorage)
            {
                return;
            }

            // Add some protection because we don't want to recursively load the best particle
            d_loadingFromStorage = true;

            Storage.Records.Solution best = storage.ReadSolution(-1, (int)sol.Id);
            Particle particle             = (Particle)sol;

            if (best != null)
            {
                Solution b = CreateSolution((uint)best.Index);
                FromStorage(storage, optimizer, best, b);

                particle.PersonalBest = (Particle)b;
            }
            else
            {
                particle.PersonalBest = null;
            }

            d_loadingFromStorage = false;
        }
        public override void FromStorage(Storage.Storage storage, Storage.Records.Optimizer optimizer, Storage.Records.Solution solution)
        {
            base.FromStorage(storage, optimizer, solution);

            d_bounced = uint.Parse((string)Data["bounced"]);
        }
Beispiel #3
0
        public override void FromStorage(Storage.Storage storage, Storage.Records.Optimizer optimizer, Storage.Records.Solution solution)
        {
            base.FromStorage(storage, optimizer, solution);

            VelocityFromData();
        }