Kalikan nilai setiap bobot keputusan dengan hasl setiap matriks ternormalisasi R
DAFTAR PUSTAKA
Budianto, Eko. 2010. Sistem Informasi Geografis dengan Arc View GIS. Yogyakarta: Andi Offset.
Hanafi, Muhammad. 2011. SIG dan AHP untuk Sistem Pendukung Keputusan Perecanaan Wilayah Industri dan Pemukiman Kota Medan. Skripsi Program Studi Ilmu Komputer. Medan, Indonesia: Universitas Sumatera Utara.
Henry, W. 2009. Sistem pendukung keputusan untuk menentukan penerimaan beasiswa bank BRI menggunakan FMADM (studi kasus: mahasiswa fakultas tehnologi industry Universitas Islam Indonesia).
http://journal.uii.ac.id/index.php/Snati/article/view/1073/998
Karim, Syaeful dan Djauharry Noor. 2006. Analisis Dan Perancangan Sistem Geografis Sebagai Alat Bantu Pembuat Keputusan Alokasi Industri Di Wilayah Kota Depok. Yogyakarta, Indonesia: Universitas Bina Nusantara. Kusumadewi, Sri., Hartati, S., Harjoko, A., dan Wardoyo, R. (2006). Fuzzy Multi
-Attribute Decision Making (FUZZY MADM). Yogyakarta: Penerbit Graha Ilmu.
Nuarsa IW. 2005. Belajar Sendiri Menganalisis Data Spasial Dengan Software ARCVIEW GIS 3.3 untuk Pemula. Jakarta: PT Alex Media Computindo. Pahlevy, Randy, Tesar. 2010. Rancang Bangun Sistem pendukung Keputusan
Menentukan penerima Beasiswa dengan Menggunakan metode Simpele Additive Weighting (SAW). Skripsi Program Studi Tehnik Informatika.
Surabaya,Indonesia: Universitas Pembangunan Nasional “Veteran”.
Prahasta, Eddy. 2005. Konsep - Konsep Dasar Sistem Informasi Geografis. Bandung : CV. Informatika.
Prahasta, Eddy. 2006. Sistem Informasi Geografis ( Membangun Web Based GIS dengan Mapserver). Bandung : CV. Informatika.
Siregar, Zainuddin. 2014 Perancangan Sig Berbasis Web Objek Wisata Kota Binjai Dengan Algoritma A*, Skripsi Program Studi Ilmu Komputer. Medan, Indonesia: Universitas Sumatera Utara.
Yousman, Yeyep. 2004. Sistem Informasi Geografis dengan ArcView3.3 Professional Yogyakarta: Andi Offset
Listing program 1. Pemanggilan Class
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); require_once( 'includes/config.php' ); require_once( 'includes/class_config.php' ); require_once( 'includes/functions.php' ); require_once( 'includes/class_template.php' ); require_once( 'includes/class_gissaw.php' ); require_once( 'includes/class_html.php' ); /* //$required = 'includes'; if( is_dir( $required ) ) {
$dir = opendir( $required );
while( ($file = readdir( $dir )) !== false ) {
if( $file != '.' && $file != '..' ) {
require_once( $required . '/' . $file ); }
} }
*/ ?>
Config (Program untuk menampilkan tulisan pada halaman utama home)
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); /* App configuration */
define( 'WEB_AUTHOR', 'Herna Junita Pakpahan(081201021) ' ); define( 'WEB_TITLE', 'Sistem Informasi Geografis Penentuan Lokasi Hydrant Dengan Metode Simple Additive Weighting Berbasis Web di Wilayah Kota Medan' );
define( 'WEB_APP_TITLE', 'Sistem Informasi Geografis Penentuan Lokasi Hydrant Dengan Metode Simple Additive Weighting Berbasis Web di Wilayah Kota Medan' );
define( 'WEB_COPYRIGHT', 'Program Studi S1 Ilmu Komputer <br>Fakultas Ilmu Komputer dan Tehnik Informasi<br>Universitas Sumatera Utara<br>Medan 2011/2012'
);
define( 'BASE_URL', 'http://localhost/gissaw/' ); ?>
Class config
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); /* It might be more complext as you want */
class Config { var $web_author; var $web_title; var $web_app_title; var $web_copyright;
var $alternative = array( 0 => 'Kec. Medan Deli A<sub>1</sub>', 1 => 'Kec. Medan Sunggal A<sub>2</sub>', 2 => 'Kec. Medan Selayang A<sub>3</sub>' ); /* Add more alternative here */
public function __construct() { $this->web_author = WEB_AUTHOR; $this->web_title = WEB_TITLE; $this->web_app_title = WEB_APP_TITLE; $this->web_copyright = WEB_COPYRIGHT; }
public function web_author( $author= '' ) { if( $author != '' ) { return $author; } else {
return $this->web_author; /* Print the default title */
} }
public function web_title( $title = '' ) { if( $title != '' ) { return $title; } else {
return $this->web_title; /* Print the default title */
} }
public function web_app_title( $app_title = '' ) { if( $app_title != '' ) { return $app_title; } else {
return $this->web_app_title; /* Print the default title */
} }
public function web_copyright( $copyright= '' ) { if( $copyright != '' ) { echo $copyright; } else {
echo $this->web_copyright; /* Print the default title */
} }
}
/* Turn on the configuration as default */ $config = new Config();
?>
Class_Functions
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); function base_url()
{
return BASE_URL; }
function redirect( $url ) {
header("Location: " . $url ); }
?>
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); class Template { var $page_title; var $temp_path; var $copyright; var $page; var $config; var $winner;
public function __construct( $template_path ) {
$this->temp_path = $template_path; $this->config = new Config(); }
public function set_header( $header ) {
?>
<img src="<?php echo $this->temp_path . 'images/' . $header; ?>" width="100%" height="100"/>
<?php }
public function set_logo( $logo ) {
?>
<img src="<?php echo base_url() . 'images/' . $logo; ?>" title="Universitas Sumatera Utara" width="35" align="left"/>
<?php }
public function set_title( $title ) {
$this->page_title = ucwords( strtolower( $title ) );
}
public function html_header( $images = array() ) { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="icon" type="image/x-icon" href="<?php echo base_url(); ?>images/favicon.png">
<link rel="stylesheet" type="text/css" href="<?php echo $this->temp_path; ?>style.css" />
<script language="javascript" type="text/javascript" src="<?php echo $this->temp_path; ?>jscript.js"></script> <meta name="author" content="<?php echo $this->config->web_author(); ?>" />
<title><?php echo $this->page_title; ?></title> </head>
<?php }
public function set_page( $page ) {
$this->page = $page; }
public function load_page( $page = '' ) {
if( $page != '' ) {
if( file_exists( 'theme/default/' . $page . '.php' ) ) { require_once( 'theme/default/' . $page . '.php' ); } else {
echo 'No page !' . "\n"; }
} else {
if( file_exists( 'theme/default/' . $this->page . '.php' ) ) { require_once( 'theme/default/' . $this->page . '.php' ); } else {
echo 'No page !' . "\n"; }
} }
public function html_footer() {
?> <body> </body>
</html> <?php }
public function run() { $this->html_header(); require_once( 'theme/default/index.php' ); $this->html_footer(); } } ?> Class gissaw <?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' );
class Gissaw {
/* The weight of criteria */ var $criteria = array();
/* Hold the matrix Rij (alternative x criteria). * But, it element is the number of 'Alternative'. Recall that
*/
var $alternative = array();
/* N x N matrix (alternative x criteria */ var $elements; // <-- Required OR depreciated ? /* Rij is the bridge to build normalized matrix */ var $rij = array();
/* Normalized matrix */ var $r_matrix = array();
/* hold the most weight of element from the normalized matrix */
var $max_weight = array();
/* Preferensi of alternative (V1) */ var $preferensi = array();
/* Preferensi label */ var $preflabel = array();
public function find_max( $alt = array() ) {
$max = 0;
{ if( $v > $max ) $max = $v; } return $max; }
public function who_max( $alt = array(), $val ) { foreach( $alt as $k => $v ) { if ( $val == $v ) { return $k; break; } } }
/* Once we have Rij matrix from the user, it's time to normalized it */
public function normalize_matrix() {
/* First of all we need to restructure the matrix into
* Rij so that we can get closer to the way of normalization matrix
*/
for( $i = 1; $i <= count( $this->criteria ); $i++ ) /* 5 times */
{
for( $j = 1; $j <= count( $this->alternative ); $j++ ) /* 3 times */
{
array_push( $this->rij, $this->alternative[$j][$i] );
} }
/* Now keep the maximum value of each column matrix Rij */
$c = 1; $max = 0;
for( $i = 0; $i < count( $this->rij); $i++ ) {
if( $this->rij[$i] > $max ) {
$max = $this->rij[$i]; }
$c++;
if( $c > count( $this->alternative ) ) {
array_push( $this->max_weight, $max); $c = 1; $max = 0; } }
/* Build normalized matrix */ $c = 0;
$d = 0;
for( $i = 1; $i <= count( $this->criteria); $i++ ) /* 5 times */
{
for( $j = 1; $j <= count( $this->alternative ); $j++ ) /* 3 times */ { $this->r_matrix[$j][$i] = round( $this->rij[$c] / $this->max_weight[$d], 3 ); $c++; } $d++; }
/* Now that, we have normalized matrix. Yay ! */ }
public function execute() {
$config = new Config(); session_start();
$this->normalize_matrix();
/* Keep the number elements of N x N matrix, so that we can loop it in
* another page due to unsupported session for multidemensial array (I doubt it ;-)
*/
$_SESSION['row'] = count( $this->alternative );
$_SESSION['column'] = count( $this->criteria ); /* No more than an interface */
$weight = 0; $index = 0; $str = '';
foreach( $this->r_matrix as $key => $val ) {
foreach( $val as $key1 => $val1 ) {
$weight = ( $val1 * $this->criteria[$index] ) + $weight;
$operator = ($index == count( $this->criteria ) - 1 ) ? ' = ' : ' + ';
$str .= '(' . $val1 . ' * ' . $this->criteria[$index] . ')' . $operator;
$_SESSION["i" . $key]["j" . $key1] = $val1;
$index++; }
array_push( $this->preferensi, $weight ); /* Hold the total result */
array_push( $this->preflabel, $str ); /* Hold its process */
$index = 0; $weight = 0; $str = ''; }
foreach( $this->preferensi as $key => $val ) {
$_SESSION["V" . $key] = $val; /* return V0, V1, V2 for A1, A2, A3 */
}
foreach( $this->preflabel as $key => $val ) {
$_SESSION["L" . $key] = $val; /* return L0, L1, L2 for A1, A2, A3 */
}
/* Write the winner to the buffer */
$winner_index = $this->who_max( $this->preferensi, $this->find_max( $this->preferensi) );
$_SESSION['winner_label'] = $config->alternative[$winner_index]; $_SESSION['winner_value'] = $this->find_max( $this->preferensi ); } } ?> Class html <?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); class HTML {
public function radio( $name, $yes, $no, $current_value = '' )
{
if( $current_value == 0 ) { ?>
<input type="radio" value="0" name="<?php echo $name; ?>" checked="checked"> <?php echo $no; ?>
<input type="radio" value="1" name="<?php echo $name; ?>"> <?php echo $yes; ?>
<?php } else { ?>
<input type="radio" value="0" name="<?php echo $name; ?>"> <?php echo $no; ?>
<input type="radio" value="1" name="<?php echo $name; ?>" checked="checked"> <?php echo $yes; ?>
<?php } }
public function button( $type, $caption, $base_url = '' )
{
if( $type == 'cancel' ) {
return "<input type='button' value='" . $caption . "' onClick='history.back()' class='button'/> "; } else { if( $base_url != '' ) {
return "<input type='" . $type . "'
value='" . $caption . "' onClick='location.href=\"$base_url\"' class='button'/> "; } else {
return "<input type='" . $type . "' value='" . $caption . "' class='button'/> ";
} }
}
public function select( $value = array(), $name, $cur_value )
{ ?>
<select name="<?php echo $name; ?>" class="selectedfield">
<option value="-">None</option>
<?php foreach( $value as $key => $val ) { ?> <?php if( $key == $cur_value ) { ?>
<option value="<?php echo $key; ?>" selected="selected"><?php echo $val; ?></option>
<?php } else { ?>
<option value="<?php echo $key; ?>"><?php echo $val; ?></option>
<?php } ?> <?php } ?>
</select> <?php
}
public function combo_box( $name ) {
?>
<select name="<?php echo $name; ?>" class="selectedfield"> <option value="0.00">0.00</option> <option value="0.20">0.20</option> <option value="0.40">0.40</option> <option value="0.60">0.60</option> <option value="0.80">0.80</option> <option value="1.00">1.00</option> </select> <?php } } ?> 2. Template Indeks <?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); ?> <div id="container"> <div id="header"> <?php $this->set_header( 'header.jpg' ); ?> </div> <div id="page-container"> <div id="pipe"> <?php $this->set_logo( 'usu.png' ); ?> <div id="web-app-title"><?php echo $this->config->web_app_title(); ?></div>
<div id="web-author"><?php echo 'Oleh : ' . $this->config->web_author(); ?></div> </div> <div id="page"> <div id="left-nav"> <div id="mainmenu"> <?php $this->load_page( 'mainmenu' ); ?> </div> </div> <div id="right-nav"> <div id="dynamic-page-title"><?php echo $this->page_title; ?></div>
<div id="dynamic-page-loaded"><?php $this->load_page(); ?></div>
</div>
</div> </div> <div id="copyright"> <?php echo $this->config->web_copyright(); ?> </div> </div> Main menu <?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); ?>
<ul>
<li id="title">MAIN MENU</li>
<li><a href="<?php echo base_url(); ?>" title="Home">Home</a></li>
<li><a href="<?php echo base_url() . 'hydrant.php'; ?>" title="Fire Hydrant Kota Medan">Fire Hydrant Kota Medan</a></li>
</ul>
Home
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); ?>
<div id="welcome">
Selamat datang di <b> <?php echo $this->config->web_app_title(); ?>. </b>
Sistem ini berguna untuk menentukan lokasi hydrant yang tepat di Kota Medan
berdasarkan kriteria lokasi seperti Topografi, Penggunaan Lahan, Gegologi,
Hidrologi, dan Aksebilitas. Output dari sistem ini adalah nilai preverensi
lokasi yang dihitung dengan metode Simple Additive Weighting (SAW). Kecamatan kota Medan
yang memiliki nilai preverensi tertinggi merupakan lokasi yang terpilih sebagai
lokasi hydrant yang tepat yang akan ditampilkan (dihighlight) pada peta kota Medan.<p> </p>
Pengguna dapat menggunakan sistem ini dengan mengikuti prosedur berikut:
<ul>
Pilih Menu <b>Fire Hydrant Kota Medan.</b> </li>
<li>
Input nilai <b>Bobot Kriteria (Weight)</b> dan <b>Matrix Keputusan X (r<sub>ij</sub>),
</b> kemudian tekan tombol <b>proses.</b> </li>
<li>
Nilai preverensi setiap alternatif (lokasi) akan ditampilkan, yang selanjutnya
dapat divisualisasikan dalam bentuk peta dengan mengklik link <b>Tampilkan Peta.</b>
</li> </ul>
</div>
<img src="<?php echo base_url() . 'images/medan.gif'; ?>" title="Peta Kota Medan" align="right" WIDTH="300"/>
Hydrant
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); ?>
<form action="hydrant.php?do=process" method="post"> <div id="step">
LANGKAH 1: Tentukan Bobot dan Matrix Keputusan X </div>
<fieldset>
<legend>Bobot Kriteria</legend>
<table width="50%" class="table-weight"> <tr> <th width="283" scope="row">Topografi (C<sub>1</sub>)</th> <td width="27">:</td> <td width="283"><?php HTML::combo_box( 'C1' ); ?></td> </tr> <tr>
<th scope="row">Penggunaan Lahan (C<sub>2</sub>) </th> <td>:</td> <td><?php HTML::combo_box( 'C2' ); ?></td> </tr> <tr> <th scope="row">Geologi (C<sub>3</sub>) </th> <td>:</td> <td><?php HTML::combo_box( 'C3' ); ?></td> </tr> <tr>
<th scope="row">Hidrologi (C<sub>4</sub>) </th> <td>:</td> <td><?php HTML::combo_box( 'C4' ); ?></td> </tr> <tr> <th scope="row">Aksebilitas (C<sub>5</sub>) </th> <td>:</td> <td><?php HTML::combo_box( 'C5' ); ?></td> </tr> </table> </fieldset> <fieldset>
<legend>Matrix Keputusan X</legend>
<table width="100%" class="table-matrix"> <tr>
<td width="35%" scope="col" style="background-color:#E5E5E5;"><strong><div align="center"><i>R<sub>ij</sub></i></div></strong></td> <th width="15%" scope="col"><div align="center">Topografi<br>(C<sub>1</sub>)</div></th> <th width="15%" scope="col"><div align="center">Penggunaan <br>Lahan (C<sub>2</sub>)</div></th> <th width="15%" scope="col"><div align="center">Geologi<br>(C<sub>3</sub>)</div></th> <th width="15%" scope="col"><div align="center">Hidrologi<br>(C<sub>4</sub>)</div></th> <th width="15%" scope="col"><div align="center">Aksebilitas<br>(C<sub>5</sub>)</div></th> </tr> <tr>
<th scope="row"><?php echo $this->config->alternative[0]; ?></th>
<td><div align="center"><?php HTML::combo_box( 'A11' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A12' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A13' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A14' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A15' ); ?></div></td>
</tr> <tr>
<th scope="row"><?php echo $this->config->alternative[1]; ?></th>
<td><div align="center"><?php HTML::combo_box( 'A21' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A22' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A23' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A24' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A25' ); ?></div></td>
</tr> <tr>
<th scope="row"><?php echo $this->config->alternative[2]; ?></th>
<td><div align="center"><?php HTML::combo_box( 'A31' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A32' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A33' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A34' ); ?></div></td>
<td><div align="center"><?php HTML::combo_box( 'A35' ); ?></div></td> </tr> </table> </fieldset> <fieldset> <legend>Aksi</legend>
<?php echo HTML::button( 'reset', 'Reset' ); echo HTML::button( 'submit', 'Proses !'); ?>
</fieldset> </form>
Finally
<?php
/* Quick, clean & clear */
defined( '__GISSAW__' ) or die( 'Get out of here !' ); function bgcolor( $val )
{
echo($val == $_SESSION['winner_value']) ? 'style="background-color:#FFE1FF"' : '';
} ?>
<form action="hydrant.php?do=process" method="post"> <div id="step">
LANGKAH 2: Tampilkan Peta </div>
<fieldset>
<legend>Matrik Ternormalisasi R</legend>
<table width="3%" border="1" class="table-matrix-r" cellpadding="0" cellspacing="0"> <tr> <td> </td> <td> </td> <td style="border-left:solid 2px #000000; border-top:solid 2px #000000;"> </td> <td colspan="5" rowspan="3">
<table cellpadding="0" cellspacing="0" class="table-element">
<?php
for( $i = 1; $i <= $_SESSION['row']; $i++ ) { for( $j = 1; $j <= $_SESSION['column']; $j++ ) { ?> <td><?php echo $_SESSION["i" . $i]["j" . $j]; ?></td> <?php } echo "<tr></tr>"; } ?> </table> </td> <td style="top:solid 2px #000000; border-right:solid 2px #000000;"> </td> </tr> <tr> <td>R</td> <td>=</td> <td style="border-left:solid 2px #000000;"> </td> <td style="border-right:solid 2px #000000;"> </td> </tr> <tr> <td> </td>