Figure
presents the flow of the simulation in
pseudocode. The listing of the actual code used for the simulation is
presented in appendix C.2. The simulation is
represented as a series of discrete events. An outline of the various
steps that the simulation follows is presented here:
Two parts of this sequence warrant some further discussion at this point.
In item 3, polling a boat to see whether it embarks
is conducted in two steps: 1), assigning a probability of embarkation,
and 2) drawing a random number to see if embarkation occurs.
Assignation of embarkation probabilities is done through fitting a
continuous probability function to empirical embarkation data (see
section 4.3 for details), and using the inverse
transformation method to draw a random sample from that
distribution.
Assignation of destinations is done by
determining a list of possible destinations from empirical data (see
section 4.3 and appendix
A for details) and using the table-lookup
method to assign a specific destination.
Both of these methods are described in standard mathematical handbooks
and textbooks; the forms used here are as described in Råde and Westergren (1995).
In item 6, a raster-based GIS is used to determine the path taken by each boat in the schedule created in step 3. The details of the least-cost path procedure used to determine these paths can be found in section 4.3.4.