public override IOperation InstrumentedApply()
        {
            int          maxIterations = MaximumIterationsParameter.ActualValue.Value;
            AlbaEncoding solution      = null;

            if (VRPToursParameter.ActualValue is AlbaEncoding)
            {
                solution = VRPToursParameter.ActualValue as AlbaEncoding;
            }
            else
            {
                VRPToursParameter.ActualValue = solution = AlbaEncoding.ConvertFrom(VRPToursParameter.ActualValue, ProblemInstance);
            }

            int     lambda  = LambdaParameter.Value.Value;
            int     samples = SampleSizeParameter.Value.Value;
            IRandom random  = RandomParameter.ActualValue;

            double quality = QualityParameter.ActualValue.Value;
            int    evaluatedSolutions;

            Apply(solution, maxIterations, lambda, samples, random, ProblemInstance, ref quality, out evaluatedSolutions);

            EvaluatedSolutionsParameter.ActualValue.Value += evaluatedSolutions;
            QualityParameter.ActualValue.Value             = quality;

            return(base.InstrumentedApply());
        }
Пример #2
0
        public override IOperation InstrumentedApply()
        {
            //choose default encoding here
            VRPToursParameter.ActualValue = AlbaEncoding.ConvertFrom(CreateSolution(), ProblemInstance);

            return(base.InstrumentedApply());
        }
Пример #3
0
        public override IOperation InstrumentedApply()
        {
            ItemArray <IVRPEncoding> parents = new ItemArray <IVRPEncoding>(ParentsParameter.ActualValue.Length);

            for (int i = 0; i < ParentsParameter.ActualValue.Length; i++)
            {
                IVRPEncoding solution = ParentsParameter.ActualValue[i];

                if (!(solution is AlbaEncoding))
                {
                    parents[i] = AlbaEncoding.ConvertFrom(solution, ProblemInstance);
                }
                else
                {
                    parents[i] = solution;
                }
            }
            ParentsParameter.ActualValue = parents;

            ChildParameter.ActualValue =
                Crossover(RandomParameter.ActualValue, parents[0] as AlbaEncoding, parents[1] as AlbaEncoding);
            (ChildParameter.ActualValue as AlbaEncoding).Repair();

            return(base.InstrumentedApply());
        }
Пример #4
0
        public override IOperation InstrumentedApply()
        {
            IVRPEncoding solution = VRPToursParameter.ActualValue;

            if (!(solution is AlbaEncoding))
            {
                VRPToursParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, ProblemInstance);
            }

            return(base.InstrumentedApply());
        }
Пример #5
0
        public override IOperation InstrumentedApply()
        {
            IVRPEncoding solution = VRPToursParameter.ActualValue;

            if (!(solution is AlbaEncoding))
            {
                VRPToursParameter.ActualValue = AlbaEncoding.ConvertFrom(solution, ProblemInstance);
            }

            Manipulate(RandomParameter.ActualValue, VRPToursParameter.ActualValue as AlbaEncoding);
            (VRPToursParameter.ActualValue as AlbaEncoding).Repair();

            return(base.InstrumentedApply());
        }