首页 >
> 详细

GA Phase 2

Dear Students,

Below are the requirements for phase 2 of the project. As mentioned, this phase is about random solution generation. For this phase 2 (Random) and phase 3 (GA) to come, you are to use the same set of 3 inputs (small, medium, large sized) that you used in Phase 1 (brute force). You will be testing two random number generators:

a)Math.random() gives a random double from 0.0 (inclusive) to 1.0 (exclusive). See https://mkyong.com/java/java-generate-random-integers-in-a-range/

b) to generalize to numbers in a range other than 0..1

b) a generator based on the Blum-Blum-Shub (BBS) method. See https://www.commonlounge.com/discussion/481152258acb4003a5903d2fc1bc425f for a detailed description of the BBS method.

I will summarize the BBS algorithm now. This second generator has 3 parameters P, Q and X0. X0 is the "seed", the first number of the sequence as an input to get other numbers in the sequence (ie X0 is not used by your code; it's only purpose is to start things off.) For example, Let X0 = 127.

Set N = P*Q. As an example let P = 67 and Q = 79 so that N = 67 × 79 = 5293. Then, the sequence will be generated iteratively by the following "iterative" formula:

Xi+1 = (Xi)^2 % N where ^ is raised to the power and % is the mod function. NOTE: that the Xi are only integers in the iterative generation of the sequence; HOWEVER, when using them, we are going to use it slightly differently since we are generating numbers between 0 and 1. You will take the integer generated and put a decimal point on the left. So, if Xi+1 = 250, then your code will output 0.250; if Xi+1 = 4277, then your code will output 0.4277 and finally, if Xi+1 = 121, then your code will output 0.121 (Note: The above is a slightly simplified version of BBS.)

IMPORTANT REMINDER: for the purposes of generating the sequence, you only use the integers as is, but the way you will utilize these numbers is to generate a number between 0 and 1 where the decimal points are the digits of the integer as explained above. The numbers of the sequence generated discussed above (250, 4277, 121) would actually be generated if X0 = 127. Namely, 127^2 (mod 5293) is 250; 250^2 (mod 5293) is 4277; and, 4277^2 (mod 5293) is 121. Thus, the sequence generated will be 250; 4277; 121; however, you will interpret these numbers as 0.250; 0.4277; 0.121 in order to accommodate a real number between 0 and 1.

Now, for each of the sets of input data you have from phase 1, you should generate at least 10000 random "solutions" to your problem, with a population of at least 1000 and ran for a minimum of 10 generations. You will need to define a fitness function for your problem whose maximum value would be from a brute-force solution and then keep track of the maximum fitness (and the solution that obtained it) and identify the minimum and average fitnesses for the all the guesses (random solutions) you generated. You will need to do this for both Math.random() based generator and BBS based generators separately (10000 guessed solutions for each) and for each of the input data sets, output the best random solution obtained by Math.random(), the best random solution obtained by BBS and their fitnesses. Please also include a brute force solution from phase 1 for each of these input data sets and compute the fitness of those as well. Sincerely, Professor

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp

- 代写cmpt 214编程、代做programming语言、代写c/C++程序 2020-11-08
- 代写csci 2122课程、代做program编程实验、C++程序语言代写代 2020-11-08
- Fit5032语言编程代做、代写web程序实验、Web、Html程序语言代做 2020-11-08
- Com3503程序编程代做、Java，C++，Python留学生编程代写代写 2020-11-08
- 代写program程序课程、代写c++编程实验、C/C++编程语言代做 代做 2020-11-08
- Data留学生编程代做、代写python程序、Java，C++程序语言代写 2020-11-08
- 代写secj 1023实验编程、Programming程序代做、代写c++语 2020-11-08
- 代写cmpsc 465编程、代做java程序语言、Python，C++编程设 2020-11-07
- 代做mf 703语言编程、代写programming程序、Sql编程语言调试 2020-11-07
- 954246编程设计调试、代做programming程序、C++编程语言代写 2020-11-07
- Pstat 115程序实验代写、R编程语言调试、Data留学生程序代做 代写 2020-11-07
- Com1005课程编程代做、代写python程序、Java，C++程序语言调 2020-11-07
- Tcp留学生程序代写、Java程序设计调试、Java编程语言代写 帮做r语言 2020-11-07
- 代写program语言编程、代做data留学生程序、Python，Java编 2020-11-07
- 代做cosc2666编程、代写programming程序、C/C++程序语言 2020-11-07
- Digital编程设计代写、代做r程序实验、代写r留学生程序 调试matla 2020-11-07
- 代写programming程序实验、R程序语言调试、Data课程编程代做 代 2020-11-07
- Comp104-17B程序代写、代做c++编程实验、C++程序语言调试 帮做 2020-11-07
- Csc8501课程程序代做、C++编程语言调试、代写program编程课程 2020-11-07
- 代写css3留学生程序、代做html、Css编程语言、Data课程程序代做 2020-11-07