Route Cost Accounts

Patchworks calculates cost information for hauling, construction and maintenance of road segments used to bring products to the destinations. This cost information can be summarized into new accounts or it can be added to previously named accounts.

The route haul account will sum up the cost of hauling wood over the individual segments used to transport the wood to the destination. The cost calculation involves tracking the cummulative product flow over each segment, mulitplying the flow on each segment by the haul cost, and adding the values into the named account.

Haul cost accounts, like all accounts, add the values that they calculate into the named account. Totals for multiple destinations can be created by adding multiple route cost accounts into the same named account. A total cost account for a single destination can be defined to track the hauling cost for just that particular destination, or can be added to a total hauling account to track the total hauling cost for all destinations in the planning area.


The haul, build and repair cost account constructors have options to multiply costs by a constant factor. To subtract the cost from an account use -1 as the scaling factor. By default the scaling factor is 1 and cost are simply added. Refer to the API for details.

Route build accounts sum the total cost incurred constructing road segments that are used to bring wood from the harvested block to the destination. Construction costs are only charged once, and the charge is incurred in the first planning period that the road segment is used. In subsequent planning periods the road is assumed to be built and no further construction charges apply.

If each destination has its own woodshed, and the road networks are not connected between woodsheds, then the model can correctly determine and attribute the construction and maintenance costs required for each destination. The more common case is connected and overlapping road networks, where roads are shared to get wood products to multiple destinations. In this case the model cannot reasonably determine how to apportion costs (should the charge go to the closest mill, be split 50/50, or to the first mill to use the road?). In this common case total cost accounts should be used for the construction and maintenance accounts. An arbitrary division of cost will occur if separate accounts are used.

Route repair accounts sum the total cost incurred to maintain road segments used to bring products to the destination. A maintenance charge is incurred on each segment during each planning period that the segment is used.

Similarly to the build cost account, the maintenance for each destination should be added to a total repair account if there are multiple destinations in the model. If products flow over the same segment to different destinations it is impossible for the model to decide which destination should incurr and record the charge.

The following example demonstrates multiple destination route cost account construction.

Figure 43. Route cost account construction


control.addExclusiveAccount("product.Yield.Managed.Conif", "destination.MILL1");
control.addExclusiveAccount("product.Yield.Managed.Conif", "destination.MILL2");
control.addExclusiveAccount("product.Yield.Managed.Decid", "destination.MILL1");

control.addRouteHaulAccount("destination.MILL1", "route.Mill1.haul");
control.addRouteHaulAccount("destination.MILL2", "route.Mill2.haul");
control.addRouteHaulAccount("destination.MILL1", "route.Total.haul");
control.addRouteHaulAccount("destination.MILL2", "route.Total.haul");

control.addRouteBuildAccount("destination.MILL1", "");
control.addRouteBuildAccount("destination.MILL2", "");
control.addRouteRepairAccount("destination.MILL1", "");
control.addRouteRepairAccount("destination.MILL2", "");

Cost accounts calculate the cummulative costs of hauling, road construction and maintenance, and add these values into the named account. Totals can be created if the same named account is used more than once.