Professional Documents
Culture Documents
Disusun Oleh :
NIM : 361655401005
KELAS 2A
Dosen Pembimbing :
TAHUN 2017/2018
1. Tabel Data (Basis Pengetahuan)
a. Meta Data Matkul
A B C D E F G H I J K L M N O P Q R S
1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 1 1
0 0 0 1 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1
0 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
2. ScreenShot Program
a. Program pada java
b. Program pada Pane
3. Running Program
Tampilan ketika program di jalankan. Kita pilih mata kuliah yang sesuai dengan keahlian
kita, lalu pilih Proses untuk melakukan perhitungan dengan sistem pakar yang dibuat. Pilih
Clear untuk menghapus pilihan secara serentak (Pane akan kembali seperti awal).
Menggunakan format desimal kita dapat menghitung probabilitas tingkat kepastian untuk
mencari solusi atau kesimpulan.
4. Script Program Java
/*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sistempakar2;
import java.text.DecimalFormat;
/**
*
* @author Prasetyo
*/
public class SistemPakar2 {
int[][] matkul = {
{1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1},
{0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1},
{0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}
};
int[][] diagnosis = {
{1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0},
{1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0},
{1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0},
{0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0},
{0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1}
};
public String innerProduct(int[] input) {
String innerProduct;
double[] hasil1 = new double[matkul.length];
double[] hasil2 = new double[diagnosis.length];
double temp = 0;
int index = 0;
/**
*
* @author Prasetyo
*/
public class SistemPakar2Pane extends javax.swing.JFrame {
/**
* Creates new form SistemPakar2Pane
*/
public SistemPakar2Pane() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE
);
jTextArea1.setColumns(20);
jTextArea1.setRows(5);
jScrollPane1.setViewportView(jTextArea1);
jButton1.setText("Process");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Clear");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jCheckBox1.setText("ya");
jCheckBox1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox1ActionPerformed(evt);
}
});
jCheckBox2.setText("ya");
jCheckBox2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox2ActionPerformed(evt);
}
});
jCheckBox3.setText("ya");
jCheckBox3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox3ActionPerformed(evt);
}
});
jCheckBox4.setText("ya");
jCheckBox4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox4ActionPerformed(evt);
}
});
jCheckBox5.setText("ya");
jCheckBox5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox5ActionPerformed(evt);
}
});
jCheckBox6.setText("ya");
jCheckBox7.setText("ya");
jCheckBox8.setText("ya");
jCheckBox9.setText("ya");
jCheckBox10.setText("ya");
jCheckBox11.setText("ya");
jCheckBox12.setText("ya");
jCheckBox13.setText("ya");
jCheckBox14.setText("ya");
jCheckBox15.setText("ya");
jCheckBox16.setText("ya");
jCheckBox16.setToolTipText("");
jCheckBox17.setText("ya");
jCheckBox17.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox17ActionPerformed(evt);
}
});
jCheckBox18.setText("ya");
jCheckBox18.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBox18ActionPerformed(evt);
}
});
jLabel21.setText("Hasil");
jCheckBox19.setText("ya");
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING, false)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addComponent(jLabel9)
.addComponent(jLabel8)
.addComponent(jLabel7)
.addComponent(jLabel11)
.addComponent(jLabel12)
.addComponent(jLabel13)
.addComponent(jLabel14)
.addComponent(jLabel15)
.addComponent(jLabel16)
.addComponent(jLabel17)
.addComponent(jLabel18)
.addComponent(jLabel19)
.addComponent(jLabel10)
.addComponent(jLabel5)
.addComponent(jLabel2)
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 325,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6)
.addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_SIZE, 320,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addComponent(jCheckBox5)
.addComponent(jCheckBox1)
.addComponent(jCheckBox2)
.addComponent(jCheckBox3)
.addComponent(jCheckBox4)
.addComponent(jCheckBox6)
.addComponent(jCheckBox7)
.addComponent(jCheckBox8)
.addComponent(jCheckBox9)
.addComponent(jCheckBox10)
.addComponent(jCheckBox18)
.addComponent(jCheckBox17)
.addComponent(jCheckBox16)
.addComponent(jCheckBox15)
.addComponent(jCheckBox14)
.addComponent(jCheckBox13)
.addComponent(jCheckBox12)
.addComponent(jCheckBox11)
.addComponent(jCheckBox19)))
.addGroup(layout.createSequentialGroup()
.addGap(84, 84, 84)
.addComponent(jLabel1)))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 14, Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(jButton1)
.addGap(53, 53, 53)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 68,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel21,
javax.swing.GroupLayout.PREFERRED_SIZE, 50,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(113, 113, 113))))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel20)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel1)
.addComponent(jLabel21))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 145,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jButton2)
.addComponent(jButton1)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel2)
.addComponent(jCheckBox1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel3)
.addComponent(jCheckBox2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel4)
.addComponent(jCheckBox3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel5)
.addComponent(jCheckBox4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel6)
.addComponent(jCheckBox5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel7)
.addComponent(jCheckBox6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel8)
.addComponent(jCheckBox7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel9)
.addComponent(jCheckBox8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel10)
.addComponent(jCheckBox9))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel11)
.addComponent(jCheckBox10))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel12)
.addComponent(jCheckBox11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel13)
.addComponent(jCheckBox12))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel14)
.addComponent(jCheckBox13))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel15)
.addComponent(jCheckBox14))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel16)
.addComponent(jCheckBox15))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel17)
.addComponent(jCheckBox16))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel18)
.addComponent(jCheckBox17))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel19)
.addComponent(jCheckBox18))))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.B
ASELINE)
.addComponent(jLabel20)
.addComponent(jCheckBox19))
.addContainerGap(43, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(SistemPakar2Pane.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(SistemPakar2Pane.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(SistemPakar2Pane.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(SistemPakar2Pane.class.getName()).log(ja
va.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>