Пример #1
0
        /// <summary>
        /// Fits the equivalent circuit.
        /// </summary>
        /// <param name="circuitModel">The circuit model.</param>
        /// <param name="fitOptions">The fit options.</param>
        /// <param name="fitProgress">The fit progress.</param>
        /// <returns></returns>
        /// <exception cref="Exception">
        /// Wait untill SimpleCurve is finished before detecting peaks
        /// or
        /// No impedimetric readings available in parent SimpleMeasurement
        /// or
        /// The circuit model must be defined
        /// </exception>
        public async Task <FitResult> FitEquivalentCircuit(CircuitModel circuitModel, FitOptionsCircuit fitOptions = null, FitProgress fitProgress = null)
        {
            if (!IsFinished)
            {
                throw new Exception("Wait untill SimpleCurve is finished before detecting peaks");
            }
            if (_simpleMeasurement.Measurement.nEISdata == 0)
            {
                throw new Exception("No impedimetric readings available in parent SimpleMeasurement");
            }
            if (circuitModel == null)
            {
                throw new Exception("The circuit model must be defined");
            }

            if (fitOptions == null)
            {
                fitOptions         = new FitOptionsCircuit();
                fitOptions.Model   = circuitModel;
                fitOptions.RawData = _simpleMeasurement.Measurement.EISdata[0];
            }

            FitAlgorithm fit = FitAlgorithm.FromAlgorithm(fitOptions);

            return(await fit.ApplyFitCircuitAsync(fitProgress));
        }
Пример #2
0
        // Constructor
        public Parameters(
            CluVRPVersion CluVRP_Version,
            int CluVRP_GRASPIterations,
            int CluVRP_LS_Main_Iterations,
            int CluVRP_LS_SwapClusters,
            int CluVRP_LS_SwapVehicle,
            int Cluster_GRASPIterations,
            double Cluster_AlphaCapacity,
            double Cluster_AlphaDistance,
            FitAlgorithm Cluster_FitAlgoritm,
            int[] Cluster_LS_Order,
            int Cluster_LS_SwapVehicle,
            int Cluster_LS_InsertVehicle,
            int Cluster_LS_SwapClusters,
            //int Cluster_LS_RndSwapVehicle,
            //int Cluster_LS_RndInsertVehicle,
            int Cluster_LS_TwoOpt_Iterations,
            int Cluster_LS_Relocate_Iterations,
            int Cluster_LS_Exchange_Iterations,
            int Customer_GRASPIterations,
            double Customer_Alpha,
            int[] Customer_LS_Order,
            int Customer_LS_SwapCustomers,
            int Customer_LS_TwoOpt_Iterations,
            int Customer_LS_Relocate_Iterations,
            int Customer_LS_Exchange_Iterations)
        {
            // CluVRP
            this.CluVRP_Version            = CluVRP_Version;
            this.CluVRP_GRASPIterations    = CluVRP_GRASPIterations;
            this.CluVRP_LS_Main_Iterations = CluVRP_LS_Main_Iterations;
            this.CluVRP_LS_SwapClusters    = CluVRP_LS_SwapClusters;
            this.CluVRP_LS_SwapVehicle     = CluVRP_LS_SwapVehicle;

            // Cluster Level
            this.Cluster_GRASPIterations  = Cluster_GRASPIterations;
            this.Cluster_AlphaCapacity    = Cluster_AlphaCapacity;
            this.Cluster_AlphaDistance    = Cluster_AlphaDistance;
            this.Cluster_FitAlgoritm      = Cluster_FitAlgoritm;
            this.Cluster_LS_Order         = Cluster_LS_Order;
            this.Cluster_LS_SwapVehicle   = Cluster_LS_SwapVehicle;
            this.Cluster_LS_InsertVehicle = Cluster_LS_InsertVehicle;
            this.Cluster_LS_SwapClusters  = Cluster_LS_SwapClusters;
            //this.CluVRP_LS_SwapClusters = Cluster_LS_RndSwapVehicle;
            //this.CluVRP_LS_SwapVehicle = Cluster_LS_RndInsertVehicle;
            this.Cluster_LS_TwoOpt_Iterations   = Cluster_LS_TwoOpt_Iterations;
            this.Cluster_LS_Relocate_Iterations = Cluster_LS_Relocate_Iterations;
            this.Cluster_LS_Exchange_Iterations = Cluster_LS_Exchange_Iterations;
            this.Customer_GRASPIterations       = Customer_GRASPIterations;

            // Customer Level
            this.Customer_Alpha                  = Customer_Alpha;
            this.Customer_LS_Order               = Customer_LS_Order;
            this.Customer_LS_SwapCustomers       = Customer_LS_SwapCustomers;
            this.Customer_LS_TwoOpt_Iterations   = Customer_LS_TwoOpt_Iterations;
            this.Customer_LS_Relocate_Iterations = Customer_LS_Relocate_Iterations;
            this.Customer_LS_Exchange_Iterations = Customer_LS_Exchange_Iterations;
        }