🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #309629

Rozkład odwrotnie proporcjonalny

#309629
From: Borneq
Date: Sun, 28 Jan 2018 22:37
17 lines
1526 bytes
Weźmy rozkład zwykły:
	default_random_engine dre(random_device{}());
	uniform_int_distribution<int> id(10, 1000);
	this_thread::sleep_for(chrono::milliseconds(id(dre)));

tutaj średni czas będzie wynosił 550 ms
Co bym chciał zrobić:
rozkład, gdzie czas 1000 ms występuje 10 razy rzadziej niż 100 ms, a 
jeszcze mniejszy czas, częściej.
Czy do tego wystarczy rozkład Poissona
http://en.cppreference.com/w/cpp/numeric/random/poisson_distribution
	std::random_device rd;
	std::mt19937 gen(rd());
  	std::poisson_distribution<> d(4);
	d(gen)
Jakie znaczenie ma liczba 4? Jest to wartość najczęściej występująca i 
może losować liczby zmiennoprzecinkowe np. 3.5 ?
Technical Details
Message-ID: <p4ljba$s91$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.lang.c
Subject: Rozkład odwrotnie proporcjonalny
Date: Sun, 28 Jan 2018 23:37:29 +0100
Organization: ATMAN - ATM S.A.
Lines: 17
Message-ID: <p4ljba$s91$1@node2.news.atman.pl>
NNTP-Posting-Host: public-gprs350495.centertel.pl
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1517179050 28961 37.47.0.96 (28 Jan 2018 22:37:30 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Sun, 28 Jan 2018 22:37:30 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2
X-Mozilla-News-Host: news://news.atman.pl:119
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit