| 790 | } |
| 791 | |
| 792 | double CarEstimator::CalcSegmentWeight(Segment const & segment, RoadGeometry const & road, Purpose purpose) const |
| 793 | { |
| 794 | double result = road.GetDistance(segment.GetSegmentIdx()) / GetSpeedMpS(purpose, segment, road); |
| 795 | |
| 796 | if (m_trafficStash) |
| 797 | { |
| 798 | SpeedGroup const speedGroup = m_trafficStash->GetSpeedGroup(segment); |
| 799 | ASSERT_LESS(speedGroup, SpeedGroup::Count, ()); |
| 800 | double const trafficFactor = CalcTrafficFactor(speedGroup); |
| 801 | result *= trafficFactor; |
| 802 | if (speedGroup != SpeedGroup::Unknown && speedGroup != SpeedGroup::G5) |
| 803 | { |
| 804 | // Current time estimation are too optimistic. |
| 805 | // Need more accurate tuning: traffic lights, traffic jams, road models and so on. |
| 806 | // Add some penalty to make estimation more realistic. |
| 807 | /// @todo Make accurate tuning, remove penalty. |
| 808 | result *= 1.8; |
| 809 | } |
| 810 | } |
| 811 | |
| 812 | return result; |
| 813 | } |
| 814 | |
| 815 | // EdgeEstimator ----------------------------------------------------------------------------------- |
| 816 | // static |
nothing calls this directly
no test coverage detected