public double TotalSpeed(ushort laneGroupMask, LaneStatus status) { double total = 0.0F; GetLanesByLaneMask(laneGroupMask, status).ForEach(lane => { total += lane.Speed; }); return(total); }
public double TotalSpeed(char laneGroup, LaneStatus status) { double total = 0.0F; GetLanesByLegacyLaneGroup(laneGroup, status).ForEach(lane => { total += lane.Speed; }); return(total); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public List <Lane> GetLanesByLegacyLaneGroup(char legacyLaneGroup, LaneStatus laneStatus) { return(Lanes.Where(lane => lane.LaneStatus.Equals(laneStatus) && (lane.LegacyLaneGroup.Equals(legacyLaneGroup))).ToList()); }
public List <Lane> GetLanesByLaneMask(ushort laneMask, LaneStatus laneStatus) { return(Lanes.Where(lane => lane.LaneStatus.Equals(laneStatus) && (lane.LaneGroup & laneMask) > 0).ToList()); }
public IEnumerator <Lane> GetEnumerator(ushort laneGroup, LaneStatus status) { return(GetLanesByLaneMask(laneGroup, status).GetEnumerator()); }
public IEnumerator <Lane> GetEnumerator(char legacyLaneGroup, LaneStatus status) { return(GetLanesByLegacyLaneGroup(legacyLaneGroup, status).GetEnumerator()); }
/// <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); }
/// <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); }