Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1BF7095DA for ; Fri, 4 Nov 2011 17:10:16 +0000 (UTC) Received: (qmail 84303 invoked by uid 500); 4 Nov 2011 17:10:14 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 84221 invoked by uid 500); 4 Nov 2011 17:10:14 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 84180 invoked by uid 99); 4 Nov 2011 17:10:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 17:10:14 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2011 17:10:12 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 90613331CA0 for ; Fri, 4 Nov 2011 17:09:51 +0000 (UTC) Date: Fri, 4 Nov 2011 17:09:51 +0000 (UTC) From: "Phil Steitz (Commented) (JIRA)" To: issues@commons.apache.org Message-ID: <33024321.365.1320426591592.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <503227206.55673.1320326856574.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (MATH-701) Seeding a default RNG MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/MATH-701?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13144170#comment-13144170 ] Phil Steitz commented on MATH-701: ---------------------------------- I thought about changing the default seeding in AbstractWell and agree that would be a good idea. I still like to supply the seed explicitly and document it in RandomDataImpl, though, so users of that class know exactly what they are getting by default. There is a little wrinkle here, too that keeping the seeding expressed and documented in RandomDataImpl makes easier to keep track of. If we ever implement hashcode in RandomDataImpl (or the Well generators), things could get messed up if it does not separate generator instances the way the system identity haschcode does. > Seeding a default RNG > --------------------- > > Key: MATH-701 > URL: https://issues.apache.org/jira/browse/MATH-701 > Project: Commons Math > Issue Type: Bug > Reporter: Gilles > Assignee: Gilles > Fix For: 3.0 > > > In "RandomDataImpl": > {code} > private RandomGenerator getRan() { > if (rand == null) { > rand = new JDKRandomGenerator(); > rand.setSeed(System.currentTimeMillis()); > } > return rand; > } > {code} > The conditional branch is used by "sample()" in "AbstractContinuousDistribution". > When several "...Distribution" objects are instantiated in a short time interval, they are seeded with the same value. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira