source: java/ecj/app/othello/OthelloRandomPlayer1.java @ 42

Last change on this file since 42 was 42, checked in by mszubert, 14 years ago

refactored cecj; framsticks package added

File size: 516 bytes
Line 
1package cecj.app.othello;
2
3import java.util.Random;
4
5public class OthelloRandomPlayer1 extends OthelloPlayerFitnessCalculator {
6
7        private static final float WPC_POSITION_RANGE = 5;     
8       
9        @Override
10        protected OthelloPlayer getPlayer() {
11                double[] wpc = new double[WPC_LENGTH];
12                Random r = new Random(System.currentTimeMillis());
13               
14                for (int i = 0; i < WPC_LENGTH; i++) {
15                        wpc[i] = r.nextDouble() * WPC_POSITION_RANGE;
16                        if (r.nextBoolean()) {
17                                wpc[i] *= -1;
18                        }
19                }
20               
21                return new OthelloPlayer(wpc);
22        }
23
24}
Note: See TracBrowser for help on using the repository browser.