Title: | Tool Kit to Implement a W.A.S.P.A.S. Based Multi-Criteria Decision Analysis Solution |
---|---|
Description: | Provides a set of functions to implement decision-making systems based on the W.A.S.P.A.S. method (Weighted Aggregated Sum Product Assessment), Chakraborty and Zavadskas (2012) <doi:10.5755/j01.eee.122.6.1810>. So this package offers functions that analyze and validate the raw data, which must be entered in a determined format; extract specific vectors and matrices from this raw database; normalize the input data; calculate rankings by intermediate methods; apply the lambda parameter for the main method; and a function that does everything at once. The package has an example database called choppers, with which the user can see how the input data should be organized so that everything works as recommended by the decision methods based on multiple criteria that this package solves. Basically, the data are composed of a set of alternatives, which will be ranked, a set of choice criteria, a matrix of values for each Alternative-Criterion relationship, a vector of weights associated with the criteria, since certain criteria are considered more important than others, as well as a vector that defines each criterion as cost or benefit, this determines the calculation formula, as there are those criteria that we want the highest possible value (e.g. durability) and others that we want the lowest possible value (e.g. price). |
Authors: | Flavio Barbara [cre, aut], Marcos Santos [ctb] |
Maintainer: | Flavio Barbara <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.1.5 |
Built: | 2025-03-05 05:33:03 UTC |
Source: | https://github.com/flavio-barbara/waspasr |
Apply the lambda to assign a relative importance to each of the previously used methods (WSM and WPM). Lambda values range from zero to one
applyLambda(matrix_wsm, matrix_wpm, lambda)
applyLambda(matrix_wsm, matrix_wpm, lambda)
matrix_wsm |
The data set object obtained from the application of the calcWSM function |
matrix_wpm |
The data set object obtained from the application of the calcWPM function |
lambda |
The lambda value (between 0 and 1) |
A data frame object that contains the alternatives set scored by and classified in descending order (from best to worst classified) according to the weighting proposed by the WASPAS method using the input lambda.
Calculates the ranking for the alternative's set according to WPM method
calcWPM(normal_db, vec_weights)
calcWPM(normal_db, vec_weights)
normal_db |
A data set object with normalized values of Alternatives X Criteria |
vec_weights |
Contains a set of user assigned values to weight the criteria. The sum of these weights must add up to 1. The format of this input is an array of values. |
A data frame object that contains 2 columns and the the same number of rows as the input matrix. The columns "WPM_Rank" has the calculated relative value of each alternative whose id is in the "Alternative" column
Calculates the ranking for the alternative's set according to WSM method.
calcWSM(normal_db, vec_weights)
calcWSM(normal_db, vec_weights)
normal_db |
A data set object with normalized values of Alternatives X Criteria |
vec_weights |
Contains a set of user assigned values to weight the criteria. The sum of these weights must add up to 1. The format of this input is an array of values. |
A data frame object that contains 2 columns and the the same number of rows as the input matrix. The column "WSM_Rank" has the calculated relative value of each alternative whose id is in the "Alternative" column
Verify if the database to be submitted to WASPAS is correctly formatted
checkInputFormat(waspas_db)
checkInputFormat(waspas_db)
waspas_db |
The original database to be validated in its format |
True if everything is OK, an error message in case of bad format
A small database with real helicopter names and criteria that make sense. The values and weights are generated at random. The only requirement for the methods is that their sum be 1. The set of Cost - Benefit flags make no sense in terms of the criteria they refer to and are just a set of strings starting with the letter "C" (cost) or "B" (benefit). That is, a criterion that must be monotonic of benefit want to maximize it) can have a "c" flag, while a criterion that the (we user would rightly judge to be cost (we want to minimize it) can have a "b" flag.
data(choppers)
data(choppers)
An object of class "data.frame"
A set of helicopters names that can be bought in the marketplace.These data are in the first column, from row 4 to the last.
set of criteria that a helicopter buyer may deem relevant for making apurchase decision. These data are in the 3rd row, from col 2 to the last.
Arbitrated by the decision maker, they attribute different relative importance to the values of the criteria in percentage terms, thus making a weighting of these criteria.
They determine whether the specific criterion is cost, that is, the smaller, the better, or benefit, the greater the better. These data are in the 1st row, from col 2 to the last.
Randomly generated value, within a range that makes sense These data are in the fourth row, from col 2 to the last.
This data set was created with the help of Gustavo, Marcos & Marcio, in the work cited below: Soares de Assis, Gustavo & Santos, Marcos & Basilio, Marcio. (2023). Use of the WASPAS Method to Select Suitable Helicopters for Aerial Activity Carried Out by the Military Police of the State of Rio de Janeiro. Axioms. 12. 77. 10.3390.
data(choppers) head(choppers)
data(choppers) head(choppers)
Normalize the values of Alternatives X Criteria matrix according to a given Cost - Benefit vector of flags.
normalize(normalized_matrix, vec_cost_benefit)
normalize(normalized_matrix, vec_cost_benefit)
normalized_matrix |
A data set object with Alternatives X Criteria values to be normalized |
vec_cost_benefit |
A vector of flags that determines if the criterion is a Cost or Benefit. Must be same size of Criteria, must contains just strings initiated with B, b, C or c |
A data frame object that contains the input matrix values normalized
Slice a matrix or data.frame in “all - in - one” format into dedicated vectors/matrices as data.frame objects
sliceData(waspas_db, output_obj)
sliceData(waspas_db, output_obj)
waspas_db |
A matrix or data.frame in “all - in - one” format |
output_obj |
A flag to determine the vector or matrix (data.frame) to extract from the input matrix must be 'A' (Alternatives), 'C' (Criteria), 'F' (Flags), 'V' (Values) or 'W' (Weights) |
A data.frame one - dimensional (vector) or two - dimensional (matrix) with one of the Following objects: - if output_obj == "A": A vector of Alternatives - if output_obj == "C": A vector of Criteria - if output_obj == "F": A vector of Cost - Benefit Flags - if output_obj == "I": A vector containing the indicators in cells [1:3, 1] - if output_obj == "V": A matrix of values per Alternative x Criterion - if output_obj == "W": A vector of Weights
Runs the complete process from slicing the original database, processing all the computational steps, like computing WSM and WPM formulas, applying the lambda as proposed by the method WASPAS, and the building the complete output in a new data.frame with the criteria as column names, all the original data and appending 3 new columns with the WSM, WPM and WASPAS ranking ("WSM_Rank", "WPM_Rank", "WASPAS_Rank").
waspasR(waspas_df, lambda)
waspasR(waspas_df, lambda)
waspas_df |
The original data set in a proper format. The format can be checked by checkInputFormat() function. |
lambda |
The lambda value (between 0 and 1) |
A data.frame object that contains the input matrix with its values normalized. Or an error message if some bad data is entered.