------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real time scheduling analysis tool. -- This program provides services to automatically check performances -- of real time architectures. -- -- Copyright (C) 2002-2010, by Frank Singhoff, Alain Plantec, Jerome Legrand -- -- The Cheddar project was started in 2002 by -- the LISyC Team, University of Western Britanny. -- -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; either version 2 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -- -- -- Contact : cheddar@listes.univ-brest.fr -- ----------------------------------------------------------------------------- -- Last update : -- $Rev: 523 $ -- $Date: 2012-09-26 15:09:39 +0200 (Wed, 26 Sep 2012) $ -- $Author: fotsing $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; with primitive_xml_strings; use primitive_xml_strings; with access_lists; package Queueing_System.Simulation is package Generic_Index_Lst is new access_lists ( put => put, element => Double, element_ptr => double_ptr, free => double_util.free, copy => double_util.copy, xml_string => xml_string); use Generic_Index_Lst; type Generic_Queueing_System_Simulation is abstract new Generic_Queueing_System with record Service_Resp_Time : Resp_Time_Table_Ptr; -- simulation result Sim_Mit : Double; -- mean interarrival time Sim_Mst : Double; -- Mean service time Sim_Var_Mst : Double; -- Mean variance service time Sim_Mwt : Double; -- Mean waiting time Sim_Mnc : Double; -- Mean number of customer Rho : Double; -- utilisation of the qs -- service time computation variable during simulation (MP1) T_Arr : Double; Empty_Buffer : Boolean; end record; type Queueing_System_Simulation_Ptr is access all Generic_Queueing_System_Simulation'Class; procedure Initialize (A_Queueing_System : in out Generic_Queueing_System_Simulation); -- reset caracteristics of the qs (has to be done each time a qs is used) -- procedure Reset (A_Queueing_System : in out Generic_Queueing_System_Simulation); -- return the next service time -- function Compute_Service_Time (A_Queueing_System : in Generic_Queueing_System_Simulation; Seed : in Generator) return Double is abstract; -- return the next customer arrival date -- function Compute_Inter_Arrival_Time (A_Queueing_System : in Generic_Queueing_System_Simulation; Seed : in Generator) return Double is abstract; -- simulation of a queueing system : next arrival, next departure and -- compute st has to be defined for each QS -- * Simulation_Time : date of end of simulation relative to 0 -- * Consumer_Nb_Instance : number of consumer task job in an hyper period --( ex : MP1 simulation) -- procedure Simulate (A_Queueing_System : in out Generic_Queueing_System_Simulation'Class; Simulation_Time : in Double; Consumer_Nb_Instance : in Resp_Time_Consumer_Range); -- display the simulation results (mean service time, mean waiting time, --...) -- procedure Simulation_Results (A_Queueing_System : in Generic_Queueing_System_Simulation'Class); -- generate arrival rate and service rate of a qs : -- * Utilization : the utilization ot the qs -- * Max_Mu : the maximum service rate -- procedure Generate_Arrival_And_Service_Rate (A_Queueing_System : in out Generic_Queueing_System_Simulation'Class; Utilization : in Double; Seed : in Generator; Max_Mu : in Natural := 4000); end Queueing_System.Simulation;