コード例 #1
0
        public static void ChangeArterialVolume(ref ArterialData Arterial, float analysisDirectionDemandVol = 800)
        {
            float minorStreetVolumeRatio = 0.75f;
            float leftTurningPctInt      = 0.12f;
            float rightTurningPctInt     = 0.12f;

            float[] demandVolumesLeft  = { analysisDirectionDemandVol *leftTurningPctInt, analysisDirectionDemandVol *leftTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *leftTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *leftTurningPctInt };
            float[] demandVolumesThru  = { analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)), analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)), minorStreetVolumeRatio *analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)), minorStreetVolumeRatio *analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)) };
            float[] demandVolumesRight = { analysisDirectionDemandVol *rightTurningPctInt, analysisDirectionDemandVol *rightTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *rightTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *rightTurningPctInt };

            foreach (SegmentData Segment in Arterial.Segments)
            {
                foreach (ApproachData Approach in Segment.Intersection.Approaches)
                {
                    int   travelDirectionIndex = (int)Approach.Dir;
                    float totalDemand          = demandVolumesLeft[travelDirectionIndex] + demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex];
                    Approach.DemandVolume  = totalDemand;
                    Approach.PctLeftTurns  = (demandVolumesLeft[travelDirectionIndex] / totalDemand) * 100;
                    Approach.PctRightTurns = (demandVolumesRight[travelDirectionIndex] / totalDemand) * 100;

                    foreach (LaneGroupData LaneGroup in Approach.LaneGroups)
                    {
                        if (LaneGroup.Type == LaneMovementsAllowed.LeftOnly)
                        {
                            LaneGroup.DischargeVolume              = demandVolumesLeft[travelDirectionIndex];
                            LaneGroup.DemandVolumeVehPerHr         = demandVolumesLeft[travelDirectionIndex];
                            LaneGroup.DemandVolumeVehPerHrSplit[0] = LaneGroup.DemandVolumeVehPerHr;
                        }
                        if (LaneGroup.Type == LaneMovementsAllowed.ThruRightShared)
                        {
                            LaneGroup.DischargeVolume              = demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex];
                            LaneGroup.DemandVolumeVehPerHr         = demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex];
                            LaneGroup.PctRightTurns                = demandVolumesRight[travelDirectionIndex] / (demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex]) * 100;
                            LaneGroup.DemandVolumeVehPerHrSplit[1] = demandVolumesThru[travelDirectionIndex];
                            LaneGroup.DemandVolumeVehPerHrSplit[2] = demandVolumesRight[travelDirectionIndex];
                        }
                        LaneGroup.AnalysisFlowRate = LaneGroup.CalcAnalysisFlowRate(LaneGroup.DemandVolumeVehPerHr, LaneGroup.PeakHourFactor);
                    }
                }
            }
        }
