rloca.p {orloca}R Documentation

Random instances generator of loca.p class object

Description

rloca.p function returns a random instance of loca.p class object at a given rectangular region.

Usage

rloca.p(
  n,
  xmin = 0,
  xmax = 1,
  ymin = 0,
  ymax = 1,
  wmin = 1,
  wmax = 1,
  label = "",
  groups = 0,
  xgmin = xmin,
  xgmax = xmax,
  ygmin = ymin,
  ygmax = ymax
)

Arguments

n

The number of demand points.

xmin

Minimum value for the x coordinates of the demand points.

xmax

Maximum value for the x coordinates of the demand points.

ymin

Minimum value for the y coordinates of the demand points.

ymax

Maximum value for the y coordinates of the demand points.

wmin

Minimum value for weights

wmax

Maximum value for weights

label

The label for the new loca.p object.

groups

The number of (almost) equal size groups to generate, or a list size of the groups to generate. In the second case n will be ignored.

xgmin

Minimum value for the x coordinate of demand points with respect to the group reference point.

xgmax

Maximum value for the x coordinate of demand points with respect to the group reference point.

ygmin

Minimum value for the y coordinate of demand points with respect to the group reference point.

ygmax

Maximum value for the y coordinate of demand points with respect to the group reference point.

Details

n must be at least 1.

xmin must be less or equal than xmax.

ymin must be less or equal than ymax.

If a non zero value is given for groups parameter, then a reference point for each group are generated. At second stage, the offset part for each demand point are generated, and added to the reference point generated at the first stage.

Note that groups = 1 is not equivalent to the default value groups = 0, because in the first case a reference point are generated at the first stage.

Value

If the arguments are valid values, it returns a new object of loca.p class, else it returns an error.

See Also

See also orloca-package and loca.p.

Examples

# A random loca.p object at unit square with 5 demand points
rloca.p(5)
# At another region
rloca.p(10, xmin=-2, xmax=2, ymin=-2, ymax=2)
# Five groups
rloca.p(48, groups=5)
# Three unequal size groups
rloca.p(1, groups=c(10, 7, 2))

[Package orloca version 5.6 Index]