Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Carrera:
Ingeniería En Sistemas Computacionales
Materia:
Simulación
Docente:
Gil Santana Esparza
Alumno:
Victor Daniel Vicencio Morato
Fecha:
15/01/2021
Introducción:
En el presente trabajo se enfocara en como es que trabaja un cajero automático
proceso a proceso que pasa desde que un cliente llega a formarse a una fila para
hacer cualquier transacción y se va, y para esto usaremos una herramienta muy
importante que es la simulación que se puede hacer en algunos procesos, esto
para saber con exactitud que es lo que pasa dentro de esos procesos y que
pudiera presentarse para poder mejorar esos procesos en los que estamos
enfocando la simulación, como sabemos la Simulación permite predecir el
comportamiento de los sistemas logístico/productivos bajo diversas situaciones
reales o previsibles (o lo que es lo mismo, situaciones simuladas). Imaginemos
diversos escenarios como roturas de stock, huelgas de transporte que nos impiden
el abastecimiento de materias primas por unos días, etc. Desde la Simulación,
podemos contemplar toda esta casuística o escenarios, proyectando como va a
reaccionar nuestra capacidad productiva frente a estas situaciones anómalas
(elaboración de Planes de Contingencia).
Objetivo:
Simular los distintos procesos que se llevan a cabo cuando una persona hace
cualquier transacción a un cajero automático.
Calendario de actividades:
Análisis 2 hr
Diseño 3-4 hr
codificación 6-7 hr
Pruebas 3 hr
Recursos:
Redacción/desarrollo:
Análisis:
En el análisis se desarrollará un programa que sea capaz de simular los procesos
que se llevan a cabo en un cajero automático. La simulación se enfocara desde
que una persona llega a formarse a la fila de un para ingresar el cajero, el
simulador se encargara de simular el tiempo que se lleva en llegar una persona a
otra el tiempo que tardara en hacer cualquier transacción, ingresándole el número
de clientes que pueden llegar al cajero e un día normal y el simulador será capaz
de darnos un promedio de espera entre cada cliente y obtener los resultados que
deseamos.
Diseño:
Codificación:
package cajerooxxo;
import javax.swing.table.DefaultTableModel;
public Interfaz() {
initComponents();
MiTabla =new DefaultTableModel(Datos,Titulos);
Tabla.setModel(MiTabla);
}
/**
* 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);
setBackground(new java.awt.Color(255, 204, 51));
txtclientes.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtclientesActionPerformed(evt);
}
});
btncalcular.setText("Calcular");
btncalcular.setName(""); // NOI18N
btncalcular.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncalcularActionPerformed(evt);
}
});
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(107, 107, 107)
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 523,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel1)
.addGap(18, 18, 18)
.addComponent(txttiempollegadas,
javax.swing.GroupLayout.PREFERRED_SIZE, 109,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(41, 41, 41)
.addComponent(jLabel2))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jLabel4)
.addGap(18, 18, 18)
.addComponent(txtpromedio,
javax.swing.GroupLayout.PREFERRED_SIZE, 183,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(229, 229, 229)
.addComponent(btncalcular))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(txtserv1,
javax.swing.GroupLayout.PREFERRED_SIZE, 59,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addComponent(txtserv2,
javax.swing.GroupLayout.PREFERRED_SIZE, 62,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(55, 55, 55)
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addComponent(txtclientes,
javax.swing.GroupLayout.PREFERRED_SIZE, 62,
javax.swing.GroupLayout.PREFERRED_SIZE)))))
.addContainerGap(151, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel5,
javax.swing.GroupLayout.PREFERRED_SIZE, 26,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(26, 26, 26)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel1)
.addComponent(txttiempollegadas,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(txtserv1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtserv2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(txtclientes,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(29, 29, 29)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alig
nment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtpromedio,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btncalcular))
.addContainerGap(51, Short.MAX_VALUE))
);
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.L
EADING)
.addComponent(jPanel1,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 237,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(91, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
int c, i=0, t;
/*Resto de filas*/
do{
tlc=tlc + Pn;
Pn=-((Math.abs(t))*(Math.log(Rp[i])));
if(tsalp<tlc){
inc=tlc;
}else{
inc=tsalp;
}
if((inc-tlc)<0){
tesp=0;
}else{
tesp=inc-tlc;
}
Qn = Math.abs(s1)+(Math.abs(s2)*Rq[i]);
tsal=inc+Qn;
i++;
Object[] fila2 = {i, tlc, Rp[i], Pn, inc, tesp, Rq[i], Qn, tsal};
MiTabla.addRow(fila2);
tsalp=tsal;
suma=suma+tesp;
}while(i<c);
prom=suma/c;
txtpromedio.setText(txtpromedio.getText().toString() + prom);
}
/**
* @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(Interfaz.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Interfaz.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Interfaz.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Interfaz.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Interfaz().setVisible(true);
}
});
}