Пример #1
0
        public void PrintSummary()
        {
            using (StreamWriter generalGeometrySummary = new StreamWriter(Directory + Globals.TextFiles.GeneralGoemetrySummary, false))
            {
                generalGeometrySummary.WriteLine("S1\tS2\tS3\tS4\tG1\tG2\tG3\tG4\tG5\tG6\tG7\tG8\tG9\tG10\tG11\tO1\tO2\tO3\tO4\tO5\tOL\tOP\tHL\tHP\tBL1\tBL\tBL2\tBP2\tBP\tBP1\tWL\tWP\tPL\tPP");

                generalGeometrySummary.WriteLine(string.Format("{0:0.000}\t{1:0.000}\t{2:0.000}\t{3:0.000}", Superstructure.ParametersMap.get_Item("S1").AsDouble(), Superstructure.ParametersMap.get_Item("S2").AsDouble(), Superstructure.ParametersMap.get_Item("S3").AsDouble(), Superstructure.ParametersMap.get_Item("S4").AsDouble()) +

                                                 string.Format("\t{0:0.000}\t{1:0.000}\t{2:0.000}\t{3:0.000}\t{4:0.000}\t{5:0.000}\t{6:0.000}\t{7:0.000}\t{8:0.000}\t{9:0.000}\t{10:0.000}",
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G1").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G2").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G3").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G4").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G5").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G6").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G7").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G8").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G9").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G10").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("G11").AsDouble())) +

                                                 string.Format("\t{0:0.000}\t{1:0.000}\t{2:0.000}\t{3:0.000}\t{4:0.000}",
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("O1").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("O2").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("O3").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("O4").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("O5").AsDouble())) +

                                                 string.Format("\t{0:0.000}\t{1:0.000}\t{2:0.000}\t{3:0.000}\t{4:0.000}\t{5:0.000}\t{6:0.000}\t{7:0.000}\t{8:0.000}\t{9:0.000}",
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("OL").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("OP").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("HL").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("HP").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("BL1").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("BL").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("BL2").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("BP2").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("BP").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("BP1").AsDouble())) +

                                                 string.Format("\t{0:0.000}\t{1:0.000}\t{2:0.000}\t{3:0.000}",
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("WL").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("WP").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("PL").AsDouble()),
                                                               Converters.ToMeters(Superstructure.ParametersMap.get_Item("PP").AsDouble())));

                generalGeometrySummary.WriteLine("\nCross-section (SCR):");
                generalGeometrySummary.WriteLine(ToScr());
                generalGeometrySummary.WriteLine("\nLeft girder, cross-section (SCR):");
                generalGeometrySummary.WriteLine(LeftGirderCrossSection.ToScr());
                generalGeometrySummary.WriteLine("\nRight girder, cross-section (SCR):");
                generalGeometrySummary.WriteLine(RightGirderCrossSection.ToScr());
            }
        }
Пример #2
0
        private List <Point> GetFrontalVertices(Element element, double?additionalDivision = null)
        {
            List <Point> contourPoints = new List <Point>();
            Face         frontalFace   = GetFrontalFace(element);

            if (frontalFace == null)
            {
                return(contourPoints);
            }

            foreach (EdgeArray edges in frontalFace.EdgeLoops)
            {
                foreach (Edge edge in edges)
                {
                    contourPoints.Add(new Point(Math.Round(Converters.ToMeters(edge.AsCurve().GetEndPoint(0).Y), 8), Math.Round(Converters.ToMeters(edge.AsCurve().GetEndPoint(0).Z), 8)));
                    contourPoints.Add(new Point(Math.Round(Converters.ToMeters(edge.AsCurve().GetEndPoint(1).Y), 8), Math.Round(Converters.ToMeters(edge.AsCurve().GetEndPoint(1).Z), 8)));
                }
            }
            contourPoints.Add(contourPoints.First());

            if (additionalDivision != null)
            {
                for (int i = contourPoints.Count() - 2; i >= 0; i--)
                {
                    if (contourPoints[i].X == contourPoints[i + 1].X)
                    {
                        continue;
                    }
                    else if (contourPoints[i].X > contourPoints[i + 1].X)
                    {
                        if ((contourPoints[i].X >= additionalDivision) && (contourPoints[i + 1].X <= additionalDivision))
                        {
                            double y = contourPoints[i].Y + ((double)additionalDivision - contourPoints[i].X) * (contourPoints[i + 1].Y - contourPoints[i].Y) / (contourPoints[i + 1].X - contourPoints[i].X);
                            contourPoints.Insert(i + 1, new Point((double)additionalDivision, y));
                        }
                    }
                    else
                    {
                        if ((contourPoints[i].X <= additionalDivision) && (contourPoints[i + 1].X >= additionalDivision))
                        {
                            double y = contourPoints[i].Y + ((double)additionalDivision - contourPoints[i].X) * (contourPoints[i + 1].Y - contourPoints[i].Y) / (contourPoints[i + 1].X - contourPoints[i].X);
                            contourPoints.Insert(i + 1, new Point((double)additionalDivision, y));
                        }
                    }
                }
            }
            contourPoints.RemoveAt(contourPoints.Count() - 1);
            contourPoints = contourPoints.Distinct().ToList();
            return(contourPoints);
        }
