Anda di halaman 1dari 23

TI3203​ ​SIMULASI KOMPUTER

Dosen: Prof. Bermawi P. Iskandar

Tasya Amalia Putri


13418035
MINGGU KE-1
( Rabu, 21 Januari 2021 )

A. PENGANTAR

A.1 Definisi
Simulasi​ adalah imitasi dari proses/sistem riil pada durasi/jangka waktu tertentu
untuk meningkatkan kinerja dan mengurangi risiko kondisi riil

- Eksperimen yang dilakukan berdasarkan model simulasi


Kelemahan ​: tidak bisa menghasilkan nilai absolut

A.2 Sistem, Model, Simulasi


A.3 When To Use Simulation?
- In dynamic system
- Complex dynamic system that needs ​too many simplification ​and the emerging
models may ​not ​be ​valid
- Tidak butuh ​banyak simplifikasi

A.4 How To Simulate?


- Define behaviour to be simulated
Behavior​ : status yang berubah dari waktu ke waktu
- Menampilkan dengan grafik untuk menampilkan dinamika status

A.5 Pengembangan Model Simulasi

(1) Verifikasi​ : membandingkan model simulasi dengan model konseptual


(2) Validasi​ : membandingkan model simulasi dengan sistem riil

A.6 Simulasi Secara ​Manual

INPUT - MODELLING - OUTPUT


→ tentukan ​output ​terlebih dahulu
(1) INPUT
- Fixed input
- Input acak (tidak pasti)
- Variabel keputusan

(2) OUTPUT
- Keluaran dan ukuran kinerja
LANGKAH SIMULASI
Step 1 ​: Tentukan karakteristik input
Step 2 ​: buat tabel simulasi (kolom input, respons, replikasi)
Step 3 ​: untuk tiap replikasi i, bangkitkan nlai untuk input → evaluasi fungsi

Contoh
(1) Inventory system
● Yang random : (1) demand atau (2) LT
● Fixed input: inventory
● Input: lot size (Q) dan reorder level (R)
● output(ukuran kinerja): total ongkos per satuan waktu
● Tentukan interval random number
● Buat tabel (model)

(2) Kasus antrian


● Variabel acak (input tidak pasti): (1) waktu antar kedatangan dan (2)
waktu pelayanan
● Fixed input: jumlah server
● Variabel keputusan: jumlah server optimal
● Output :
(1) Rata” ​menunggu​ per pelanggan
(2) Probabilitas​ seseorang harus ​menunggu​ dalam antrian
(3) Proporsi idle time​ per server
(4) Rata” waktu​ pelayanan
(5) Rata” waktu ​antar kedatangan
(6) Rata” waktu menunggu per pelanggan dari konsumen yang harus
menunggu sebelum dilayani
(7) Rata” waktu ​menunggu dalam sistem

Distribusi Waktu kedatangan


Distribusi Waktu pelayanan

SIMULASI
Contoh
- Sistem manufaktur: waktu menunggu pada suatu stasiun kerja, waktu
proses
- Bank: waktu menunggu per nasabah pada jam sibuk
- Klinik gigi: waktu menunggu
MINGGU KE-2
( 27 Januari 2021 )

B. SIMULATION BASICS

B.1 Tipe Simulasi


● Static vs Dynamic Simulation
Static
→ ​not ​based on time
→ called Monte Carlo Simulation
Dynamic
→ based on time

● Stochastic vs Deterministic Simulation


Stochastic
→ ​random​ inputs => ​random​ outputs
→ kalo diulangi, hasil sama
→ ​performance estimates ​pake rata”
Deterministic
→​ constant ​inputs =>​ constant ​outputs
→ kalo diulangi, hasil beda

● Random Behavior
○ Natural behavior
○ Probability distributions may be either discrete or continuous

B.2 Simulating Random Behavior


● Methods:
○ Generate random numbers
○ Generate random variates based on given probability distribution

● Generating random numbers


