I'm not too fond of many conversions, but I cannot immediately judge whether it is a good idea here or not. However, I suggest a few other shortcuts, e.g.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
let normalRandomStream = 

    let scaledUniformStream = Seq.map (fun x -> 2.0 * x - 1.0 ) uniformRandomStream

    Seq.zip scaledUniformStream scaledUniformStream

    |> Seq.map_concat (fun (x,y) -> 

        let s = x*x + y*y

        if s>=1.0 then [] else

        let f = sqrt (-2.0 * log s / s)

        [x * f; y * f])

and the first 2 lines of createRandomSolution or more easily written as:

1
2
let min,max = problem.Range
By on 1/21/2009 7:59 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper