I'm working on a model which is similar to Product Delivery model in Anylogic where there's a population of retailers and warehouses and for each demand, the vehicles of warehouses make the delivery. I want to calculate the distance traveled by vehicles to make delivery and to calculate the cost of transport. I used DistanceByRoute method in the state. However it didn't work. However after simulation it tells me that there's an error That's the code that I put in the entry action in the state "Unloading":
FuelCost = (DistanceCalcule / 100) * ConsoFuelPerKM*(FuelPrice) + FuelCost;
DistanceCalcule=(order.retailer.distanceByRoute(vehicle))*2;
DistanceParcourue = DistanceParcourue + DistanceCalcule;
However after simulation it tells me that there's an error
This image in this link shows the states that i've used
this image in this link shows what I put in the state Unloading