コード例 #2
0
        public static void ChangeArterialVolume(ref ArterialData Arterial, float analysisDirectionDemandVol = 800)
        {
            float minorStreetVolumeRatio       = 0.75f;
            float midSegVolumeRatio            = 0.5f;
            float midSegAnalysisDirVolumeRatio = 0.1276f;
            float leftTurningPctInt            = 0.1f;     // 0.125f
            float rightTurningPctInt           = 0.1f;     // 0.125f
            float leftTurningPctAP             = 1f / 20f; // 0.125f
            float rightTurningPctAP            = 1f / 20f; // 0.125f

            float[] demandVolumesLeft     = { analysisDirectionDemandVol *leftTurningPctInt, analysisDirectionDemandVol *leftTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *leftTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *leftTurningPctInt };
            float[] demandVolumesThru     = { analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)), analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)), minorStreetVolumeRatio *analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)), minorStreetVolumeRatio *analysisDirectionDemandVol *(1 - (leftTurningPctInt + rightTurningPctInt)) };
            float[] demandVolumesRight    = { analysisDirectionDemandVol *rightTurningPctInt, analysisDirectionDemandVol *rightTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *rightTurningPctInt, minorStreetVolumeRatio *analysisDirectionDemandVol *rightTurningPctInt };
            float   EBApproachAccessPoint = demandVolumesThru[0] + demandVolumesRight[2] + demandVolumesLeft[3];
            float   WBApproachAccessPoint = demandVolumesThru[1] + demandVolumesRight[3] + demandVolumesLeft[2];                                                                                      // The + 20 needs to be investigated

            float[] demandVolumesAP1EB = { leftTurningPctAP *EBApproachAccessPoint, (1 - (leftTurningPctAP + rightTurningPctAP)) * EBApproachAccessPoint, rightTurningPctAP *EBApproachAccessPoint }; // EBT + NBR + SBL EWNS
            float[] demandVolumesAP1WB = { leftTurningPctAP *WBApproachAccessPoint, (1 - (leftTurningPctAP + rightTurningPctAP)) * WBApproachAccessPoint, rightTurningPctAP *WBApproachAccessPoint }; // WBT + NBL + SBR
            float[] demandVolumesAP1NB = { midSegVolumeRatio *midSegAnalysisDirVolumeRatio *WBApproachAccessPoint, 0, (1 - midSegVolumeRatio) * midSegAnalysisDirVolumeRatio * EBApproachAccessPoint };
            float[] demandVolumesAP1SB = { (1 - midSegVolumeRatio) * midSegAnalysisDirVolumeRatio * EBApproachAccessPoint, 0, midSegVolumeRatio *midSegAnalysisDirVolumeRatio *WBApproachAccessPoint };

            EBApproachAccessPoint = demandVolumesAP1EB[1] + demandVolumesAP1NB[2] + demandVolumesAP1SB[0];                                                                                            // The + 20 needs to be investigated
            WBApproachAccessPoint = demandVolumesThru[1] + demandVolumesRight[3] + demandVolumesLeft[2];
            float[] demandVolumesAP2EB = { leftTurningPctAP *EBApproachAccessPoint, (1 - (leftTurningPctAP + rightTurningPctAP)) * EBApproachAccessPoint, rightTurningPctAP *EBApproachAccessPoint }; // EBT + NBR + SBL EWNS
            float[] demandVolumesAP2WB = { leftTurningPctAP *WBApproachAccessPoint, (1 - (leftTurningPctAP + rightTurningPctAP)) * WBApproachAccessPoint, rightTurningPctAP *WBApproachAccessPoint }; // WBT + NBL + SBR
            float[] demandVolumesAP2NB = { midSegVolumeRatio *midSegAnalysisDirVolumeRatio *WBApproachAccessPoint, 0, (1 - midSegVolumeRatio) * midSegAnalysisDirVolumeRatio * EBApproachAccessPoint };
            float[] demandVolumesAP2SB = { (1 - midSegVolumeRatio) * midSegAnalysisDirVolumeRatio * EBApproachAccessPoint, 0, midSegVolumeRatio *midSegAnalysisDirVolumeRatio *WBApproachAccessPoint };


            float[] demandVolumesAP1 = { demandVolumesAP1EB[0], demandVolumesAP1EB[1], demandVolumesAP1EB[2],
                                         demandVolumesAP1WB[0], demandVolumesAP1WB[1], demandVolumesAP1WB[2],
                                         demandVolumesAP1NB[0], demandVolumesAP1NB[1], demandVolumesAP1NB[2],
                                         demandVolumesAP1SB[0], demandVolumesAP1SB[1], demandVolumesAP1SB[2], };

            float[] demandVolumesAP2 = { demandVolumesAP2EB[0], demandVolumesAP2EB[1], demandVolumesAP2EB[2],
                                         demandVolumesAP2WB[0], demandVolumesAP2WB[1], demandVolumesAP2WB[2],
                                         demandVolumesAP2NB[0], demandVolumesAP2NB[1], demandVolumesAP2NB[2],
                                         demandVolumesAP2SB[0], demandVolumesAP2SB[1], demandVolumesAP2SB[2], };

            foreach (SegmentData Segment in Arterial.Segments)
            {
                Segment.Link.AccessPoints[0].Volume = demandVolumesAP1;
                Segment.Link.AccessPoints[1].Volume = demandVolumesAP2;
                foreach (ApproachData Approach in Segment.Intersection.Approaches)
                {
                    int   travelDirectionIndex = (int)Approach.Dir;
                    float totalDemand          = demandVolumesLeft[travelDirectionIndex] + demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex];
                    Approach.DemandVolume  = totalDemand;
                    Approach.PctLeftTurns  = (demandVolumesLeft[travelDirectionIndex] / totalDemand) * 100;
                    Approach.PctRightTurns = (demandVolumesRight[travelDirectionIndex] / totalDemand) * 100;

                    foreach (LaneGroupData LaneGroup in Approach.LaneGroups)
                    {
                        if (LaneGroup.Type == LaneMovementsAllowed.LeftOnly)
                        {
                            LaneGroup.DischargeVolume      = demandVolumesLeft[travelDirectionIndex];
                            LaneGroup.DemandVolumeVehPerHr = demandVolumesLeft[travelDirectionIndex];
                        }
                        if (LaneGroup.Type == LaneMovementsAllowed.ThruRightShared)
                        {
                            LaneGroup.DischargeVolume      = demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex];
                            LaneGroup.DemandVolumeVehPerHr = demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex];
                            LaneGroup.PctRightTurns        = demandVolumesRight[travelDirectionIndex] / (demandVolumesThru[travelDirectionIndex] + demandVolumesRight[travelDirectionIndex]) * 100;
                        }
                        LaneGroup.AnalysisFlowRate = LaneGroup.CalcAnalysisFlowRate(LaneGroup.DemandVolumeVehPerHr, LaneGroup.PeakHourFactor);
                    }
                }
            }
        }