// This GUI file is generated by guibuilder version 2.2
//////////
//31-Octubre-2013  Metodos Probabilisticos FIA-UES 
// El programa calcula los datos de un modelo de cola M/M/S a partir del promedio de llegada como de atencion Lambda y miu
//ademas se debe proporcionar el valor de los servidores con los que cuenta el sistema
//ademas de generar los calculos de wt y wqt con respecto al tiempo genera los graficos
//calcula las probabilidades de n clientes Pn asignando un espacio definido para 25 resultados
function Modelo_MMS(handles,arch) //agregar para el menu
archivo=arch;
f=figure('figure_position',[543,0],'figure_size',[795,728],'auto_resize','on','background',[16],'figure_name','Ventana de gráfico número %d');
//////////
delmenu(f.figure_id,gettext('File'))
delmenu(f.figure_id,gettext('?'))
delmenu(f.figure_id,gettext('Tools'))
toolbar(f.figure_id,'off')
handles.dummy = 0;
//wq y wt
handles.t1=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.4846417,0.8010589,0.0530035,0.0521886],'Relief','flat','SliderStep',[0.01,0.1],'String','En t:','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','t1','Callback','')
handles.tm1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.5301017,0.8099589,0.0298942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','tm1','Callback','')
handles.Wt=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.5596417,0.8010589,0.0530035,0.0521886],'Relief','flat','SliderStep',[0.01,0.1],'String','Wt','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Wt','Callback','')
handles.rwt=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.6041017,0.8099589,0.0988942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','rwt','Callback','')
handles.t2=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.4846417,0.7580589,0.0530035,0.0521886],'Relief','flat','SliderStep',[0.01,0.1],'String','En t:','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','t2','Callback','')
handles.tm2=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.5301017,0.7680589,0.0298942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','tm2','Callback','')
handles.Wqt=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.5626417,0.7580589,0.0530035,0.0521886],'Relief','flat','SliderStep',[0.01,0.1],'String',' Wqt','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Wqt','Callback','')
handles.rwqt=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.6041017,0.7680589,0.0988942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','rwqt','Callback','')
handles.ok=uicontrol(f,'unit','normalized','BackgroundColor',[0.25,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[10],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.711017,0.8099589,0.0408942,0.037037],'Relief','raised','SliderStep',[0.01,0.1],'String','OK','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','ok','Callback','ok_callback(handles)')
handles.ok2=uicontrol(f,'unit','normalized','BackgroundColor',[0.25,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[10],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.711017,0.7680589,0.0408942,0.037037],'Relief','raised','SliderStep',[0.01,0.1],'String','OK','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','ok2','Callback','ok2_callback(handles)')
//tiempos para graficar
handles.Dt=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0846417,0.3710589,0.0530035,0.0491886],'Relief','flat','SliderStep',[0.01,0.1],'String','Entre P:','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Dt','Callback','')
handles.dts=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1446417,0.3810589,0.0308942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','dts','Callback','')
handles.Dt2=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1746417,0.3710589,0.0530035,0.0491886],'Relief','flat','SliderStep',[0.01,0.1],'String',' y P','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Dt2','Callback','')
handles.dts2=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2301017,0.3810589,0.0308942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','dts2','Callback','')

// graficas
handles.PlotP=uicontrol(f,'unit','normalized','BackgroundColor',[0.25,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[10],'FontUnits','points','FontWeight','bold','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2801017,0.3810589,0.0608942,0.037037],'Relief','raised','SliderStep',[0.01,0.1],'String','Graficar','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','PlotP','Callback','PlotP_callback(handles)')
handles.textg=uicontrol(f,'unit','normalized','BackgroundColor',[0.6,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[10],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.5540625,0.7280589,0.230100,0.0321886],'Relief','flat','SliderStep',[0.01,0.1],'String','Grafica W(t) en rojo y Wq(t) en azul','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','textg','Callback','')
handles.graficapnt= newaxes();handles.graficapnt.margins = [ 0 0 0 0];handles.graficapnt.axes_bounds = [0.5140625,0.2800013,0.35,0.3];
handles.graficapnt.auto_clear="on";


handles.frame1=uicontrol(f,'unit','normalized','BackgroundColor',[0.2,0.25,0.4],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.141875,0.8692063,0.7184375,0.1231746],'Relief','ridge','SliderStep',[0.01,0.1],'String','','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','frame1','Callback','')
handles.name=uicontrol(f,'unit','normalized','BackgroundColor',[0.2,0.3,0.5],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[19],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.161875,0.8812033,0.6684375,0.08991446],'Relief','flat','SliderStep',[0.01,0.1],'String','Modelo M/M/S','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','name','Callback','')
handles.frame2=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0053004,0.460202,0.2010601,0.3833333],'Relief','ridge','SliderStep',[0.01,0.1],'String','','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','frame2','Callback','')
handles.lamda=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0161837,0.7834343,0.06,0.05],'Relief','flat','SliderStep',[0.01,0.1],'String','Lamda','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','lamda','Callback','')
handles.lamda1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0887279,0.7858923,0.0865371,0.0388215],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','lamda1','Callback','')
handles.miu=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0163162,0.7282642,0.0554387,0.04466],'Relief','flat','SliderStep',[0.01,0.1],'String','Miu','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','miu','Callback','')
handles.miu1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0871487,0.7206276,0.087325,0.0372189],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','miu1','Callback','')
handles.servidores=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0125085,0.6716451,0.06501,0.0410873],'Relief','flat','SliderStep',[0.01,0.1],'String','S','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','servidores','Callback','')
handles.servidores1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0859011,0.6589226,0.0915548,0.040404],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','servidores1','Callback','')
handles.clientes=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[11],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0245355,0.6021154,0.0475265,0.0420875],'Relief','flat','SliderStep',[0.01,0.1],'String','N','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','clientes','Callback','')
handles.clientes1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0823675,0.589697,0.0915548,0.0387205],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','clientes1','Callback','')
handles.inicio=uicontrol(f,'unit','normalized','BackgroundColor',[0.25,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0232509,0.5288239,0.1439929,0.0505051],'Relief','raised','SliderStep',[0.01,0.1],'String','Calcular','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','inicio','Callback','inicio_callback(handles)')
handles.frame3=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.277377,0.4167326,0.1992933,0.4284848],'Relief','ridge','SliderStep',[0.01,0.1],'String','3','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','frame3','Callback','')
handles.RHO=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2846417,0.7773589,0.0530035,0.0521886],'Relief','flat','SliderStep',[0.01,0.1],'String','rho','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','RHO','Callback','')
handles.rho=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.349416,0.7859695,0.0988942,0.037037],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','rho','Callback','')
handles.L=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3508049,0.7273605,0.0988942,0.043771],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','L','Callback','')
handles.Lq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2875972,0.6580471,0.0444523,0.040404],'Relief','flat','SliderStep',[0.01,0.1],'String','Lq','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Lq','Callback','')
handles.lq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3532509,0.6580471,0.0988942,0.04367],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','lq','Callback','')
handles.Wq=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.289364,0.5908081,0.0326855,0.0454545],'Relief','flat','SliderStep',[0.01,0.1],'String','Wq','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Wq','Callback','')
handles.wp=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3514841,0.5925926,0.0988942,0.036936],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','wp','Callback','')
handles.W=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2931802,0.5353535,0.0424028,0.037037],'Relief','flat','SliderStep',[0.01,0.1],'String','W','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','W','Callback','')
handles.w=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3532509,0.5353535,0.0988942,0.0387205],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','w','Callback','')
handles.Pn=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2931802,0.4788535,0.0424028,0.037037],'Relief','flat','SliderStep',[0.01,0.1],'String','Pn','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Pn','Callback','')
handles.pn=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3532509,0.4788535,0.0988942,0.0387205],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','pn','Callback','')
handles.Ef=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2931802,0.4288535,0.0424028,0.037037],'Relief','flat','SliderStep',[0.01,0.1],'String','Ef','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Ef','Callback','')
handles.efi=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3532509,0.4288535,0.0988942,0.0387205],'Relief','sunken','SliderStep',[0.01,0.1],'String','','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','efi','Callback','')
//
handles.new=uicontrol(f,'unit','normalized','BackgroundColor',[0.25,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0232509,0.4688239,0.1554417,0.0505051],'Relief','raised','SliderStep',[0.01,0.1],'String','Nueva Operacion','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','new','Callback','new_callback(handles)')
handles.ayu=uicontrol(f,'unit','normalized','BackgroundColor',[0.25,0.5,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[20],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.8828269,0.8821549,0.0609541,0.0909091],'Relief','raised','SliderStep',[0.01,0.1],'String','?','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','ayu','Callback','ayu_callback(handles)')
handles.Lt=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2884806,0.7236027,0.035053,0.0420875],'Relief','flat','SliderStep',[0.01,0.1],'String','L','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Lt','Callback','')
handles.Matriz=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0205656,0.1021222,0.4111568,0.2684848],'Relief','ridge','SliderStep',[0.01,0.1],'String','7','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','Matriz','Callback','')
handles.textoM=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','bold','ForegroundColor',[0,0,0],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0195656,0.077220,0.5111568,0.0284848],'Relief','flat','SliderStep',[0.01,0.1],'String','Matriz que muestra la probabilidades Pn de 1 a 25 clientes ','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','textoM','Callback','')
handles.resp1=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0275578,0.3096633,0.0815424,0.0521886],'Relief','sunken','SliderStep',[0.01,0.1],'String','1','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp1','Callback','')
handles.resp2=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1079434,0.3096633,0.0828278,0.0521886],'Relief','sunken','SliderStep',[0.01,0.1],'String','2','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp2','Callback','')
handles.resp3=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1908997,0.3096633,0.0789717,0.0538721],'Relief','sunken','SliderStep',[0.01,0.1],'String','3','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp3','Callback','')
handles.resp4=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.27,0.3096633,0.0828278,0.0505051],'Relief','sunken','SliderStep',[0.01,0.1],'String','4','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp4','Callback','')
handles.resp5=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3521851,0.3055750,0.0815424,0.0521886],'Relief','sunken','SliderStep',[0.01,0.1],'String','5','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp5','Callback','')
handles.resp6=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0262725,0.2620202,0.0828278,0.0488215],'Relief','sunken','SliderStep',[0.01,0.1],'String','6','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp6','Callback','')
handles.resp7=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1079434,0.2603367,0.0815424,0.0488215],'Relief','sunken','SliderStep',[0.01,0.1],'String','7','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp7','Callback','')
handles.resp8=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.188329,0.2570707,0.0815424,0.0488215],'Relief','sunken','SliderStep',[0.01,0.1],'String','8','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp8','Callback','')
handles.resp9=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2712853,0.2653872,0.0789717,0.043771],'Relief','sunken','SliderStep',[0.01,0.1],'String','9','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp9','Callback','')
handles.resp10=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3508997,0.2530315,0.0789717,0.0588215],'Relief','sunken','SliderStep',[0.01,0.1],'String','10','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp10','Callback','')
handles.resp11=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0262725,0.2076431,0.0828278,0.0538721],'Relief','sunken','SliderStep',[0.01,0.1],'String','11','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp11','Callback','')
handles.resp12=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1092288,0.2093266,0.0802571,0.0505051],'Relief','sunken','SliderStep',[0.01,0.1],'String','12','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp12','Callback','')
handles.resp13=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.188946,0.2101437,0.0802571,0.0521886],'Relief','sunken','SliderStep',[0.01,0.1],'String','13','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp13','Callback','')
handles.resp14=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2687147,0.2110101,0.0828278,0.047138],'Relief','sunken','SliderStep',[0.01,0.1],'String','14','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp14','Callback','')
handles.resp15=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3521851,0.211584,0.0815424,0.047138],'Relief','sunken','SliderStep',[0.01,0.1],'String','15','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp15','Callback','')
handles.resp16=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0288432,0.1595208,0.0802571,0.0527157],'Relief','sunken','SliderStep',[0.01,0.1],'String','16','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp16','Callback','')
handles.resp17=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1066581,0.1627157,0.0828278,0.0479233],'Relief','sunken','SliderStep',[0.01,0.1],'String','17','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp17','Callback','')
handles.resp18=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1928021,0.1625879,0.0815424,0.0463259],'Relief','sunken','SliderStep',[0.01,0.1],'String','18','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp18','Callback','')
handles.resp19=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.27,0.1643131,0.0815424,0.0479233],'Relief','sunken','SliderStep',[0.01,0.1],'String','19','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp19','Callback','')
handles.resp20=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.351671,0.1659105,0.0789717,0.0479233],'Relief','sunken','SliderStep',[0.01,0.1],'String','20','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp20','Callback','')
handles.resp21=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0288432,0.1098403,0.0789717,0.0495208],'Relief','sunken','SliderStep',[0.01,0.1],'String','21','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp21','Callback','')
handles.resp22=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1115424,0.1086901,0.076401,0.0495208],'Relief','sunken','SliderStep',[0.01,0.1],'String','22','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp22','Callback','')
handles.resp23=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1870437,0.1098403,0.0853985,0.0527157],'Relief','sunken','SliderStep',[0.01,0.1],'String','23','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp23','Callback','')
handles.resp24=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2712853,0.1130351,0.0789717,0.0495208],'Relief','sunken','SliderStep',[0.01,0.1],'String','24','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp24','Callback','')
handles.resp25=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.8,0.8],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3521851,0.1101597,0.0802571,0.0511182],'Relief','sunken','SliderStep',[0.01,0.1],'String','25','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','resp25','Callback','')
//mostrar los 25 valores de Pn
handles.mostrar=uicontrol(f,'unit','normalized','BackgroundColor',[0.045,0.55,0.59],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[24],'FontUnits','points','FontWeight','normal','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0252509,0.38088239,0.0206327,0.0326087],'Relief','flat','SliderStep',[0.01,0.1],'String','','Style','checkbox','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','mostrar','Callback','chechBox1_callback(handles)')
handles.close=uicontrol(f,'unit','normalized','BackgroundColor',[0.8,0.3,0.3],'Enable','on','FontAngle','normal','FontName','helvetica','FontSize',[12],'FontUnits','points','FontWeight','bold','ForegroundColor',[0,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.8084375,0.0688239,0.111739130435,0.054794520548],'Relief','raised','SliderStep',[0.01,0.1],'String','Cerrar','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','close','Callback','close_callback(handles)')
handles=resume(handles);
endfunction
//////////
// Callbacks are defined as below. Please do not delete the comments as it will be used in coming version
//////////






function inicio_callback(handles)
l=findobj('Tag','lamda1');m1=findobj('Tag','miu1');s=findobj('Tag','servidores1');N=findobj('Tag','clientes1');
lq1=findobj('Tag','lq');pn1=findobj('Tag','pn');rh1=findobj('Tag','rho');w1=findobj('Tag','w');wq1=findobj('Tag','wp');L1=findobj('Tag','L');
comenzar=1;
//validacion
if(get(l,'String')~=''&get(m1,'String')~=''&get(s,'String')~='') then
///
 lm=gettext(l.String);lmb=evstr(lm);
 mi=gettext(m1.String);miu=evstr(mi);
 sr=gettext(s.String);srv=evstr(sr);
 Nu=gettext(N.String);Nuc=evstr(Nu);
 rstg=miu*srv;
 if lmb < rstg  then
 

   r=lmb/(srv*miu);
    //Suposicion de modelo M/M/s en el nodo
    //Calculamos el vector c
    c=ones(1,srv);
    for i=2:srv
      c(i)=c(i-1)*lmb/((i-1)*miu);
    end
   c_mayor_s = c(srv)*lmb/(srv*miu-lmb);
   //Calcula el valor de p(0)
   Po=1/(sum(c)+c_mayor_s);

    //Calcula el valor de p(n)
    if Nuc<srv then
      Pn=c(Nuc+1)*Po;
    else
      pmax=c(srv)*Po;
      xn=Nuc-srv+1;
      Pn=[((lmb/(srv*miu)))^xn]*pmax;
    end
    //proceso de calculo
   Lq=(c_mayor_s*lmb*Po)/(srv*miu-lmb);
   Wq=Lq/lmb;
   W=Wq+(1/miu);
   L=lmb*W;
   E=W*miu;
   lq1.string=string(Lq);
   wq1.string=string(Wq);
   w1.string=string(W);
   L1.string=string(L);
   pn1.string=string(Pn);
   rh1.string=string(r);
   set(handles.efi,'String',string(E));
   graficarW();
   //bucle para Pn de 25 clientes
   op=evstr(get(handles.mostrar, 'Value'));
   if op==1 then
    i=0;
    Ptot=ones(1,25);
    for i=1:25
     if i<srv then
      Ptot(1,i)=c(i+1)*Po;
    else
      pmax=c(srv)*Po;
      xn=i-srv+1;
      Ptot(1,i)=[((lmb/(srv*miu)))^xn]*pmax;
    end   
    end
    Pt=string(Ptot);
  //imprimiendo los Pn en la Matriz
 set(handles.resp1,'string',Pt(1,1)); set(handles.resp2,'string',Pt(1,2)); 
 set(handles.resp3,'string',Pt(1,3)); set(handles.resp4,'string',Pt(1,4)); 
 set(handles.resp5,'string',Pt(1,5)); set(handles.resp6,'string',Pt(1,6)); 
 set(handles.resp7,'string',Pt(1,7)); set(handles.resp8,'string',Pt(1,8)); 
 set(handles.resp9,'string',Pt(1,9)); set(handles.resp10,'string',Pt(1,10)); 
 set(handles.resp11,'string',Pt(1,11)); set(handles.resp12,'string',Pt(1,12)); 
 set(handles.resp13,'string',Pt(1,13)); set(handles.resp14,'string',Pt(1,13)); 
 set(handles.resp15,'string',Pt(1,15)); set(handles.resp16,'string',Pt(1,16)); 
 set(handles.resp17,'string',Pt(1,17));set(handles.resp18,'string',Pt(1,18)); 
 set(handles.resp19,'string',Pt(1,19)); set(handles.resp20,'string',Pt(1,20));
 set(handles.resp21,'string',Pt(1,21));
 set(handles.resp22,'string',Pt(1,22)); 
 set(handles.resp23,'string',Pt(1,23));
 set(handles.resp24,'string',Pt(1,24));
 set(handles.resp25,'string',Pt(1,25));
else 
    
    limpiar();
 end
else
    messagebox(["El valor de Lambda deber ser menor ","que el producto entre s(miu)"],"No se puede Calcular","error");
 end   
    else
    messagebox(["No ha ingresado los datos completos ","para realizar los calculos"],"Datos No Ingresados","error");
    
end 
    
endfunction


function new_callback(handles)
//Write your callback for  new  here
set(handles.lamda1,'string','');
set(handles.miu1,'string','');
set(handles.servidores1,'string','');
set(handles.clientes1,'string','');
set(handles.rho,'string','');
set(handles.L,'string','');
set(handles.lq,'string','');
set(handles.w,'string','');
set(handles.wp,'string','');
set(handles.pn,'string','');
set(handles.efi,'string','');
if ~isempty(handles.graficapnt.children) then
                 delete(handles.graficapnt.children);
       end
limpiar();
endfunction

function ok_callback(handles)
 obt1=findobj('Tag','tm1');
 wtmp=findobj('Tag','rwt');
 l=findobj('Tag','lamda1');m1=findobj('Tag','miu1');s=findobj('Tag','servidores1');
 lmb=evstr(gettext(l.String));miu=evstr(gettext(m1.String));srv=evstr(gettext(s.String));  
    if (get(obt1,'String')~='') then
        
        t=evstr(gettext(obt1.String));    
        c=ones(1,srv);
        for i=2:srv;
        c(i)=c(i-1)*lmb/((i-1)*miu);
        end
        c_mayor_s = c(srv)*lmb/(srv*miu-lmb);
        //Calcula el valor de p(0)
        Po=1/(sum(c)+c_mayor_s);
        wq0=1-c_mayor_s*Po;
        if (lmb/miu == (srv-1))
         Wt=1-(1+c_mayor_s*Po*t*miu)*exp(-miu*t);
         
      else
         Wt=1+(lmb-srv*miu+miu*wq0)/(srv*miu-lmb-miu)*...
            exp(-(miu*t))+(c_mayor_s*miu*Po)/(srv*miu-lmb-miu)*...
            exp(-(srv*miu-lmb)*t);
         
         end
      if Wt<0 then
          Wt2=0;
      else
          Wt2=Wt;
      end
      wtmp.string=string(Wt2);
     else   
         messagebox("Debe ingresar un tiempo mayor que cero","Error","error");   
    end
    
endfunction  

function ok2_callback(handles)
    obt2=findobj('Tag','tm2');
    wqtmp=findobj('Tag','rwqt'); 
    l=findobj('Tag','lamda1');m1=findobj('Tag','miu1');s=findobj('Tag','servidores1');
    lmb=evstr(gettext(l.String));miu=evstr(gettext(m1.String));srv=evstr(gettext(s.String));
    if (get(obt2,'String')~='') then
      t=evstr(gettext(obt2.String));
        c=ones(1,srv);
        for i=2:srv
        c(i)=c(i-1)*lmb/((i-1)*miu);
        end
        c_mayor_s = c(srv)*lmb/(srv*miu-lmb);
        //Calcula el valor de p(0)
        Po=1/(sum(c)+c_mayor_s);
      Wqt=1-c_mayor_s*Po*exp(-(srv*miu-lmb)*t);
      if Wqt<0 then
          Wqt2=0;
      else
          Wqt2=Wqt;
      end
      wqtmp.string=string(Wqt2);
   
   else   
         messagebox("Debe ingresar un tiempo mayor que cero","Error","error");   
    end
endfunction    

function ayu_callback(handles)
//Write your callback for  help  here
archivo=archivo+"Manuales/Manual_de_Usuario_Modelo_MMS.pdf";
    if isfile(archivo) then
        winopen(archivo);
    else
        messagebox("No se Encontro el Archivo",'ADVERTENCIA','info');
    end
endfunction

function limpiar()
set(handles.resp1,'string','1'); set(handles.resp2,'string','2'); 
 set(handles.resp3,'string','3'); set(handles.resp4,'string','4'); 
 set(handles.resp5,'string','5'); set(handles.resp6,'string','6'); 
 set(handles.resp7,'string','7'); set(handles.resp8,'string','8'); 
 set(handles.resp9,'string','9'); set(handles.resp10,'string','10'); 
 set(handles.resp11,'string','11'); set(handles.resp12,'string','12'); 
 set(handles.resp13,'string','13'); set(handles.resp14,'string','13'); 
 set(handles.resp15,'string','14'); set(handles.resp16,'string','16'); 
 set(handles.resp17,'string','17');set(handles.resp18,'string','18'); 
 set(handles.resp19,'string','19'); set(handles.resp20,'string','20');
 set(handles.resp21,'string','21');
 set(handles.resp22,'string','22'); 
 set(handles.resp23,'string','23');
 set(handles.resp24,'string','24');
 set(handles.resp25,'string','25');
 //graficas valores wt wqt y los Pn plot
  set(handles.tm1,'string',''); set(handles.tm2,'string','');
   set(handles.rwqt,'string',''); set(handles.rwt,'string','');
    set(handles.dts,'string','');  set(handles.dts2,'string','');   
    
    
endfunction


function graficarW()
l=get(handles.lamda1,'String');
m1=get(handles.miu1,'String');s=get(handles.servidores1,'String');
tm1=get(handles.tm1,'String'); tm2=get(handles.tm2,'String');
    lmb=evstr(l);miu=evstr(m1);srv=evstr(s);
    if (tm1==''& tm2=='') then
        t=1;tt=0;
    else
        t=evstr(tm1);
        tt=evstr(tm2);
    end
    t1=t;
    t2=tt;
    x=linspace(t1,t2,100);
       c=ones(1,srv);
        for i=2:srv
        c(i)=c(i-1)*lmb/((i-1)*miu);
        end
        c_mayor_s = c(srv)*lmb/(srv*miu-lmb);
        //Calcula el valor de p(0)
        Po=1/(sum(c)+c_mayor_s);
        //Calcula Wq(t)
        Wqt = 1-c_mayor_s*Po*exp(-(srv*miu-lmb)*x);
   
        wq0 = 1-c_mayor_s*Po;
      
        //Calcula W(t)
        if (lmb/miu == (srv-1))
        Wt = 1-(1+c_mayor_s.*(Po.*x)*miu).*exp(-(miu.*x));
        else
          Wt = 1+...
            (lmb-srv*miu+miu*wq0)/(srv*miu-lmb-miu)*...
            exp(-(miu*x))+...
            (c_mayor_s*miu*Po)/(srv*miu-lmb-miu)*...
            exp(-(srv*miu-lmb)*x);
        end
        clear wq_cero;
        for i=1:length(Wt)
         if (Wt(i)<0)
            Wt(i)=0;
         end
        end
    
    for i=1:length(Wqt)
        if (Wqt(i)<0)
            Wqt(i)=0;
        end
    end
        
if ~isempty(handles.graficapnt.children) then delete(handles.graficapnt.children);end
plot(x,Wt,'r-',x,Wqt,'b'); 
xgrid;
   
endfunction
function PlotP_callback(handles)
    DibujaP();
endfunction
function DibujaP()
//Recibe el valor de los indices que forman el intervalo
indice_1_n = get(handles.dts, 'String');indice_1_n = evstr(indice_1_n);
indice_2_n = get(handles.dts2, 'String');indice_2_n = evstr(indice_2_n);
lmba=get(handles.lamda1, 'String');lambda_n=evstr(lmba);
mu=get(handles.miu1, 'String');mu_n=evstr(mu);
sn=get(handles.servidores1, 'String');s_n=evstr(sn);
//Comprueba que el valor de los indices es mayor o igual a cero y
//que el segundo indice es mayor que el primero
if (get(handles.dts, 'String')~=''&get(handles.dts2, 'String')~='')
if (indice_1_n>=0 & indice_2_n>0 & indice_2_n>indice_1_n)
//Comprueba que los indices son numeros enteros
	if (ceil(indice_1_n) == indice_1_n & floor(indice_1_n) == indice_1_n & ...
       ceil(indice_2_n) == indice_2_n & floor(indice_2_n) == indice_2_n)
       //empecemos
       c=ones(1,s_n);
    for i=2:s_n
      c(i)=c(i-1)*lambda_n/((i-1)*mu_n);
    end
   c_mayor_s = c(s_n)*lambda_n/(s_n*mu_n-lambda_n);
   //Calcula el valor de p(0)
   p_cero=1/(sum(c)+c_mayor_s);
       if indice_1_n>=s_n //indice_1 es mayor o igual que s
   	      	   p_max=c(s_n)*p_cero;
               p_varios=((lambda_n/(s_n*mu_n))^(indices-s_n+1))*p_max;
               
               clear p_max;
         
	      	elseif indice_2_n<s_n //indice_2 es menor o igual que s
   	   	        p_varios = c(indices+1)*p_cero;
         
      		else  //indice_1 e indice_2 tienen a s en el medio
         		rango1=indice_1_n:(s_n-1);
         		p_varios_1 = c(rango1+1)*p_cero;
         
         		rango2=s_n:indice_2_n;
         		p_max=c(s_n)*p_cero;
	         	p_varios_2 = ((lambda_n/(s_n*mu_n))^(rango2-s_n+1))*p_max;         
         
               p_varios=cat(2,p_varios_1,p_varios_2);
               
               clear rango1;
               clear p_varios_1;
               clear rango2;
               clear p_max;
               clear p_varios_2;
    
           if ~isempty(handles.graficapnt.children) then delete(handles.graficapnt.children);end 
           bar(indice_1_n:indice_2_n,p_varios);
        title('Grafica de p(i)')  ;
       end         
    else
      messagebox("Debe ingresar numeros enteros","Error","error")
    end
else
    messagebox("Debe ingresar clientes de menor a mayor","Error","error")
end  
else
    messagebox("Debe proporcionar valores antes de oprimir el boton","Error","error")
end
         
endfunction
function close_callback(handles)
  close();          
endfunction  
function chechBox1_callback(handles)
  
            
endfunction    
