Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template hyperexponential_distribution

Boost , The Boost C++ Libraries BoostBook Documentation Subset , Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template hyperexponential_distribution

boost::random::hyperexponential_distribution

Synopsis

// In header: <boost/random/hyperexponential_distribution.hpp>
template<typename RealT = double> 
class hyperexponential_distribution {
public:
  // types
  typedef RealT result_type;
  typedef RealT input_type; 
  // member classes/structs/unions
  class param_type {
  public:
    // types
    typedef hyperexponential_distribution distribution_type;
    // construct/copy/destruct
    param_type();
    template<typename ProbIterT, typename RateIterT> 
      param_type(ProbIterT, ProbIterT, RateIterT, RateIterT);
    template<typename ProbRangeT, typename RateRangeT> 
      param_type(ProbRangeT const &, RateRangeT const &, 
                 typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type * = 0);
    template<typename RateIterT> 
      param_type(RateIterT, RateIterT, 
                 typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type * = 0);
    template<typename RateRangeT> param_type(RateRangeT const &);
    param_type(std::initializer_list< RealT >, std::initializer_list< RealT >);
    param_type(std::initializer_list< RealT >);
    // public member functions
    std::vector< RealT > probabilities() const;
    std::vector< RealT > rates() const;
    // friend functions
    template<typename CharT, typename Traits> 
      friend std::basic_ostream< CharT, Traits > & 
      operator<<(std::basic_ostream< CharT, Traits > &, const param_type &);
    template<typename CharT, typename Traits> 
      friend std::basic_istream< CharT, Traits > & 
      operator>>(std::basic_istream< CharT, Traits > &, const param_type &);
    friend bool operator==(const param_type &, const param_type &);
    friend bool operator!=(const param_type &, const param_type &);
  };
  // construct/copy/destruct
  hyperexponential_distribution();
  template<typename ProbIterT, typename RateIterT> 
    hyperexponential_distribution(ProbIterT, ProbIterT, RateIterT, RateIterT);
  template<typename ProbRangeT, typename RateRangeT> 
    hyperexponential_distribution(ProbRangeT const &, RateRangeT const &, 
                                  typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type * = 0);
  template<typename RateIterT> 
    hyperexponential_distribution(RateIterT, RateIterT, 
                                  typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type * = 0);
  template<typename RateRangeT> 
    hyperexponential_distribution(RateRangeT const &);
  explicit hyperexponential_distribution(param_type const &);
  hyperexponential_distribution(std::initializer_list< RealT > const &, 
                                std::initializer_list< RealT > const &);
  hyperexponential_distribution(std::initializer_list< RealT > const &);
  // public member functions
  template<typename URNG> RealT operator()(URNG &) const;
  template<typename URNG> RealT operator()(URNG &, const param_type &) const;
  std::size_t num_phases() const;
  std::vector< RealT > probabilities() const;
  std::vector< RealT > rates() const;
  RealT min() const;
  RealT max() const;
  param_type param() const;
  void param(param_type const &);
  void reset();
  // friend functions
  template<typename CharT, typename Traits> 
    friend std::basic_ostream< CharT, Traits > & 
    operator<<(std::basic_ostream< CharT, Traits > &, 
               const hyperexponential_distribution &);
  template<typename CharT, typename Traits> 
    friend std::basic_istream< CharT, Traits > & 
    operator>>(std::basic_istream< CharT, Traits > &, 
               const hyperexponential_distribution &);
  friend bool operator==(const hyperexponential_distribution &, 
                         const hyperexponential_distribution &);
  friend bool operator!=(const hyperexponential_distribution &, 
                         const hyperexponential_distribution &);
};

Description

Гиперэкспоненциальное распределение представляет собой реальное непрерывное распределение с двумя параметрами, вектором вероятности фазы probs и вектором rate rates.

-фазовое гиперэкспоненциальное распределение представляет собой смесь экспоненциальных распределений. По этой причине его также называют смешанным экспоненциальным распределением или параллельным. -фазовое экспоненциальное распределение.

А -фазовое гиперэкспоненциальное распределение характеризуется двумя параметрами, а именно вектором фазовой вероятности и вектором рейт .

