First_Objective_Import: Import First Objective coefficients from Excel file

Description Usage Arguments Details Value See Also Examples

View source: R/First_Objective.R

Description

First_Objective_Import imports the problem's first objective coefficients from a sheet in an excel file.
It creates a list named First_Objective, where First_Objective[["Coefficients"]] stores the coefficients of parcels and First_Objective[["Sense"]] is equal to "Min" or "Max" showing if the objective is to be minimized or maximized.
This function is not sensitive to the order the parcels are stored in the sheet and will automatically store parcels in First_Objective[["Coefficients"]] sorted with the same order they were stored in Parcels.
Note: The coefficients of the parcels not included in the excel file will be considered zero.

Usage

1
2
First_Objective_Import(Address, Sheet = "First_Objective",
                              Sense= "Min", Silence = FALSE, Env= .GlobalEnv)

Arguments

Address

A string: the location and name of the excel file.

Sheet

A string: the name of the sheet holding the first objective's data. (Default: "First_Objective")

Sense

A string: "Min" means the objective is to be minimized and "Max" means the objective is to be maximized. (Default: "Min")

Silence

A binary parameter: if FALSE, the function will report a summary message. If TRUE, the function will be silent. (Default: FALSE)

Env

the environment where the package should create or access variables. By default the package works in the R's Global environment. (Default: .GlobalEnv)

Details

The first row of the sheet will be ignored as captions. The first column of the sheet should include names, and the second column should include coefficients.
Here is an example First Objective table:


Note: The coefficients of the parcels not appearing in the excel file will be equal to zero.

Value

NULL (creates some variables in the environment but returns nothing)

See Also

Other First Objective: First_Objective_Create(), Optimize_First_Objective()

Other Import Functions: Import_data(), Parcels_Import(), Risk_Objective_Import(), Second_Objective_Import()

Examples

1
2
3
4
5
## Not run: 

First_Objective_Import("C:\\example.xlsx", Sheet = "First_Objective", Sense= "Min")

## End(Not run)

paymanghasemi/SiteOpt documentation built on April 8, 2021, 3:44 a.m.