Pathfinder comes with a set of scripts to help you run Pathfinder from the command line. This document focuses on these scripts used to generate variations of an initial Pathfinder model for testing the effect of variability on the simulation results. Using this utility might be useful for testing the sensitivity to initial conditions (starting position, profile assignment, etc.) and/or to help with validation of distributions (normal, uniform, log-normal, etc.) used for input parameters to the model.
A typical usage of the Monte Carlo system is a three step process:
montecarlo_createcases.batfrom the command prompt to generate some variations of a source model (as well as utility BAT files for running the models and collecting results).
The following examples are for different simulation scenarios that we used for testing the Monte Carlo utility.
The reference to
model.pth is just an example file name, you would need to create a simple model of your own.
"C:\Program Files\Pathfinder 2020\montecarlo_createcases.bat" myfile.pth 20 This command generates 20 variations of myfile.pth with randomized positions and profiles for all occupants.
"C:\Program Files\Pathfinder 2020\montecarlo_createcases.bat" myfile.pth 20 -exclude=Occupants/Base_Floor This command generates 20 variations of myfile.pth with randomized positions and profiles for all occupants except those under the "Base_Floor" group.
You cannot modify model geometry or parameters related to it (stair width, rise/run, door width, etc.)
A previous version of this tool (released prior to Pathfinder 2020.1.0219) did not randomize any occupants directly under the Occupants node on the tree (only occupants in subgroups were randomized). This was to allow some basic level of control on which occupants were randomized, but this feature has been replaced by include/exclude filters (Chapter 3) in more recent versions of Pathfinder.
Open a command window in the location of the .pth file (current working directory).
The basic command structure is:
<montecarlo_createcases.bat> <pathfinder filename> <number of variations> <addl. opts>
"C:\Program Files\Pathfinder 2020\montecarlo_createcases.bat" myfile.pth 20 -exclude=Occupants/First_Floor
This command will exclude any occupant whose ID contains the text "Occupants/First_Floor". An occupant’s ID is determined by its position in the Pathfinder tree (Navigation View). The separator for groups and object nodes is a forward slash.
When the script is finished you will see output to the Terminal showing the status of every occupant in the model as shown in Figure 1.
Each Id string will be followed by three
A new variations folder
<pathfinder filename>_variations (Figure 2), containing all of the new cases and two batch script files.
To run all of the cases at once, navigate into the
<pathfinder filename>_variations folder in File Explorer and double-click the
This will start a process to run all of the simulations in numerical order.
Each simulation will output a brief summary to the Terminal window as shown in Figure 3.
When the simulations are complete, the Terminal window will close.
To create and view plots of Completion Times for All Occupants Figure 4 and Travel Distances for All Occupants Figure 5 double-click
_make_plots.bat file is a gnuplot command file.
It contains the plot data that has been extracted from the summary files for each run.
There are additional options that you can specify to change how the simulations are run and what information is included or excluded from the simulation.
See the additional options processing order diagram (Figure 6) to visualize the flow. Include is processed before exclude in all cases. Position and properties are processed separately.
Please email firstname.lastname@example.org if you have any questions about how to use this utility, or for new feature requests.