A -фазовое гиперэкспоненциальное распределение часто используется в теории очередей для моделирования распределения суперпозиции независимых событий , как, например, распределение времени службы очередей станции с серверами параллельно, где -й сервер выбран с вероятностью и его распределение времени службы является экспоненциальным распределением со скоростью (Allen, 1990; Papadopolous et al., 1993; Trivedi, 2002).

Например, часто наблюдалось, что распределение рабочего времени процессоров в вычислительной системе обладает таким распределением (Rosin, 1965). Кроме того, прибытие различных типов клиентов на одну станцию очереди часто моделируется как гиперэкспоненциальное распределение (Papadopolous et al., 1993). Аналогичным образом, если продукт, изготовленный в нескольких параллельных линиях и выходы сливаются, плотность отказов общего продукта, вероятно, будет гиперэкспоненциальной (Trivedi,2002).

Наконец, поскольку гиперэкспоненциальное распределение демонстрирует высокий коэффициент вариации (CoV), то есть CoV > 1, оно особенно подходит для соответствия эмпирическим данным с большим CoV (Feitelson, 2014; Wolski et al., 2013) и для приближения распределений вероятности длинного хвоста (Feldmann et al., 1998).

См. (Boost, 2014) для получения дополнительной информации и примеров.

-фазовое гиперэкспоненциальное распределение имеет функцию плотности вероятности

Equation 30.1. 


где:

  • - это число фаз, а также размер входных векторных параметров,

  • является фазовым вектором вероятности и

  • - вектор скорости параметр.

Учитывая гиперэкспоненциальное распределение фазы с вектором фазовой вероятности и вектором скорости , алгоритм генерации случайных вариаций состоит из следующих этапов (Tyszer, 1999):

  1. Сгенерировать случайную величину равномерно распределить на интервале .

  2. Использовать для выбора подходящего (например, для этого шага можно использовать метод alias).

  3. Генерировать экспоненциально распределенную случайную величину с параметром скорости .

  4. Возврат

Ссылки:

  1. А.О. Аллен, Вероятность, статистика и теория очередей с применением компьютерных наук, второе издание , Академическая пресса, 1990.

  2. Увеличение библиотек C++ Буст.математика / Статистика Распространение: Hyperexponential Distribution, Online: http://www.boost.org/doc/libs/release/libs/math/doc/html/dist.html, 2014.

  3. Д.Г. Фейтельсон, Моделирование рабочей нагрузки для оценки производительности компьютерных систем, Cambridge University Press, 2014

  4. А. Фельдман и У. Уитт, Смесь экспоненциальных значений для длинных дистрибутивов для анализа моделей производительности сети , Оценка производительности 31(3-4):245, doi:10.1016/S0166-5316(97)00003-5, 1998.

  5. H.T. Papadopolous, C. Heavey and J. Browne Теория очередей в анализе и проектировании производственных систем, Chapman & Hall/CRC, 1993, p. 35.

  6. Р.Ф. Розин, Определение среды вычислительного центра , Коммуникации ACM 8(7):463-468, 1965.

  7. К.С. Триведи, Вероятность и статистика с надежностью, очередями и приложениями для компьютерных наук, John Wiley & Sons, Inc., 2002.

  8. Джей Тизер, Объектно-ориентированное компьютерное моделирование систем дискретных событий, Springer, 1999.

  9. Википедия, Hyperexponential Distribution, Online: http://en.wikipedia.org/wiki/Hyperexponential_distribution, 2014.

  10. Wolfram Mathematica Hyperexponential Distribution, Online: http://reference.wolfram.com/language/ref/HyperexponentialDistribution.html, 2014.

hyperexponential_distribution();

Constructs a 1-phase hyperexponential_distribution (i.e., an exponential distribution) with rate 1.

