Tolls, POIs, and Hours of Service
Contents
If the Tolls add-on feature is licensed and installed, there are five PC*Miler Connect functions that support toll calculations. A sixth function, PCMSSetVehicleConfig, enables toll cost calculation with custom vehicle dimensions and number of axles taken into account.
Once the toll information and optional vehicle information have been passed in, the routing results can be retrieved using the standard PCMSGetRpt and PCMSGetRptLine APIs.
- PCMSSetTollMode sets whether no tolls are calculated; tolls are to be calculated on an all-cash basis; or discount programs are to be used in toll calculations during a trip. By default, toll discount programs are enabled.
- PCMSGetToll requests the total toll charges for the trip.
- PCMSNumTollDiscounts returns the number of available toll discount programs.
- PCMSGetTollDiscountName retrieves the available toll discount program name by index value.
- PCMSGetTollBreakdown gets the toll amount attributable to a particular discount program.
The following sample code demonstrates the use of most of the toll functions:
void Test_tolls(PCMServerID serv)
{
Trip trip1;
int i, numPrograms;
float miles;
float TollsTotal, programTolls;
char programName[20];
/* create a new trip */
trip1 = PCMSNewTrip(server);
/* run a route */
miles = PCMSCalcTrip(trip1, "New York, NY", "Washington, DC") / 10.0;
printf("Total mileage = %.1f miles\n", miles);
/* get total tolls on all-cash basis */
PCMSSetTollMode(trip1, TOLL_CASH);
TollsTotal = PCMSGetToll(trip1) / 100.0;
printf("All-cash tolls = $%.2f\n", TollsTotal);
/* get total tolls using discount programs */
PCMSSetTollMode(trip1, TOLL_DISCOUNT);
TollsTotal = PCMSGetToll(trip1) / 100.0;
printf("Discounted tolls = $%.2f\n", TollsTotal);
/* get breakdown of tolls by cash part (i=0) and each discount program */
PCMSSetTollMode(trip1, TOLL_DISCOUNT);
numPrograms = PCMSNumTollDiscounts(server);
for (i = 0; i < numPrograms; ++i)
{
PCMSGetTollDiscountName(server, i, programName, 20);
programTolls = PCMSGetTollBreakdown(trip1, i, " ") / 100.0;
printf("%s Tolls = $%.2f\n", programName, programTolls);
}
/* delete the trip */
}
POIs
PC*Miler Connect can be used to search for points of interest (POIs), including fuel stops, along a route. (Streets add-on for U.S. Streets must be licensed and installed.)
In addition to locating POIs, the following APIs can be used as part of a toolbox for creating an Hours of Service (HOS) management system, in conjunction with the Hours of Service APIs:
- PCMSGetNumFPARPOICategories gets the number of POI categories available for use in find POIs along a route (FPAR) searches.
- PCMSGetFPARPOICategoryName gets the name of a specific FPAR POI category based on an index value.
- PCMSFindPOIsAlongRoute finds POIs that are along the specified route.
- PCMSFindPOIsAlongRoute2 finds POIs that are along the specified leg of the given route.
- PCMSGetPOIAlongRouteResult gets a POI along route search result.
- PCMSFindFuelStopsAlongRoute finds fuel stop POIs that are along the specified route.
- PCMSFindFuelStopsAlongRoute2 finds fuel stop POIs that are along the specified leg of the given route.
- PCMSGetFuelProviders gets a pipe (
|
) delimited list of fuel providers that can be used to filter calls to PCMSFindFuelStopsAlongRoute.
Hours of Service
PC*MILER Connect provides APIs designed to validate whether a trip conforms to the rules PC*MILER uses for Hours of Service (HOS) management of a route. If it does not conform, a report is generated that specifies where off duty stops are needed.
With this information, you can then determine which stops to insert along a route and at what point to insert them. The trip validation process can be repeated until compliance with the HOS rules is confirmed.
HOS functions can also be used in conjunction with the APIs for places of interest (POI) searches to build your own HOS management system. To call the functions below, the Streets add-on for U.S. streets must be licensed and installed, and streets routing must be enabled using the PCMSSetRouteLevel function or the PCMSERVE.INI
file.
- PCMSSetStopOptions sets advanced stop information for a specific stop in a trip.
- PCMSGetStopOptions gets the advanced stop information for a specific stop in a trip.
- PCMSSetHOSWeekSchedule sets a 60-hour or 70-hour duty limit.
- PCMSSetHOSAvailableTime sets the HOS time available at the origin of the trip.
- PCMSValidateRouteHOS analyzes the given trip and determines if it is HOS compliant.
- PCMSGetHOSRouteReport gets the full HOS report for a given trip.