Font size

Phase 6. Export the Updated Calculator and Check It

In the previous phase we added the Minimum distance condition to the calculator. In this phase we will test the updated calculator.

The previous testing was done on the Simulation experiment. Now let us use the Network Optimization experiment, so that we could prove that our modified calculator works well in both experiments types.

Export the cost calculator

  1. Double-click the Export to ALX item in the extension tree of the Projects view to open the Export anyLogistix Extension dialog box.
  2. Change the name of the extension file, to prevent conflicts with the previously exported calculator.
  3. Click Finish. You will see a message in the anyLogistix interface informing you that the extension was successfully added.
  4. Click OK to close the notification.

To be able to check the calculations in the Network Optimization we need to have a scenario of the NO type. We can simply convert the existing SIM scenario into the NO scenario

Convert the SIM scenario to the NO scenario

  1. Right-click the existing scenario and select Create Copy as NO from the context menu.
    A copy will be created in the NO tab. It is a full copy of the SIM scenario. You will be instantly taken to it.

Now we can update the paths configuration.

Update the supply chain configuration and set up the new calculator

  1. Open the Paths table.
  2. Select the Phase 5 Additional cost with min distance from the Cost Calculation drop-down list for both table records.

    The Cost Calculation Parameters cell now shows the description that we updated in the getDescription() method.

  3. Double-click the Cost Calculation Parameters cell of the first record.
  4. In the opened dialog set the:
    • Amount unit to ft3
    • Cost per unit parameter to 0.005.
    • Additional cost parameter to 10.
    • Min distance for additional cost parameter to 500 miles.

      The distance measurement unit is the default project distance unit. If required, we can select any other available distance measurement unit in the Distance Unit column of the Path table for each path separately.

  5. Now double-click the Cost Calculation Parameters cell of the second record, and set:
    • Amount unit to ft3
    • Cost per unit parameter to 0.01
    • Additional cost parameter to 10
    • Min distance for additional cost parameter to 500 miles.

      When done, it should look like this:

Now we can run the Network Optimization experiment and observe received results

Run the Network optimization experiment

  1. Navigate to the Experiments section and click NO experiment.
  2. Set the Product statistics unit parameter to ft3.
  3. Click Run in the opened experiment's view. The results will be available in the Results sub-item of the NO experiment tree branch.

Results of the experiment

Network Optimization experiment result contains several predefined statistics, which contain all the data the NO experiment gathers.

Product Flows

Statistics on all the flows of the supply chain are on the Product Flows page. We are interested in the transportation costs, which are in the Transportation Cost, per item and Transportation Cost, total. columns

Since our cost calculator is based on the Product&distance-based calculator, the value in the Transportation Cost, per item column depends on the Distance. The value in the Transportation Cost, total column is calculated as Transportation Cost, per item * flow value, where the flow value is taken from the corresponding record of the Flow column.

Vehicle Flows

If we open the Vehicle Flows page, we will see detailed statistics on the vehicle types that were used to deliver goods within the supply chain.

  • The values in the Cost column are calculated with the vehicleFlowCost() method.
  • The Vehicle Trips column shows the number of vehicles used in the transportation.

Total costs

To analyze the aggregated value of transportation costs, open either the Objective Members or the Overall Stats page.

Checking calculation results

Now let us check if the calculations are correct, i.e. if the additional cost is applied only to the flows that exceed the limit of 500 miles.

All the from-to combinations to which the additional cost is applied are described on the Vehicle Flows page. If the vehicleFlowCost() method returns 0, there would be no data in the Vehicle Flows page. That is why all the flows from the Vehicle Flows table have the additional cost applied to them.

To check the calculator, we will pick two flows from the Product Flows page with the distance less and more than 500 miles. The flow with the distance less than 500 miles should not be present on the Vehicle Flows page, while the flow with the distance exceeding the specified limit should. The Cost value in this case should equal the Vehicle Trips amount * Additional cost value.

Check calculation accuracy

  1. Pick the first two flows from the Product Flows page: DC Baltimore > Buffalo customer (360 miles), and DC Dallas > Omaha customer (655 miles).

  2. Open the Vehicle Flows page filter the data by DC Baltimore. The table has no data with this DC. No need to additionally filter the data by the destination.

  3. Now filter the data by the DC Dallas > Omaha customer pair of locations.

    As you can see, the table contains data on this flow, which is expected.
    The Cost value shows the total additional cost applied to this flow that is calculated as Vehicle Trips * additional cost, or 20 * 10 = $200
    The calculations are correct.

That's it. Congratulations! You have successfully completed the main part of this tutorial.

The next part is optional and is a bit more complex.

How can we improve this article?