コード例 #1
0
        public double TotalSpeed(ushort laneGroupMask, LaneStatus status)
        {
            double total = 0.0F;

            GetLanesByLaneMask(laneGroupMask, status).ForEach(lane => { total += lane.Speed; });
            return(total);
        }
コード例 #2
0
        public double TotalSpeed(char laneGroup, LaneStatus status)
        {
            double total = 0.0F;

            GetLanesByLegacyLaneGroup(laneGroup, status).ForEach(lane => { total += lane.Speed; });
            return(total);
        }
コード例 #3
0
        public double AverageSpeed(ushort laneGroupMask, LaneStatus status)
        {
            double average = 0.0F;
            int    count   = 0;

            GetLanesByLaneMask(laneGroupMask, status).ForEach(lane => { average += lane.Speed; ++count; });
            return(average / count);
        }
コード例 #4
0
        public double AverageDensity(char laneGroup, LaneStatus status)
        {
            double average = 0.0F;
            int    count   = 0;

            GetLanesByLegacyLaneGroup(laneGroup, status).ForEach(lane => { average += lane.Density; ++count; });
            return(average / count);
        }
コード例 #5
0
        public double LowestDensity(char laneGroup, LaneStatus status)
        {
            double lowest = 0.0F;

            GetLanesByLegacyLaneGroup(laneGroup, status).ForEach(lane => { if (lane.Density < lowest)
                                                                           {
                                                                               lowest = lane.Density;
                                                                           }
                                                                 });
            return(lowest);
        }
コード例 #6
0
        public double LowestDensity(ushort laneGroupMask, LaneStatus status)
        {
            double lowest = 0.0F;

            GetLanesByLaneMask(laneGroupMask, status).ForEach(lane => { if (lane.Density < lowest)
                                                                        {
                                                                            lowest = lane.Density;
                                                                        }
                                                              });
            return(lowest);
        }
コード例 #7
0
        public double HighestDensity(char laneGroup, LaneStatus status)
        {
            double highest = 0.0F;

            GetLanesByLegacyLaneGroup(laneGroup, status).ForEach(lane => { if (lane.Density > highest)
                                                                           {
                                                                               highest = lane.Density;
                                                                           }
                                                                 });
            return(highest);
        }
コード例 #8
0
        public double HighestDensity(ushort laneGroupMask, LaneStatus status)
        {
            double highest = 0.0F;

            GetLanesByLaneMask(laneGroupMask, status).ForEach(lane => { if (lane.Density > highest)
                                                                        {
                                                                            highest = lane.Density;
                                                                        }
                                                              });
            return(highest);
        }
コード例 #9
0
        public double TotalDataBin(char legacyLaneGroup, LaneStatus status, DataBinType binType)
        {
            double total = 0;

            GetLanesByLegacyLaneGroup(legacyLaneGroup, status).ForEach(lane =>
            {
                foreach (DataBin db in lane.DataBins.Values.Where(db => db.BinType.Equals(binType)))
                {
                    total += db.BinValue;
                }
                ;
            });
            return(total);
        }
コード例 #10
0
        public double AverageDataBin(char legacyLaneGroup, LaneStatus status, DataBinType binType)
        {
            double total = 0;
            double count = 0;

            GetLanesByLegacyLaneGroup(legacyLaneGroup, status).ForEach(lane =>
            {
                foreach (DataBin db in lane.DataBins.Values.Where(db => db.BinType.Equals(binType)))
                {
                    total += db.BinValue;
                }
                ;
                ++count;
            });
            if (total == 0 || count == 0)
            {
                return(total);
            }
            return(total / count);
        }
コード例 #11
0
 public List <Lane> GetLanesByLegacyLaneGroup(char legacyLaneGroup, LaneStatus laneStatus)
 {
     return(Lanes.Where(lane => lane.LaneStatus.Equals(laneStatus) && (lane.LegacyLaneGroup.Equals(legacyLaneGroup))).ToList());
 }
コード例 #12
0
 public List <Lane> GetLanesByLaneMask(ushort laneMask, LaneStatus laneStatus)
 {
     return(Lanes.Where(lane => lane.LaneStatus.Equals(laneStatus) && (lane.LaneGroup & laneMask) > 0).ToList());
 }
コード例 #13
0
 public IEnumerator <Lane> GetEnumerator(ushort laneGroup, LaneStatus status)
 {
     return(GetLanesByLaneMask(laneGroup, status).GetEnumerator());
 }
コード例 #14
0
 public IEnumerator <Lane> GetEnumerator(char legacyLaneGroup, LaneStatus status)
 {
     return(GetLanesByLegacyLaneGroup(legacyLaneGroup, status).GetEnumerator());
 }
コード例 #15
0
 /// <summary>
 /// The Count of all Lane Objects in the collection
 /// </summary>
 /// <param name="laneMask"></param>
 /// <returns>The count of lanes which match the given laneMask</returns>
 public int LaneCount(ushort laneMask, LaneStatus status)
 {
     return(GetLanesByLaneMask(laneMask, status).Count);
 }
コード例 #16
0
 /// <summary>
 /// The Count of all Lane Objects in the collection
 /// </summary>
 /// <param name="legacyLaneGroup"></param>
 /// <returns>The count of lanes which match the given legacyLaneGroup</returns>
 public int LaneCount(char legacyLaneGroup, LaneStatus status)
 {
     return(GetLanesByLegacyLaneGroup(legacyLaneGroup, status).Count);
 }