Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jbytecode/fuzzyplayground
Fuzzy Playground / Sandbox
https://github.com/jbytecode/fuzzyplayground
Last synced: 22 days ago
JSON representation
Fuzzy Playground / Sandbox
- Host: GitHub
- URL: https://github.com/jbytecode/fuzzyplayground
- Owner: jbytecode
- License: mit
- Created: 2024-01-26T07:17:56.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-10-16T12:02:44.000Z (2 months ago)
- Last Synced: 2024-10-19T05:03:37.928Z (2 months ago)
- Language: Julia
- Size: 86.9 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![codecov](https://codecov.io/gh/jbytecode/FuzzyPlayground/graph/badge.svg?token=HXKTKKOTI6)](https://codecov.io/gh/jbytecode/FuzzyPlayground)
# FuzzyPlayground
Fuzzy Playground / Sandbox### Installing
```julia
(@v1.10) pkg> add https://github.com/jbytecode/FuzzyPlayground.git
```or
```julia
julia> using Pkg
julia> Pkg.add(url = "https://github.com/jbytecode/FuzzyPlayground.git")
```### Experimental Topsis
```julia
# Example with 2 alternatives and 4 criteria
# Fuzzy numbers are in form of Triangular (a, b, c)
#
# Reference:
#
# Kore, N. B., Ravi, K., & Patil, S. B. (2017). A simplified description of fuzzy TOPSIS method for multi criteria decision making. International Research Journal of Engineering and Technology (IRJET), 4(5), 2047-2050.decmat = [
Triangular(3, 5, 7) Triangular(7, 9, 9) Triangular(1, 4, 7) Triangular(3, 5, 7)
Triangular(5, 7, 9) Triangular(5, 8, 9) Triangular(1, 3, 5) Triangular(1, 3, 5)
]w = [
Triangular(3, 6, 9),
Triangular(5, 8, 9),
Triangular(5, 8, 9),
Triangular(1, 4, 7),
]fns = [minimum, maximum, maximum, maximum]
result = fuzzytopsis(decmat, w, fns)
```### Evaluating Fuzzy Numbers:
```julia
julia> f = Trapezodial(1, 2, 3, 20)
Trapezodial(1, 2, 3, 20)julia> observe(f, 0)
0.0julia> observe(f, 2)
1.0julia> observe(f, 3)
1.0julia> observe(f, 4)
0.9411764705882353julia> observe(f, 6)
0.8235294117647058julia> observe(f, 14)
0.35294117647058826
```### Multiple Decision Makers
Determining the decision matrix
```julia
# Two decision makers
# Two alternatives
# Four criteria
dm1 = [
Triangular(3,5,7) Triangular(7,9,9) Triangular(1,3,5) Triangular(3,5,7);
Triangular(5,7,9) Triangular(5,7,9) Triangular(1,3,5) Triangular(1,3,5)
]dm2 = [
Triangular(3,5,7) Triangular(7,9,9) Triangular(3,5,7) Triangular(3,5,7);
Triangular(5,7,9) Triangular(7,9,9) Triangular(1,3,5) Triangular(1,3,5)
]decmat = fuzzydecmat([dm1, dm2])
```Determining the aggregate weight vector
```julia
# These are decision makers' weight vectors
# There are 2 decision makers.
weights = [
[
Triangular(5, 7, 9),
Triangular(7, 9, 9),
Triangular(7, 9, 9),
Triangular(3, 5, 7),
],
[
Triangular(3, 5, 7),
Triangular(5, 7, 9),
Triangular(5, 7, 9),
Triangular(1, 3, 5),
],
]summarizedweights = prepare_weights(weights)
```