Re: [racket] Newbie question on abstraction and the built in random function

2013-12-20 Thread Rian Shams
Matthew and Richard, Thanks a lot! Defining the encoding schemes as functions solves my problem. Richard, thank you for showing me a solution in the context of the function I have already built and Matthew, thank you for showing me solutions using map and for/list. I have learned a lot from your

Re: [racket] Newbie question on abstraction and the built in random function

2013-12-19 Thread Richard Cleis
You might want your encoding-scheme to be a function, and you want to evaluate that function inside generate-chromosome: (define (generate-chromosome encoding-scheme number-of-genes) (cond [(zero? number-of-genes) empty] [else (cons (encoding-scheme) (g

[racket] Newbie question on abstraction and the built in random function

2013-12-19 Thread Rian Shams
Hello All, I am new to Racket and just started building an evolutionary computing module to supplement my research and learn more about Racket. When it comes to representing a chromosome, there are many encoding schemes one can choose from. To start I would like to build a function that lets the