GithubHelp home page GithubHelp logo

azhry / smart Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 2.0 5 KB

Simple Multi Attribute Rating Technique (SMART) method for developing Decision Support System

License: MIT License

PHP 100.00%

smart's Introduction

SMART

Simple Multi Attribute Rating Technique (SMART) method for developing Decision Support System

Konfigurasi Metode SMART

Konfigurasi metode ini dapat dilihat pada Smart/config.json. Terdapat dua key yang harus dikonfigurasi, yaitu criteria dan predicate.

Contoh kasus:

Kriteria Penghasilan Orang Tua

Bobot: 20%.

Penghasilan Nilai
≤ 1.500.000 100
1.500.001 - 2.000.000 80
2.000.001 - 2.500.000 60
≥ 2.500.001 40

Kriteria Tanggungan Orang Tua

Bobot: 10%.

Tanggungan Nilai
≥ 4 100
3 80
2 60
1 40

Predikat

Range Nilai Predikat
80 - 100 Layak
0 - 79 Tidak Layak

Sehingga config.json-nya akan terlihat seperti ini

{
  "criteria": [
    {
      "label": "Penghasilan Orang Tua",
      "name": "penghasilan_orang_tua",
      "weight": 20,
      "type": "range",
      "rules": [
        {
          "max": 1500000,
          "value": 100
        },
        {
          "max": 2000000,
          "min": 1500001,
          "value": 80
        },
        {
          "max": 2500000,
          "min": 2000001,
          "value": 60
        },
        {
          "min": 2500001,
          "value": 40
        }
      ]
    },
    {
      "label": "Tanggungan Orang Tua",
      "name": "tanggungan_orang_tua",
      "weight": 10,
      "type": "range",
      "rules": [
        {
          "min": 4,
          "value": 100
        },
        {
          "max": 3,
          "min": 3,
          "value": 80
        },
        {
          "max": 2,
          "min": 2,
          "value": 60
        },
        {
          "max": 1,
          "min": 1,
          "value": 40
        }
      ]
    }
  ],
  "predicates": [
    {
      "label": "Layak",
      "max": 100,
      "min": 80
    },
    {
      "label": "Tidak Layak",
      "max": 79,
      "min": 0
    }
  ]
}

Contoh Penggunaan

Lihat di index.php.

<?php
include_once 'Smart/Smart.php';

// instansiasi objek SMART
$smart = new Smart();

// beri data yang akan dihitung
$smart->fit(
  [
    'ipk' => 3.50,
    'prestasi_non_akademik' => 'Internasional',
    'penghasilan_orang_tua' => 1300000,
    'tanggungan_orang_tua' => 2
  ]
);

echo $smart->result() . '<br>'; // output: 88
echo $smart->predicate() . '<br>'; // output: Layak

Contoh Penggunaan dengan Framework Codeigniter

Copy-Paste folder Smart ke dalam application/libraries/.

<?php

class ContohController extends CI_Controller
{
  public function __construct()
  {
    parent::__construct();
  }
  
  public function index()
  {
    // instansiasi objek SMART
    $this->load->library("Smart/smart");

    // beri data yang akan dihitung
    $this->smart->fit(
      [
        'ipk' => 3.50,
        'prestasi_non_akademik' => 'Internasional',
        'penghasilan_orang_tua' => 1300000,
        'tanggungan_orang_tua' => 2
      ]
    );

    echo $this->smart->result() . '<br>'; // output: 88
    echo $this->smart->predicate() . '<br>'; // output: Layak
  }
}

Azhary Arliansyah © 2018

smart's People

Contributors

azhry avatar

Stargazers

muhammad irsyad masyhudin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.