Skip to content

r.futures.parallelpga

Simulates landuse change using FUTURES (r.futures.pga) on multiple CPUs in parallel.

Module uses Patch-Growing Algorithm (PGA) to simulate urban-rural landscape structure development.

r.futures.parallelpga [-d] nprocs=integer repeat=integer developed=name subregions=name [subregions_potential=name] output=name [output_series=basename] [num_steps=integer] predictors=name [,name,...] devpot_params=name development_pressure=name n_dev_neighbourhood=integer development_pressure_approach=string gamma=float scaling_factor=float demand=name discount_factor=float compactness_mean=float compactness_range=float num_neighbors=integer seed_search=string patch_sizes=name [incentive_power=float] [potential_weight=name] [random_seed=integer] [memory=float] [--overwrite] [--verbose] [--quiet] [--qq] [--ui]

Example:

r.futures.parallelpga nprocs=1 repeat=10 developed=name subregions=name output=name predictors=name devpot_params=name development_pressure=name n_dev_neighbourhood=integer development_pressure_approach=gravity gamma=float scaling_factor=float demand=name discount_factor=float compactness_mean=float compactness_range=float num_neighbors=4 seed_search=probability patch_sizes=name

grass.script.run_command("r.futures.parallelpga", nprocs=1, repeat=10, developed, subregions, subregions_potential=None, output, output_series=None, num_steps=None, predictors, devpot_params, development_pressure, n_dev_neighbourhood, development_pressure_approach="gravity", gamma, scaling_factor, demand, discount_factor, compactness_mean, compactness_range, num_neighbors=4, seed_search="probability", patch_sizes, incentive_power=1, potential_weight=None, random_seed=None, memory=None, flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("r.futures.parallelpga", nprocs=1, repeat=10, developed="name", subregions="name", output="name", predictors="name", devpot_params="name", development_pressure="name", n_dev_neighbourhood=integer, development_pressure_approach="gravity", gamma=float, scaling_factor=float, demand="name", discount_factor=float, compactness_mean=float, compactness_range=float, num_neighbors=4, seed_search="probability", patch_sizes="name")

Parameters

nprocs=integer [required]
    Number of processes to run in parallel
    Default: 1
repeat=integer [required]
    Number of times stochastic simulation is repeated
    Default: 10
developed=name [required]
    Raster map of developed areas (=1), undeveloped (=0) and excluded (no data)
subregions=name [required]
    Raster map of subregions
subregions_potential=name
    Raster map of subregions used with potential file
    If not specified, the raster specified in subregions parameter is used
output=name [required]
    State of the development at the end of simulation
output_series=basename
    Basename for raster maps of development generated after each step
    Name for output basename raster map(s)
num_steps=integer
    Number of steps to be simulated
predictors=name [,name,...] [required]
    Names of predictor variable raster maps
    Listed in the same order as in the development potential table
devpot_params=name [required]
    Development potential parameters for each region
    Each line should contain region ID followed by parameters (intercepts, development pressure, other predictors). Values are separated by tabs. First line is ignored, so it can be used for header
development_pressure=name [required]
    Raster map of development pressure
n_dev_neighbourhood=integer [required]
    Size of square used to recalculate development pressure
development_pressure_approach=string [required]
    Approaches to derive development pressure
    Allowed values: occurrence, gravity, kernel
    Default: gravity
gamma=float [required]
    Influence of distance between neighboring cells
scaling_factor=float [required]
    Scaling factor of development pressure
demand=name [required]
    Control file with number of cells to convert
discount_factor=float [required]
    Discount factor of patch size
compactness_mean=float [required]
    Mean value of patch compactness to control patch shapes
compactness_range=float [required]
    Range of patch compactness to control patch shapes
num_neighbors=integer [required]
    The number of neighbors to be used for patch generation (4 or 8)
    Allowed values: 4, 8
    Default: 4
seed_search=string [required]
    The way location of a seed is determined (1: uniform distribution 2: development probability)
    Allowed values: random, probability
    Default: probability
patch_sizes=name [required]
    File containing list of patch sizes to use
incentive_power=float
    Exponent to transform probability values p to p^x to simulate infill vs. sprawl
    Values > 1 encourage infill, < 1 urban sprawl
    Allowed values: 0-10
    Default: 1
potential_weight=name
    Raster map of weights altering development potential
    Values need to be between -1 and 1, where negative locally reduces probability and positive increases probability.
random_seed=integer
    Seed for random number generator
    The same seed can be used to obtain same results or random seed can be generated by other means.
memory=float
    Memory for single run in GB
-d
    Runs each subregion separately
    r.futures.pga runs for each subregion and after all subregions are completed, the results are patched together
--overwrite
    Allow output files to overwrite existing files
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

nprocs : int, required
    Number of processes to run in parallel
    Default: 1
repeat : int, required
    Number of times stochastic simulation is repeated
    Default: 10
developed : str, required
    Raster map of developed areas (=1), undeveloped (=0) and excluded (no data)
    Used as: input, raster, name
subregions : str, required
    Raster map of subregions
    Used as: input, raster, name
subregions_potential : str, optional
    Raster map of subregions used with potential file
    If not specified, the raster specified in subregions parameter is used
    Used as: input, raster, name
output : str, required
    State of the development at the end of simulation
    Used as: output, raster, name
output_series : str, optional
    Basename for raster maps of development generated after each step
    Name for output basename raster map(s)
    Used as: output, raster, basename
num_steps : int, optional
    Number of steps to be simulated
predictors : str | list[str], required
    Names of predictor variable raster maps
    Listed in the same order as in the development potential table
    Used as: input, raster, name
devpot_params : str, required
    Development potential parameters for each region
    Each line should contain region ID followed by parameters (intercepts, development pressure, other predictors). Values are separated by tabs. First line is ignored, so it can be used for header
    Used as: input, file, name
development_pressure : str, required
    Raster map of development pressure
    Used as: input, raster, name
n_dev_neighbourhood : int, required
    Size of square used to recalculate development pressure
development_pressure_approach : str, required
    Approaches to derive development pressure
    Allowed values: occurrence, gravity, kernel
    Default: gravity
gamma : float, required
    Influence of distance between neighboring cells
scaling_factor : float, required
    Scaling factor of development pressure
demand : str, required
    Control file with number of cells to convert
    Used as: input, file, name
discount_factor : float, required
    Discount factor of patch size
compactness_mean : float, required
    Mean value of patch compactness to control patch shapes
compactness_range : float, required
    Range of patch compactness to control patch shapes
num_neighbors : int, required
    The number of neighbors to be used for patch generation (4 or 8)
    Allowed values: 4, 8
    Default: 4
seed_search : str, required
    The way location of a seed is determined (1: uniform distribution 2: development probability)
    Allowed values: random, probability
    Default: probability
patch_sizes : str, required
    File containing list of patch sizes to use
    Used as: input, file, name
incentive_power : float, optional
    Exponent to transform probability values p to p^x to simulate infill vs. sprawl
    Values > 1 encourage infill, < 1 urban sprawl
    Allowed values: 0-10
    Default: 1
potential_weight : str, optional
    Raster map of weights altering development potential
    Values need to be between -1 and 1, where negative locally reduces probability and positive increases probability.
    Used as: input, raster, name
random_seed : int, optional
    Seed for random number generator
    The same seed can be used to obtain same results or random seed can be generated by other means.
memory : float, optional
    Memory for single run in GB
flags : str, optional
    Allowed values: d
    d
        Runs each subregion separately
        r.futures.pga runs for each subregion and after all subregions are completed, the results are patched together
overwrite: bool, optional
    Allow output files to overwrite existing files
    Default: False
verbose: bool, optional
    Verbose module output
    Default: False
quiet: bool, optional
    Quiet module output
    Default: False
superquiet: bool, optional
    Very quiet module output
    Default: False

DESCRIPTION

Since FUTURES model is stochastic, multiple runs are recommended. Module r.futures.parallelpga is a script for running r.futures.pga on multiple CPUs. All options of r.futures.pga are available (except for random seed options which are handled by r.futures.parallelpga).

Option repeat changes the number of times the simulation is repeated with the same settings but different random seed. Option nprocs sets the number of parallel processes to be used, which depends on number of available CPUs. Flag -d switches on parallelization on subregion level. Subregions are split and simulation runs on each subregion individually. This approach is convenient if available memory is not sufficient for the entire study area. However, as each subregion is handled separately, development pressure on the edge of a subregion does not influence its neighbors. This can influence the results in case of significant development happening on the subregion boundary.

EXAMPLES

SEE ALSO

FUTURES, r.futures.pga, r.futures.devpressure, r.futures.potsurface, r.futures.demand, r.futures.calib, r.futures.potential, r.sample.category

REFERENCES

AUTHOR

Anna Petrasova, NCSU GeoForAll

SOURCE CODE

Available at: r.futures.parallelpga source code (history)
Latest change: Friday Feb 21 10:10:05 2025 in commit 7d78fe3