/topsis-rest-api

Sistem Pendukung Keputusan Menggunakan Metode TOPSIS (Technique For Others Reference by Similarity to Ideal Solution).

Primary LanguagePHP

Topsis Rest API

Sistem Pendukung Keputusan Menggunakan Metode TOPSIS (Technique For Others Reference by Similarity to Ideal Solution). Dikembangkan dengan Codeigniter 3.10 untuk framework dan Codeigniter REST SERVER untuk rest api.

Data Tersedia

  1. Rekomendasi Makanan cek pada:
./application/controller/TopsisMakanan.php
  1. Rekomendasi Handphone cek pada:
./application/controller/TopsisHandphone.php
  1. Rekomendasi Minuman cek pada:
./application/controller/TopsisMinuman.php
  1. Rekomendasi Jajanan cek pada:
./application/controller/TopsisJajanan.php
  1. Rekomendasi Cafe cek pada:
./application/controller/TopsisCafe.php
  1. Rekomendasi Laptop cek pada:
./application/controller/TopsisLaptop.php

Dokumentasi

  1. Import Database pada
./database/topsis
  1. Pengisian Data
$this->topsis->setNilaiTopKriteria($this->TopsisModel->getDataTopKriteria());
$this->topsis->setNilaiTopAlternatif($this->TopsisModel->getDataTopAlternatif());
$this->topsis->setNilaiTopSample($this->TopsisModel->getDataTopSample());

Pada bagian parameter bisa diganti sesuai keinginan. lihat pada bagian model

./aplication/model/TopsisModel.php
  1. Get Rangking
//Panggil method getRangking() dahulu
$this->topsis->getRangking();

//lalu untuk mendapatkan nilai akses properti berikut
$this->topsis->hasilRangking;
  1. Get Respone JSON dengan CodeIgniter REST SERVER
public function index_get()
{
  $this->topsis->setNilaiTopKriteria($this->TopsisModel->getDataTopKriteria());
  $this->topsis->setNilaiTopAlternatif($this->TopsisModel->getDataTopAlternatif());
  $this->topsis->setNilaiTopSample($this->TopsisModel->getDataTopSample());

  $this->topsis->getRangking();

  if ($this->topsis->hasilRangking) {
    $this->response($this->topsis->hasilRangking, REST_Controller::HTTP_OK);
  }
  else{
    $this->response([
                'status' => false,
                'message' => 'Error!'
            ], REST_Controller::HTTP_NOT_FOUND);
  }
}

Terimakasih :

Codeigniter REST SERVER

https://github.com/chriskacerguis/codeigniter-restserver

Topsis dengan PHP Native

https://cahyadsn.phpindonesia.id/extra/topsis.v2.php