In most cases, a single cost function is not sufficient to generate complex vehicle behavior. In this quiz we want you to implement more cost functions in C++. We will use these two C++ cost functions later in this lesson. The goal of this quiz is to create a cost function that drives the vehicle in the fastest lane, given several behavioral options. We will provide the following four inputs to the function:
- Target Speed: Currently set to 10 (unitless), the speed at which you want the vehicle to travel.
- Scheduled Lanes: Scheduled lanes for a given behavior. For PLCR, PLCL, LCR and LCL, this will be one lane of the current lane.
- Last Lane: The final lane for a given behavior. For LCR and LCL this will be one channel.
- Lane speed vector based on the amount of traffic in this lane: {6,7,8,9}.
Your task in the implementation is to create a cost function that satisfies the following conditions:
- Costs are reduced because both the scheduled and final lanes are high-speed lanes.
- The cost function provides a different cost for each possible behavior: KL, PLCR/PLCL, LCR/LCL.
- The cost function produces values in the range 0 to 1.