Пример #3
0
        public OptimizationCase(PhysicalBridge bridge)
        {
            foreach (string parameter in Enum.GetNames(typeof(Symbols)))
            {
                Parameters.Add(Converters.ToMeters(bridge.Superstructure.ParametersMap.get_Item(parameter).AsDouble()));
            }
            Boundaries = new OptimizationRules();

            foreach (int i in Enum.GetValues(typeof(Symbols)))
            {
                Boundaries.Min[i] = Parameters[i];
                Boundaries.Max[i] = Parameters[i];
            }
        }
Пример #4
0
        public PhysicalBridge(ExternalCommandData commandData)
        {
            CommandData = commandData;
            FilteredElementCollector collector = new FilteredElementCollector(commandData.Application.ActiveUIDocument.Document).WhereElementIsNotElementType();

            foreach (Element element in collector)
            {
                if ((element.Category != null) && element.Category.HasMaterialQuantities)
                {
                    Elements.Add(element);
                }
            }
            Superstructure = FindSuperstructure();
            Cover          = 40;

            //Dividing cross section contour into two parts:
            double divisionAxle = 0.5 * Converters.ToMeters(Superstructure.ParametersMap.get_Item("OL").AsDouble() + Superstructure.ParametersMap.get_Item("OP").AsDouble());

            SuperstructureCrossSection = GetFrontalVertices(Superstructure, divisionAxle);

            if (SuperstructureCrossSection.Count > 0)
            {
                List <Point> leftGirderPoints  = new List <Point>();
                List <Point> rightGirderPoints = new List <Point>();

                foreach (Point crossSectionPoint in SuperstructureCrossSection)
                {
                    if (Math.Round(crossSectionPoint.X - divisionAxle, 8) <= 0.0)
                    {
                        leftGirderPoints.Add(new Point(crossSectionPoint.X, crossSectionPoint.Y));
                    }
                    if (Math.Round(crossSectionPoint.X - divisionAxle, 8) >= 0.0)
                    {
                        rightGirderPoints.Add(new Point(crossSectionPoint.X, crossSectionPoint.Y));
                    }
                }
                if (leftGirderPoints.First() == leftGirderPoints.Last())
                {
                    leftGirderPoints.RemoveAt(leftGirderPoints.Count() - 1);
                }
                if (rightGirderPoints.First() == rightGirderPoints.Last())
                {
                    rightGirderPoints.RemoveAt(rightGirderPoints.Count() - 1);
                }

                LeftGirderCrossSection  = new CrossSection(leftGirderPoints);
                RightGirderCrossSection = new CrossSection(rightGirderPoints);

                LeftGirderCrossSection.Height = Converters.ToMeters(Superstructure.ParametersMap.get_Item("HL").AsDouble());
                LeftGirderCrossSection.Width  = Converters.ToMeters(Superstructure.ParametersMap.get_Item("BL").AsDouble());
                LeftGirderCrossSection.LeftCantileverOverhang  = Converters.ToMeters(Superstructure.ParametersMap.get_Item("OL").AsDouble() - Superstructure.ParametersMap.get_Item("BL1").AsDouble() - Superstructure.ParametersMap.get_Item("O1").AsDouble()) - 0.5 * LeftGirderCrossSection.Width;
                LeftGirderCrossSection.RightCantileverOverhang = divisionAxle - Converters.ToMeters(Superstructure.ParametersMap.get_Item("OL").AsDouble() + Superstructure.ParametersMap.get_Item("BL2").AsDouble()) - 0.5 * LeftGirderCrossSection.Width;

                RightGirderCrossSection.Height = Converters.ToMeters(Superstructure.ParametersMap.get_Item("HP").AsDouble());
                RightGirderCrossSection.Width  = Converters.ToMeters(Superstructure.ParametersMap.get_Item("BP").AsDouble());
                RightGirderCrossSection.LeftCantileverOverhang  = Converters.ToMeters(Superstructure.ParametersMap.get_Item("OP").AsDouble() - Superstructure.ParametersMap.get_Item("BP2").AsDouble()) - divisionAxle - 0.5 * RightGirderCrossSection.Width;
                RightGirderCrossSection.RightCantileverOverhang = Converters.ToMeters(Superstructure.ParametersMap.get_Item("O5").AsDouble() - Superstructure.ParametersMap.get_Item("OP").AsDouble() - Superstructure.ParametersMap.get_Item("BP1").AsDouble()) - 0.5 * RightGirderCrossSection.Width;

                LeftGirderCrossSection.MomentsOfInertia.IS  = CalculateTorsionConstant(LeftGirderCrossSection);
                RightGirderCrossSection.MomentsOfInertia.IS = CalculateTorsionConstant(LeftGirderCrossSection);
            }
        }
Пример #5
0
        public bool RefreshSpan(PhysicalBridge bridge)
        {
            bool     success = true;
            Document doc     = bridge.CommandData.Application.ActiveUIDocument.Document;

            using (Transaction transaction = new Transaction(doc, "Initializing individual"))
            {
                transaction.Start();

                var failureOptions = transaction.GetFailureHandlingOptions();
                failureOptions.SetFailuresPreprocessor(new DuplicateMarkSwallower());
                transaction.SetFailureHandlingOptions(failureOptions);

                string[] parameters = Enum.GetNames(typeof(Symbols));
                for (int p = 0; p < parameters.Count(); p++)
                {
                    GlobalParameter globalParameter = doc.GetElement(GlobalParametersManager.FindByName(doc, parameters[p])) as GlobalParameter;
                    if (globalParameter != null)
                    {
                        globalParameter.SetValue(new DoubleParameterValue(Converters.FromMeters(Parameters[p])));
                    }
                }

                double volume = 0.0;
                try
                {
                    volume = Converters.FromCubicMeters(bridge.Superstructure.GetMaterialVolume(bridge.Superstructure.GetMaterialIds(false).First()));
                }
                catch { success = false; };

                if (success)
                {
                    FilteredElementCollector collector = new FilteredElementCollector(doc);
                    List <Element>           levels    = collector.OfClass(typeof(Level)).ToElements().ToList();

                    if (levels.Count() > 0)
                    {
                        double O2 = Converters.ToMeters(bridge.Superstructure.ParametersMap.get_Item("O2").AsDouble());
                        double O3 = Converters.ToMeters(bridge.Superstructure.ParametersMap.get_Item("O3").AsDouble());
                        double O4 = Converters.ToMeters(bridge.Superstructure.ParametersMap.get_Item("O4").AsDouble());

                        double S1 = bridge.Superstructure.ParametersMap.get_Item("S1").AsDouble();
                        double S2 = bridge.Superstructure.ParametersMap.get_Item("S2").AsDouble();
                        double S3 = bridge.Superstructure.ParametersMap.get_Item("S3").AsDouble();
                        double S4 = bridge.Superstructure.ParametersMap.get_Item("S4").AsDouble();

                        double bearingHeight = 0.169;
                        for (int i = levels.Count() - 1; i >= 0; i--)
                        {
                            if ((levels[i].Name.Contains("Wierzch ławy podłożyskowej") == false) && (levels[i].Name.Contains("Wierzch trzonów") == false))
                            {
                                levels.RemoveAt(i);
                            }
                        }
                        if (levels.Count() > 0)
                        {
                            double zRef = O3 < 0 ? -1.0 * O3 * S3 / 100 : -1.0 * O3 * S2 / 100;

                            double zLeft;
                            if (Parameters[(int)Symbols.OL] > O2)
                            {
                                zLeft = zRef + (O3 - Parameters[(int)Symbols.OL]) * S2 / 100;
                            }
                            else
                            {
                                zLeft = zRef - (O2 - O3) * S2 / 100 + (O2 - Parameters[(int)Symbols.OL]) * S1 / 100;
                            }

                            double zRight;
                            if (Parameters[(int)Symbols.OP] < O4)
                            {
                                zRight = zRef + (O3 - Parameters[(int)Symbols.OP]) * S3 / 100;
                            }
                            else
                            {
                                zRight = zRef - (O4 - O3) * S3 / 100 + (O4 - Parameters[(int)Symbols.OP]) * S4 / 100;
                            }

                            double nominalBearingSpace = Converters.ToMeters(((doc.GetElement(GlobalParametersManager.FindByName(doc, "Nominalna wysokość przestrzeni łożyskowania")) as GlobalParameter).GetValue() as DoubleParameterValue).Value);
                            double roadLayersThickness = Converters.ToMeters(((doc.GetElement(GlobalParametersManager.FindByName(doc, "Nominalna grubość nawierzchni")) as GlobalParameter).GetValue() as DoubleParameterValue).Value);
                            double z = Math.Round((Math.Min(zLeft - Parameters[(int)Symbols.HL], zRight - Parameters[(int)Symbols.HP]) - nominalBearingSpace - roadLayersThickness) / 0.05) * 0.05;
                            foreach (Element level in levels)
                            {
                                (level as Level).Elevation = Converters.FromMeters(z);
                            }

                            GlobalParameter leftBearingAshlar  = doc.GetElement(GlobalParametersManager.FindByName(doc, "Wysokość ciosu. Dźwigar lewy")) as GlobalParameter;
                            GlobalParameter rightBearingAshlar = doc.GetElement(GlobalParametersManager.FindByName(doc, "Wysokość ciosu. Dźwigar prawy")) as GlobalParameter;
                            leftBearingAshlar.SetValue(new DoubleParameterValue(Converters.FromMeters(zLeft - Parameters[(int)Symbols.HL] - roadLayersThickness - z - bearingHeight)));
                            rightBearingAshlar.SetValue(new DoubleParameterValue(Converters.FromMeters(zRight - Parameters[(int)Symbols.HP] - roadLayersThickness - z - bearingHeight)));
                        }
                    }
                }
                transaction.Commit();
            }
            return(success);
        }