→ Random Number Generator (RNG) untuk produce stream of independent and
uniformly distributed number
Methods:
(1) Inverse transformation
→ harus ada inverse
How?
- Find cumulative distribution function
- Find X
- U is generated randomly

(2) acceptance-rejection
→ gaada inverse (beta, gamma)

B.3 Queueing Models


● Measures of system performance
○ Server utilization (% of time server is busy)
○ Length of waiting lines
○ Delays of customers
→ decision maker suka menghadapi ​trade-off antara server utilization​ dan
customer satisfaction​ dalam line lengths dan delays

● Spreadsheet Simulation
MINGGU KE-3
( 18 Januari 2021 )

C. GENERATING RANDOM VARIETIES

C.1 Uniform
→ generate U ~ U(0,1)
→ return X = a + (b-a)U

C.2 Exponential
→ generate U ~ U (0,1)
→ return X = -(beta)ln(1-U)

C.3 Weibull
X ~ Weibull
→ generate U ~ U(0,1)
→ Return X = beta(-lnU)^(1/alpha)

C.4 Normal

C.5 Lognormal
→ Y: umur pakai suatu sistem sehingga > 0

C.6 Bernoulli
→ generate U ~ U(0,1)
→ if U <= p, return X = 1, otherwise, return X = 0
→ contoh: koin dilempar

C.7 Binomial
→ Generate Y1, Y2, Y3, …, dst
→ Return X = Y1 + Y2 + … + YT (nilai Y 0 atau 1)

C.8 Poisson

D. DISCRETE EVENT SIMULATION


→ simulasi kejadian diskrit
→ misal: jumlah konsumen berubah sesuai titik waktu
Event​: kejadian seketika yang bisa mengubah kondisi suatu sistem

Contoh:
Sistem Antrian
→ asumsi:
● Gaada antrian pada sistem di awal
● Waktu perpindahan dari antrian ke ATM sangat kecil sehingga diabaikan
● Proses FIFO (first-in first-out)
● ATM never experiences failure

D.1 3 Types of Event


● Arrival
● Departure
● termination

D.2 Event Calendar


→ maintain the list of the active customer

D.3 Running the Simulation


→ running the random variables is by finding random variates
MINGGU KE-4
( 11 Februari 2021 )

E. GPSSH

E.1 Introduction
● Language: ​FORTRAN (ribet, butuh banyak line), C++, ...
● General Purpose Simulation Language:
○ SIMSCRIPT
○ GASP
○ GPSS/H
○ …
● Simulation Software
○ ARENA
○ FlexSim
○ ProModel (ini yang digunakan untukmatkul simkom)
→ memudahkan dengan kemampuan yang sama
○ AutoMoD
○ Simul8
● GPSS/H World View
○ Sistem dimodelkan dengan ​viewpoint ​dari ​entitas yang bergerak​ dalam
sistem
○ Transaction​: dynamic moving entities
○ Entities are ​moving​ through the system from ​block to block
→ ​ada blok menunggu, blok dilayani, dll
Contoh:

(1) Generate
→ kedatangan entities
(2) Advance
→ menghentikan entity yang bergerak (misal, sedang melayani
selama 5 menit)
(3) Terminate
→ meninggalkan sistem
→ men-destroy entities

Contoh lain

(1) Seize: capture facility, yang berikutnya ga boleh masuk


→ sepasang ama release
(2) Release: kebalikan seize, free the facility
(3) Enter: sama kaya seize, tapi kapasitas > 1
(4) Leave: free one or more units

● Basic Elements of GPSS/H


○ Transaction
■ Entiti yang bergerak
■ Meninggalkan blok setelah menyelesaikan tugas
○ Resources and other entities
→ static (permanent)
→ 2 jenis resources:
■ Facilities (single unit)
■ Storages (multiple, parallel units)
○ Blocks
→ describes ​HOW t​ ransaction moves
■ Contoh: (Joe Barbershop)
● Waktu kedatangan 12-24 menit (uniform)
● Melepas dan meletakkan jaket (0,5 menit)
● Pelayanan 12-18 menit (uniform)
→ input format:
● Fixed input
● Free format

