------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Cheddar is a GNU GPL real-time scheduling analysis tool. -- This program provides services to automatically check schedulability and -- other performance criteria of real-time architecture models. -- -- Copyright (C) 2002-2020, Frank Singhoff, Alain Plantec, Jerome Legrand, -- Hai Nam Tran, Stephane Rubini -- -- The Cheddar project was started in 2002 by -- Frank Singhoff, Lab-STICC UMR 6285, Université de Bretagne Occidentale -- -- Cheddar has been published in the "Agence de Protection des Programmes/France" in 2008. -- Since 2008, Ellidiss technologies also contributes to the development of -- Cheddar and provides industrial support. -- -- The full list of contributors and sponsors can be found in AUTHORS.txt and SPONSORS.txt -- -- 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$ -- $Date$ -- $Author: singhoff $ ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ with Ada.Numerics.Float_Random; use Ada.Numerics.Float_Random; with Ada.Numerics.Aux; use Ada.Numerics.Aux; package Random_Tools is -- return a random parameter between min and max -- function Get_Rand_Parameter (Min : in Natural; Max : in Natural; Seed : in Generator) return Natural; function Get_Rand_Parameter (Min : in Double; Max : in Double; Seed : in Generator) return Double; -- generate poisson inter arrival time (different from 0) -- function Get_Exponential_Time (Arrival_Rate : in Double; Seed : in Generator) return Double; -- return an uniform random value between 0 and 1 -- function Drand48 return Long_Float; pragma Import (C, Drand48); -- Initialize a seed with "value" -- procedure Srand48 (Value : in Integer); pragma Import (C, Srand48); -- UUniFast by Bini -- type Float_Array is array(Integer range<>) of Float; type Integer_Array is array(Integer range<>) of Integer; function Gen_UUniFast (n : in Integer; -- Number of task U : in Float) -- Processor utilization return Float_Array; -- Float array of task utilizations function Gen_UUniFast (n : in Integer; -- Number of task U : in Integer) -- Processor utilization return Integer_Array; -- Integer array of task utilizations -- This function is Based on Goossens, J., & Macq, C. (2001). -- Limitation of the hyper-period in real-time periodic task set generation. -- In Proceedings of the RTS Embedded System (RTS’01). -- that generates a set of periods whose hyperperiod is limited -- function Generate_Period_set_with_Limited_HyperPeriod (N_Tasks : in Integer; N_Different_Periods : in Integer) return Integer_Array; function Generate_Distinct_Periods (n : in integer) return Integer_Array; end Random_Tools;