loca.p-class {orloca}R Documentation

loca.p class for Operations Research LOCational Analysis

Description

An object of class loca.p represents a weighted location problem with a demand points set. The orloca-package is mainly devoted to deals with location problems.

Details

The lengths of x and y vector must be equals. The length of w must be equal to the previous ones or must be 0. NA's values are not allowed at any of the arguments.

Value

If the arguments have valid values, it returns a new object of class loca.p, else it returns an error. summary(x) returns a summary of the x loca.p object and print(x) prints a summary of the x loca.p object.

Generators

The main generator is loca.p(x, y, w = numeric(0), label = ""). An alternative form is new("loca.p", x, y, w = numeric(0), label = "").

x
is a vector of the x coordinates of the demand points.
y
is a vector of the y coordinates of the demand points.
w
is a vector of weights of the demand points. If w is omitted then all weights are considered as 1.
label
If given, it is the label of the new object.

See Also

See also orloca-package.

Examples

# An unweighted new loca.p object
loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1))
# or
loca <- new("loca.p", x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1))

# An example with weights and name
locb <- new("loca.p", x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1), w = c(1, 2, 1, 2),
   label = "Weighted case")

[Package orloca version 2.0 Index]