Main Agent & Parameters - eRedekopp/trucker.alp GitHub Wiki
Overview
The Main
agent is relatively simple and doesn't contain much business logic. It mostly just gets everything ready and starts the simulation. It also has some nice visuals that can be used while running the model in the AnyLogic UI on the local machine. Since the parameters are all included in the Main
agent, we include the parameter list in this page too.
Units
Units in this model are a little bit weird, and perhaps in a future version of this model we should standardize it around meters because that's what GraphHopper and JHighway use. For now, the AnyLogic portions of the model use miles, and JHighway uses meters and kilometers. Make sure that you understand your units when looking through the model, and use the convenience methods in Trucker
to convert between them.
Parameters
The Main
agent contains most of the parameters for the model. For convenience, these are separated into categories which are grouped together in the canvas area.
-
Legal Limits
- These mirror the actual laws on commercial driver hours-of-service limits.
maxDutyHours7Day
: How many hours may a trucker be on-duty in each 7-day period? Real law defines this as being 60 hours.maxDutyHours8Day
: How many hours may a trucker be on-duty in each 8-day period? Real law defines this as being 70 hours.dutyHoursPerDay
: How many hours may a trucker be on-duty in between long rests?maxDrivingHoursBeforeShortRest
: How long is a trucker allowed to drive continuously before they're required to take a short rest? Real law defines this as being 8 hours.drivingHoursPerDay
: How many total hours may a trucker drive between long rests?resetRestHours
: How many hours must a trucker rest in order to reset the clock on their 60/70 hour rules? Real law defines this as being 34 hours.sleeperRestHours
: How many hours must a trucker rest in order to reset the clock on their duty hours per day and driving hours per day? Real law defines this as being 10 hours.shortRestHours
: How many hours must a driver rest during a short rest? Real law defines this as being 0.5 hours.
-
Experiment Parameters
- Miscellaneous experiment parameters
driverMPG
: the constant fuel economy of truckers, in MPG- To disable fuelling in the model, set this value to
Double.POSITIVE_INFINITY
.
- To disable fuelling in the model, set this value to
fuelCapacityGals
: Total fuel capacity of each trucker, constant for all truckers.numOfDrivers
: Total number of drivers in the simulation.allowUnsafeStops
: Will truckers stop overnight in unsafe locations (e.g. on the side of the highway) if no better options exist? If no, they will break their hours for a long as it takes to find a suitable truck stop, gas station, or rest area.probShipperIsInSameCityAsReceiver
: When a trucker delivers a load, what is the probability that the next one they pick up will be in the same city?maxMilesToShipper
: When a trucker delivers a load and the next load they pick up is not in the same city, how far away can the other city be?- Note that this is specifically only for when truckers have dropped off a load and are on their way to pick up another one. These trips are much shorter than deliveries whose lengths are not affected by this parameters.
experimentRegionName
: The name of the geographical region in which the experiment will occur. The largest usable area is "contiguous united states", but can be reduced to an individual state by setting this parameter to the state name, e.g. "texas".gravityModelTau
: The parametertau
for the gravity model probability distribution used to select trucker destinations. TODO add more detail.disable78DayRule
: If yes, the experiment disables the maximum 7-day and 8-day duty hour rules for truckers, and truckers will not consider them in their calculations. This is effectively the same as settingmaxDutyHours7Day
andmaxDutyHours8Day
to infinity.
-
Driver Behaviour
consecutiveDenialsBeforeGiveUp
: If a driver is denied parking this many times in a row, they will simply take a rest at their current location.doTrucksReturnHome
: If no, then truckers are in a single long driving period and never return home for home rest.targetDaysInDrivingPeriod
: If home rests are enabled, trucks will drive for this many days before returning home from wherever they are.preferredMinDailyHours
: Drivers' minimum acceptable number of duty hours between sleeper rests. If they predict that they will not be able to legally work this number of hours in a day, the driver will choose to take aRestartRest
if possible.{mean,stdev,max}HomeRestHours
: Parameters for the normal distribution from which drivers draw the length of their home rests.driverMilesPerHour
: The constant speed at which truckers travel whenever they are driving, in MPH.maxDriveTimeOvershootHours
: How far over their legal hours will a trucker go to reach a truck stop if the only alternative is to park in an unsafe location?maxDriveTimeUndershootHours
: How far under their legal hours will a trucker go to reach a truck stop if the only alternative is to drive past the farthest truck stop and park in an unsafe location?{min,max,mean,stdev}WaitBeforeStart
: Parameters for the normal distribution from which truckers draw the length of their wait before they start their first driving period. Drivers' start times are staggered so that they get more evenly spread out and reduce the length of the burn-in period.refuelThresholdPct
: The proportion of fuel [0.0, 1.0] remaining where aTrucker
will decide to refuel if possible.refuelTimeHours
: How long does it take a trucker to fill up with fuel? This number is constant regardless of how much fuel is needed.
-
Rest Area Parking Capacity
- The dataset for rest areas does not contain any data about parking capacity, so we have to make some up. We sort rest areas into one of three categories: "Welcome Center", "Service Plaza", and "Other". Categorization is based on the truck stop's name in the dataset; for example, all rest areas with "welcome center" in the name are considered to be welcome centres. Rest areas are assigned capacities based on their type, given by the parameters below:
welcomeCenterParking
servicePlazaParking
otherRestAreaParking
Initialization
TODO gravitymodel, filtering to region, etc.
TODO jhighway, routeprovider, etc in own paragraph
Visuals
The visuals are nice to use for debugging and running small runs on your local machine. However, the broader visualization tool should be used for more detailed visualizations. In fact, these visuals will likely not be supported in the long term.