○ Control statements

SIMULATE
START 100
END

■ SIMULATE: memerintah
■ START 100: berapa banyak entitas yang disimulasi? (100)
■ Output: divide into two
● GPSS/H model listing
→ hasil compiling
→ mengecek tata bahasa
● Simulation results
○ Compiler directives
○ Standard numerical attributes

E.2 Basic Blocks and Control Statement


● Source file
○ Block
○ Control statement
○ Compiler
● contoh

Questions:
(1) Berapa waktu untuk 100 bundle?
(2) Berapa lama waktu sibuknya?

STEPS:

E.3 Running A GPSS/H Programs


MINGGU KE-5
( 18 Februari 2021 )

F. Collection of Waiting Time Statistics

F.1 Introduction
● The queue entity is implemented ​with pair ​of blocks QUEUE and DEPART
● The SEIZE block causes ​transactions ​to be delayed and form waiting lines, but
the QUEUE block does not

● Contoh:
QUEUE LINE
SEIZE SERVER
DEPART LINE
( To record amount of time in QUEUE LINE )

● Other statistics interests:


○ Average time-in-system
○ Average number of cloth bundles in the system (number of entities)

F.2 QUEUE and DEPART blocks


→ Transaction enters QUEUE block → catat sebagai member of a queue
→ Transaction enters DEPART block → it exits queue
○ The QUEUE block has two operands (A, B)
A: Specifies the name of the QUEUE that a transaction will join
B: Specifies the number of unit to be added to the QUEUE (used to
collect weighted time statistics; the default for B is 1, meaning that all
transactions will be equally weighted
F.3 Example
● Syntax:
Q(1)
QM(5)
Q(LINE)
QM(SYSQ)

● Output:

(1) Rata” waktu menunggu = 1,311 menit


(2) Rata” dalam sistem = 7,091 menit (per bundle)
(3) Rata” dalam sistem = 1,794 bundles

G. Modelling multiple, parallel servers

G.1 Introduction
● Storage entity ​provides ​a way t​ o model multiple, parallel servers
● Each ​server ​is called a unit of storage
● Another use of storage is to model a group of identical
● Storage is ​a resource (tidak bergerak) having capacity to service multiple
transactions simultaneously
● Implemented in a model with the ENTER-LEAVE pair of blocks

G.2 Contoh 6-1


● Questions:
○ Berapa waktu untuk simulasi 100 dozen t-shirts? 446,3301
○ Seberapa sibuk inspectors? 76,3%
○ Work station paling sibuk yang mana? 0,89

H. Simulation Procedure
Define objective → collect and analyse system data → build the model → validate the
model → conduct experiments → present the result

H.1 Selecting an Application


● Select an app that’s not too complicated, but has an impact
● First simulation project yang well defined
H.2 Software selection
● Kualitas
● Easy-to-use
● Appropriate
● Feature
● cost

H.3 Defining the objective


● Visualisasi, Optimasi, Performance analysis, Etc
● Tujuan bisa expand seiring dengan berjalannya proyek
● Scope: realistic, meaningful, and well-defined
● Two-phase modeling approach:
○ “As-is’ model
○ “To-be” model
● Spesifikasi:
○ Model scope
○ Objective
○ Dll

H.4 Analyze data


● Data-gathering phase
○ The result → conceptual or mental model
○ Forms of the conceptual model
○ Conceptual model
○ Data collection
● Guidelines for data gathering
Identify → focus → isolate → look → focus on → separate (separate input from
response)
● Determining data requirements
○ Determine data required
○ Be dictated primarily by model scope
○ System data can be categorised into:
■ Structural data
→ all objects terlibat
→ elements (resources, entities, locations)
■ Operational data
→ how system operates
■ Numerical data
→ kapasitas, laju kedatangan, activity times
→ perlu analisis deskriptif untuk mendapatkan pola

●Questionnaire
●Steps for gathering data
Determine data requirements > identify data resources > collect the data > make
assumptions > analyze the data > document and approve data
H.5 collecting the data
● Sequence of data collection
Define overall entity flow → develop deskripsi operasi → define incidental details
MINGGU KE-6
( 25 Februari 2021 )

(lanjutan ​Analyze data​)

● Analysis of numerical data


○ Descriptive analysis​: menjelaskan melalui keenderungan pusat (mean,
mode, std, skewness, kurtosus, range)
■ Key characteristics about the data
○ Test of independence​: cek apakah ada ketergantungan
■ Techniques used to ​determine data dependence ​or correlation:
● Scatter plot
● Autocorrelation plot
● Runs test
○ Test for identically Distributed Data
■ When collecting sample data, pastikan berasal dari satu set
populasi yang sama
■ Tool used: tests for homogeneity
■ Examples of data sets that ​tend to be nonhomogeneous
● Activity nya longer or shorter
● Interarrival times that fluctuate in length depending on the
time of day or day of the week
● Time between failures and time to repair where the failure
may result
○ Distribution Fitting
■ Apakah cocok dengan distribusi theoretical tertentu?
■ Frequency distribution: a summary view of the data
● Langkah sebelum distribution fitting
■ Kalo gaada historical data?:
● Nilai tunggal: mean
● Minimum and maximum value
● Range
■ Bounded vs boundless distribution

I. Model Building

I.1 Introduction
→ modeling is ​more than knowing how​ to use simulation software tool
→ we should construct the conceptual model first
→ yang memodelkan ​bukan​ pengambil keputusan
I.2 Conceptual Model
→ usaha pengumpulan data
● Converting a conceptual model to simulation model
○ Result of data gathering: conceptual model
● Berbagai hal perlu dipertimbangkan, antara lain:
○ Monitor

I.3 Building First Simulation Model


● START PROMODEL
○ File → New (bangun yang baru)
○ General Information panel → fill in the title, distance unit
○ Click OK → to define locations
● BUILD simulation model:
○ Locations
■ Select ​Build → Locations​:
● Waiting_for_barber: untuk nunggu
● barber_Dan: untuk dilayani
■ First location is ​the region ​(boundary used to represent a
location’s area) symboled as ​square
■ Cara masukin judul:
● Check off “New” di atas simbol” → klik aa → nanti muncul
sendiri
○ Operations
→ setelah lokasi
→ berapa lama melayani entitas?
■ Uniform (9,1)
■ Click ​operation​ in the process table
■ Klik tanda palu → pilih Wait (klik 2x) (untuk lokasi menunggu) →
klik distribusi → pilih uniform (nanti sesuain sama distribusi yang
dipake) → isi mean → half-width → klik Return → klik stream
○ Entities
■ Klik ​Build→ Entity
■ Pilih worker → ubah “worker” jadi “customer”
○ Processes
■ Klik ​Build → Process
○ Entity arrivals
■ Klik ​Build → Arrival
■ Define customer:
Klik entity “customer” → lokasi “waiting_for_barber” → isi quantity
sekali datang → first time (kapan waktu datang pertama?) →
kejadian kedatangan isi sendiri dan ditulis “INFINITY” (karna tak
terbatas atau isi [angka] → frekuensi juga isi sendiri “e(10) min”
● RUN SIMULATIONS
○ Define opsi (berapa lama simulasi dan jumlah replikasi)
○ Unit time
○ How to get the table:
■ Klik ​SImulasi → Opsi
■ On the table:
● Tentukan output
● Nama
● Run time (jam)
● Jumlah replikasi
● Output → sudah standar
● Klik ​Run
○ Output:
■ Do you want to see the result?:
● Yes: kalo udah bener
● No: kalo masih banyak salah

Anda mungkin juga menyukai