[ORIG_END] -->
  • template<typename ProbIterT, typename RateIterT> 
      hyperexponential_distribution(ProbIterT prob_first, ProbIterT prob_last, 
                                    RateIterT rate_first, RateIterT rate_last);

    Constructs a hyperexponential_distribution from the phase probability vector and rate vector parameters of the distribution.

    The phase probability vector parameter is given by the range defined by [prob_first, prob_last) iterator pair, and the rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair.

    References:

    1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

    Параметры:

    prob_first

    prob_first

    [ORIG_END] -->

    Итератор к началу диапазона неотрицательных реальных элементов, представляющих фазовые вероятности; если элементы не суммируются до 1, они нормализуются.

    prob_last

    Итератор до конца диапазона неотрицательных реальных элементов, представляющих фазовые вероятности; если элементы не суммируются до 1, они нормализуются.

    rate_first

    Итератор к началу диапазона неотрицательных реальных элементов, представляющих ставки.

    rate_last

    Итератор до конца диапазона неотрицательных реальных элементов, представляющих ставки.

  • Параметры шаблонов:

    ProbIterT

    ProbIterT

    [ORIG_END] -->

    Должен соответствовать требованиям концепции InputIterator (ISO,2014, с. 24.2.3 [input.iterators]).

    RateIterT

    Должны соответствовать требованиям концепции InputIterator (ISO,2014, с. 24.2.3 [input.iterators]).

  • template<typename ProbRangeT, typename RateRangeT> 
      hyperexponential_distribution(ProbRangeT const & prob_range, 
                                    RateRangeT const & rate_range, 
                                    typename boost::disable_if_c< boost::has_pre_increment< ProbRangeT >::value||boost::has_pre_increment< RateRangeT >::value >::type * = 0);

    Constructs a hyperexponential_distribution from the phase probability vector and rate vector parameters of the distribution.

    The phase probability vector parameter is given by the range defined by prob_range, and the rate vector parameter is given by the range defined by rate_range.

    [Note]Note

    The final disable_if parameter is an implementation detail that differentiates between this two argument constructor and the iterator-based two argument constructor described below.

    Параметры:

    prob_range

    The range of non-negative real elements representing the phase probabilities; if elements don't sum to 1, they are normalized.

    rate_range

    The range of positive real elements representing the rates.

    Параметры шаблонов:

    ProbRangeT

    Must meet the requirements of Range concept.

    RateRangeT

    Must meet the requirements of Range concept.

  • template<typename RateIterT> 
      hyperexponential_distribution(RateIterT rate_first, RateIterT rate_last, 
                                    typename boost::enable_if_c< boost::has_pre_increment< RateIterT >::value >::type * = 0);

    Constructs a hyperexponential_distribution from the rate vector parameter of the distribution and with equal phase probabilities.

    The rate vector parameter is given by the range defined by [rate_first, rate_last) iterator pair, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length of the rate vector and with each element set to ).

    [Note]Note

    The final disable_if parameter is an implementation detail that differentiates between this two argument constructor and the range-based two argument constructor described above.

    Ссылки:

    1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

    Параметры:

    rate_first

    rate_first

    [ORIG_END] -->

    Итератор к началу диапазона неотрицательных реальных элементов, представляющих ставки.

    rate_last

    Итератор до конца диапазона неотрицательных реальных элементов, представляющих ставки.

    Параметры шаблонов:

    RateIterT

    Должен соответствовать требованиям концепции InputIterator (ISO,2014, с. 24.2.3 [input.iterators]).

  • Поставляет param_type из параметров «рейт» распределения и с равными фазовыми вероятностями.

    The rate option is given by the range defined by rate_range, and the Phase вектор параметр установлен на равные фазовые вероятности (i.e., к вектору одинаковой длины

    Параметры:

    rate_range

    The range of positive real elements representing the rates.

    Параметры шаблона:

    RateRangeT

    Должны соответствовать требованиям Range

    Constructs a param_type from the "rates" parameters of the distribution and with equal phase probabilities.

    The rate vector parameter is given by the range defined by rate_range, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length of the rate vector and with each element set to ).

    Параметры:

    rate_range

    The range of positive real elements representing the rates.

    Параметры шаблонов:

    RateRangeT

    Must meet the requirements of Range concept.

    [ORIG_END] -->
  • Поставляет hyperexponential_distribution из своих параметров.

    Параметры:

    param

    Параметры распределения.

    Constructs a hyperexponential_distribution from its parameters.

    Параметры:

    param

    The parameters of the distribution.

    [ORIG_END] -->
  • hyperexponential_distribution(std::initializer_list< RealT > const & l1, 
                                  std::initializer_list< RealT > const & l2);

    Constructs a hyperexponential_distribution from the phase probability vector and rate vector parameters of the distribution.

    The phase probability vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l2.

    Ссылки:

    1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

    Параметры:

    l1

    Список инициализаторов для инизиализации вектора фазовой вероятности.

    l2

    Список инициализаторов для инизиализации вектора скорости.

  • Строит hyperexponential_distribution от rate вектор параметр распределения и с равными фазовыми вероятностями.

    The brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]), определяемый

    l, и

    Ссылки:

    1. ISO, ISO/IEC 14882-2014: Информационные технологии - Языки программирования - C++, 2014

      Constructs a hyperexponential_distribution from the rate vector parameter of the distribution and with equal phase probabilities.

      The rate vector parameter is given by the brace-init-list (ISO,2014,sec. 8.5.4 [dcl.init.list]) defined by l1, and the phase probability vector parameter is set to the equal phase probabilities (i.e., to a vector of the same length of the rate vector and with each element set to ).

      Ссылки:

      1. ISO, ISO/IEC 14882-2014: Information technology - Programming languages - C++, 2014

        [ORIG_END] -->

      Параметры:

      l1

      l1

      [ORIG_END] -->

      Список инициализаторов для инизиализации вектора скорости.

  • hyperexponential_distribution public member functions

    1. template<typename URNG> RealT operator()(URNG & urng) const;

      Gets a random variate distributed according to the hyperexponential distribution.

      Параметры:

      urng

      A uniform random number generator object.

      Параметры шаблонов:

      URNG

      Must meet the requirements of uniform random number generator .

      Returns:

      A random variate distributed according to the hyperexponential distribution.

    2. template<typename URNG> 
        RealT operator()(URNG & urng, const param_type & param) const;

      Gets a random variate distributed according to the hyperexponential distribution with parameters specified by param.

      Параметры:

      param

      A distribution parameter object.

      urng

      A uniform random number generator object.

      Параметры шаблонов:

      URNG

      Must meet the requirements of uniform random number generator .

      Returns:

      A random variate distributed according to the hyperexponential distribution. distribution with parameters specified by param.

    3. Возвращает количество фаз распространения.

      Returns the number of phases of the distribution.

      [ORIG_END] -->
    4. std::vector< RealT > probabilities() const;

      Returns the phase probability vector parameter of the distribution.

    5. Возвращает параметр rate вектор распространения.

      Returns the rate vector parameter of the distribution.

      [ORIG_END] -->
    6. Возвращает наименьшее значение, которое может произвести дистрибутив.

      Returns the smallest value that the distribution can produce.

      [ORIG_END] -->
    7. Возвращает крупнейшее значение, которое может произвести дистрибутив.

      Returns the largest value that the distribution can produce.

      [ORIG_END] -->
    8. Возвращает параметры распределения.

      Returns the parameters of the distribution.

      [ORIG_END] -->
    9. Задает параметры распределения.

      Sets the parameters of the distribution.

      [ORIG_END] -->
    10. void reset();

      Effects: Subsequent uses of the distribution do not depend on values produced by any engine prior to invoking reset.

    hyperexponential_distribution friend functions

    1. Написать hyperexponential_distribution на std::ostream.

      Writes an hyperexponential_distribution to a std::ostream.

      [ORIG_END] -->
    2. Reads an hyperexponential_distribution от std::istream.

      Reads an hyperexponential_distribution from a std::istream.

      [ORIG_END] -->
    3. friend bool operator==(const hyperexponential_distribution & lhs, 
                             const hyperexponential_distribution & rhs);

      Returns true if the two instances of hyperexponential_distribution will return identical sequences of values given equal generators.

    4. Правда возвратится, если два экземпляра hyperexponential_distribution вернут различные последовательности значений, данных равными генераторами.

      Returns true if the two instances of hyperexponential_distribution will return different sequences of values given equal generators.

      [ORIG_END] -->

    PrevUpHomeNext

    Статья Class template hyperexponential_distribution раздела The Boost C++ Libraries BoostBook Documentation Subset Reference может быть полезна для разработчиков на c++ и boost.




    Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



    :: Главная :: Reference ::


    реклама


    ©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
    Top.Mail.Ru

    Время компиляции файла: 2024-08-30 11:47:00
    2025-07-04 17:32:49/0.0083529949188232/0