Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Welcome to newcomers! #3

Closed
jbytecode opened this issue Feb 9, 2021 · 1 comment
Closed

Welcome to newcomers! #3

jbytecode opened this issue Feb 9, 2021 · 1 comment

Comments

@jbytecode
Copy link
Owner

jbytecode commented Feb 9, 2021

The package implements the abstract type

abstract type MCDMResult end 

for return types of the MCDM tools. For example, the method topsis returns a TopsisResult, which is defined as

struct TopsisResult <: MCDMResult
    decisionMatrix::DataFrame
    weights::Array{Float64,1}
    normalizedDecisionMatrix::DataFrame
    normalizedWeightedDecisionMatrix::DataFrame 
    bestIndex::Int64 
    scores::Array{Float64,1}
end

as a sub type of MCDMResult. The topsis method takes a DataFrame as input and returns multiple entities including the bestIndex and scores. bestIndex indicates the index of the best alternative which corresponds to the maximum score.

Each single method implemented is tested in the runtest.jl file. For instance, the code

@testset "TOPSIS" begin
    tol = 0.00001
    df = DataFrame()
    df[:, :x] = Float64[9, 8, 7]
    df[:, :y] = Float64[7, 7, 8]
    df[:, :z] = Float64[6, 9, 6]
    df[:, :q] = Float64[7, 6, 6]
    w = Float64[4, 2, 6, 8]
    result = topsis(df, w)

    @test isa(result, TopsisResult)
    @test result.bestIndex == 2
    @test isapprox(result.scores, [0.3876870, 0.6503238, 0.0834767], atol=tol)
end

tests topsis for a single dataset. df is a dataset with criteria x, y, z, and q and three alternatives. It seems the method must return the alternative 2 as the best one with score of 0.6503238. These test results will be referenced soon.

If you want to implement new methods, please

  • Open a new issue and please define which method you want to implement and give some details
  • Please clarify the implementation details.

If the community decision is okay

  • Please fork the repository
  • Send you pull request

Documentation

  • Please follow the src/topsis.jl file for the documentation format.

That's all!

@jbytecode
Copy link
Owner Author

jbytecode commented Feb 9, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant