%% Comparing Routing Policies

% Copyright 2008-2011 The MathWorks, Inc.

%% Overview
% This example shows to compare routing policies. 
% The model contains three similar queuing systems in parallel, each with a
% different routing policy.

  modelname = 'sedemo_routing_policies';
  open_system(modelname);
  set_param([modelname '/Average System Time'],'open', 'off' );

%% Structure
% This model compares the queuing system under three routing policies given
% below:
%
% * Shortest Queue:	Each entity advances to the shortest queue
%
% * Probabilistic:	Each entity is randomly routed to a queue
%
% * Round robin:	Entities alternate between the two queues

%% Results And Displays
% The plot compares the average system time (end-to-end delay) to
% show the optimality of the Shortest Queue policy when all service
% time distributions are exponential. If this assumption is violated, a
% Shortest Queue policy is not necessarily optimal.
  
  set_param([modelname '/Average System Time'],'open', 'on' );
  sim(modelname);
  
%% Related Examples
% * <matlab:showdemo('sedemo_single_v_multi_queue') Comparing Queue-Server Combinations>
% * <matlab:showdemo('sedemo_preempt_policy') Comparing Server Preemption Policies>
% * <matlab:simeventsdemohelp('sedemo_priority_policies') Comparing Prioritized Queuing Policies>

%% 
%cleanup
bdclose(modelname);
clear modelname;
displayEndOfDemoMessage(mfilename)