Пример #6
0
        public OptimizationCase(PhysicalBridge seed, OptimizationRules boundaries = null, Random rnd = null)
        {
            double minEdge = Converters.ToMeters(seed.Superstructure.ParametersMap.get_Item("O1").AsDouble());
            double maxEdge = Converters.ToMeters(seed.Superstructure.ParametersMap.get_Item("O5").AsDouble());

            foreach (Symbols i in Enum.GetValues(typeof(Symbols)))
            {
                Parameters.Add(0.0);
            }

            if (boundaries == null)
            {
                boundaries = new OptimizationRules(minEdge, maxEdge);
            }
            Boundaries = boundaries;

            //Case generation:
            if (rnd == null)
            {
                rnd = new Random();
            }
            Parameters[(int)Symbols.BL] = Boundaries.Min[(int)Symbols.BL] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.BL] - Boundaries.Min[(int)Symbols.BL]); Parameters[(int)Symbols.BP] = Parameters[(int)Symbols.BL];
            Parameters[(int)Symbols.HL] = Boundaries.Min[(int)Symbols.HL] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.HL] - Boundaries.Min[(int)Symbols.HL]); Parameters[(int)Symbols.HP] = Parameters[(int)Symbols.HL];

            Parameters[(int)Symbols.BL1] = Boundaries.Min[(int)Symbols.BL1] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.BL1] - Boundaries.Min[(int)Symbols.BL1]);
            Parameters[(int)Symbols.BL2] = Parameters[(int)Symbols.BL1];
            Parameters[(int)Symbols.BP1] = Parameters[(int)Symbols.BL1];
            Parameters[(int)Symbols.BP2] = Parameters[(int)Symbols.BL1];

            double totalGirderWidth = Parameters[(int)Symbols.BL] + Parameters[(int)Symbols.BL1] + Parameters[(int)Symbols.BL2];
            double minOffset, maxOffset;

            if (rnd.NextDouble() < 0.5)
            {
                minOffset = Boundaries.Min[(int)Symbols.OL] + Boundaries.MinCantileverOverhang + 0.5 * totalGirderWidth;
                maxOffset = Boundaries.Max[(int)Symbols.OL] - Boundaries.MinCantileverOverhang - totalGirderWidth - Boundaries.MinSpanLength - 0.5 * totalGirderWidth;
                Parameters[(int)Symbols.OL] = minOffset + rnd.NextDouble() * (maxOffset - minOffset);

                minOffset = Parameters[(int)Symbols.OL] + Boundaries.MinSpanLength + totalGirderWidth;
                maxOffset = Boundaries.Max[(int)Symbols.OP] - Boundaries.MinCantileverOverhang - 0.5 * totalGirderWidth;
                Parameters[(int)Symbols.OP] = minOffset + rnd.NextDouble() * (maxOffset - minOffset);
            }
            else
            {
                minOffset = Boundaries.Min[(int)Symbols.OP] + Boundaries.MinCantileverOverhang + totalGirderWidth + Boundaries.MinSpanLength + 0.5 * totalGirderWidth;
                maxOffset = Boundaries.Max[(int)Symbols.OP] - Boundaries.MinCantileverOverhang - 0.5 * totalGirderWidth;
                Parameters[(int)Symbols.OP] = minOffset + rnd.NextDouble() * (maxOffset - minOffset);

                minOffset = Boundaries.Min[(int)Symbols.OL] + Boundaries.MinCantileverOverhang + totalGirderWidth + 0.5 * totalGirderWidth;
                maxOffset = Parameters[(int)Symbols.OP] - Boundaries.MinSpanLength - totalGirderWidth;
                Parameters[(int)Symbols.OL] = minOffset + rnd.NextDouble() * (maxOffset - minOffset);
            }

            if (rnd.NextDouble() < 0.5)
            {
                Parameters[(int)Symbols.WL] = 0.000; Parameters[(int)Symbols.WP] = 0.000;
            }
            else
            {
                double cantileverOverhang = Math.Min(Parameters[(int)Symbols.OL] - minEdge, maxEdge - Parameters[(int)Symbols.OP]) - 0.5 * totalGirderWidth;
                if (cantileverOverhang > Boundaries.Max[(int)Symbols.WL])
                {
                    cantileverOverhang = Boundaries.Max[(int)Symbols.WL];
                }
                Parameters[(int)Symbols.WL] = Boundaries.Min[(int)Symbols.WL] + rnd.NextDouble() * (cantileverOverhang - Boundaries.Min[(int)Symbols.WL]);
                Parameters[(int)Symbols.WP] = Parameters[(int)Symbols.WL];
            }

            double spanLength = Parameters[(int)Symbols.OP] - Parameters[(int)Symbols.OL] - totalGirderWidth;

            Parameters[(int)Symbols.PL] = Boundaries.Min[(int)Symbols.PL] + rnd.NextDouble() * (Math.Min(0.5 * spanLength, Boundaries.Max[(int)Symbols.PL]) - Boundaries.Min[(int)Symbols.PL]);
            Parameters[(int)Symbols.PP] = Parameters[(int)Symbols.PL];

            Parameters[(int)Symbols.G1] = Boundaries.Min[(int)Symbols.G1] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.G1] - Boundaries.Min[(int)Symbols.G1]); Parameters[(int)Symbols.G11] = Parameters[(int)Symbols.G1];
            Parameters[(int)Symbols.G3] = Boundaries.Min[(int)Symbols.G3] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.G3] - Boundaries.Min[(int)Symbols.G3]); Parameters[(int)Symbols.G9] = Parameters[(int)Symbols.G3];
            if (Parameters[(int)Symbols.G3] < Parameters[(int)Symbols.G1])
            {
                Parameters[(int)Symbols.G3] = Parameters[(int)Symbols.G1];
            }
            if (Parameters[(int)Symbols.WL] == 0.000)
            {
                Parameters[(int)Symbols.G2] = Parameters[(int)Symbols.G3];
            }
            else
            {
                Parameters[(int)Symbols.G2] = Boundaries.Min[(int)Symbols.G2] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.G2] - Boundaries.Min[(int)Symbols.G2]);
                if (Parameters[(int)Symbols.G2] < Parameters[(int)Symbols.G1])
                {
                    Parameters[(int)Symbols.G2] = Parameters[(int)Symbols.G1];
                }
                if (Parameters[(int)Symbols.G2] > Parameters[(int)Symbols.G3])
                {
                    Parameters[(int)Symbols.G2] = Parameters[(int)Symbols.G3];
                }
            }
            Parameters[(int)Symbols.G10] = Parameters[(int)Symbols.G2];

            Parameters[(int)Symbols.G5] = Boundaries.Min[(int)Symbols.G5] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.G5] - Boundaries.Min[(int)Symbols.G5]);
            Parameters[(int)Symbols.G7] = Parameters[(int)Symbols.G5];
            if (Parameters[(int)Symbols.PL] == 0.000)
            {
                Parameters[(int)Symbols.G4] = Parameters[(int)Symbols.G5];
            }
            else
            {
                Parameters[(int)Symbols.G4] = Boundaries.Min[(int)Symbols.G4] + rnd.NextDouble() * (Boundaries.Max[(int)Symbols.G4] - Boundaries.Min[(int)Symbols.G4]);
                if (Parameters[(int)Symbols.G4] < Parameters[(int)Symbols.G5])
                {
                    Parameters[(int)Symbols.G4] = Parameters[(int)Symbols.G5];
                }
            }
            Parameters[(int)Symbols.G8] = Parameters[(int)Symbols.G4];
            for (int p = 0; p < Parameters.Count(); p++)
            {
                Parameters[p] = Math.Round(Math.Round(Parameters[p] / 0.0005) * 0.0005, 4);
            }
        }