Blame view

src/preypredator/Test.java 780 Bytes
1b1e928cc   glaville   initial import of...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
  package preypredator;
  
  import java.util.Random;
  
  public class Test {
  	
  	public static final int grassDelay = 100;
  	public static final int preyGain = 50;
  	public static final int predGain = 50;
  	public static final float preyRepro = 0.2f;
  	public static final float predRepro = 0.1f;
  	
  	public int[][] grass;
  	public int[][] grassCounters;
  	
  	public int[][] preys;
  	public int[][] preds;
  	
  	public Test() {
  		Random rng = new Random();
  		
  		for (int i = 0; i < grass.length; i++) {
  			for (int j = 0; j < grass[i].length; j++) {
  				if (rng.nextBoolean()) {
  					grass[i][j] = 1;
  					grassCounters[i][j] = grassDelay;
  				} else {
  					grass[i][j] = 0;
  					grassCounters[i][j] = rng.nextInt(grassDelay);
  				}
  			}
  		}
  		
  		
  	}
  	
  	public static void main(String[] args) {
  	}
  
  }