rloca.p {orloca} | R Documentation |
rloca.p
function returns a random instance of loca.p
class object at a given
rectangular region.
rloca.p(n, xmin=0, xmax=1, ymin=0, ymax=1, groups=numeric(0), xgmin=xmin, xgmax=xmax, ygmin=ymin, ygmax=ymax)
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. |
groups |
The number of (almost) equal size groups to generate, or a size
list 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. |
n
must be at least 1.
xmin
must be less or equal than xmax
.
ymin
must be less or equal than ymax
.
If groups
parameter is given 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 = numeric(0)
, because at the first case a reference
point are generated at first stage.
If the arguments are valid values, it returns a new object of class
loca.p
, else it returns an error.
See also orloca-package
and loca.p
.
# 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 groups rloca.p(1, groups=c(10, 7, 2))