[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Random number seed generation

Subject: Re: Random number seed generation
From: Michel Hendriksen <michel.hendriksen@xxxxxxxxx>
Date: Thu, 9 Dec 2010 19:25:39 +0100
Re:  Random number seed generation
I see some possibilities like passing seed as parameter to templates
or within the data, which is at least partly regenerated each
generation in the evolution steps.

Most code is/will be recursive.

Michel

On Thu, Dec 9, 2010 at 4:37 PM, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> On 09/12/2010 14:04, Michel Hendriksen wrote:
>>
>> Hi all,
>>
>> I'm using Saxon9he processor XSLT 2.0, and I am trying to get some
>> random numbers. I'm currently using fxsl/random for this. The problem
>> is that it needs a seed.
>> I tried using current time stuff but that doesn't change during the
>> transfomation using the stylesheet.. So I tried an extension function
>> to cal to Java but that doesn't seem to work. Examples are probably
>> XSLT 1.0 but should be ok.
>>
>
> You need to organize your code so that all the random numbers come from a
> single sequence from a single seed; or alternatively, generate one random
> sequence and use the numbers from this as seeds for subsidiary random
> sequences.
>
> Can't tell you how to do that without knowing more about your code. It can
> be tricky - it may involve turning iterative code into recursive code.
>
> Michael Kay
> Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.