Initializing with conway
This commit is contained in:
parent
82bcd85852
commit
8c93942fb6
|
|
@ -29,7 +29,8 @@ public class Simulator extends Thread {
|
||||||
private boolean loopingBorder;
|
private boolean loopingBorder;
|
||||||
private boolean clickActionFlag;
|
private boolean clickActionFlag;
|
||||||
private int loopDelay = 150;
|
private int loopDelay = 150;
|
||||||
private ArrayList<Integer> ruleSurviveCriteria= new ArrayList<Integer>() ;
|
private ArrayList<Integer> ruleSurviveCriteria= new ArrayList<Integer>();
|
||||||
|
|
||||||
private ArrayList<Integer> ruleBirthCriteria=new ArrayList<Integer>() ;
|
private ArrayList<Integer> ruleBirthCriteria=new ArrayList<Integer>() ;
|
||||||
//Rules rule = new Rules();
|
//Rules rule = new Rules();
|
||||||
//TODO : add missing attribute(s)
|
//TODO : add missing attribute(s)
|
||||||
|
|
@ -42,13 +43,16 @@ public class Simulator extends Thread {
|
||||||
clickActionFlag=false;
|
clickActionFlag=false;
|
||||||
cells = new ArrayList<ArrayList<Cell>>();
|
cells = new ArrayList<ArrayList<Cell>>();
|
||||||
newCells = new ArrayList<ArrayList<Cell>>();
|
newCells = new ArrayList<ArrayList<Cell>>();
|
||||||
|
|
||||||
agents = new ArrayList<Agent>();
|
agents = new ArrayList<Agent>();
|
||||||
fieldBirthValues = new ArrayList<Integer>();
|
fieldBirthValues = new ArrayList<Integer>();
|
||||||
fieldSurviveValues = new ArrayList<Integer>();
|
fieldSurviveValues = new ArrayList<Integer>();
|
||||||
|
|
||||||
//TODO : add missing attribute initialization
|
//TODO : add missing attribute initialization
|
||||||
|
|
||||||
|
ruleSurviveCriteria.add(2);//initializing system with conway rule
|
||||||
|
ruleSurviveCriteria.add(3);
|
||||||
|
ruleBirthCriteria.add(3);
|
||||||
//initialize grid with dead cells
|
//initialize grid with dead cells
|
||||||
for(int x=0; x < getWidth();x++) {
|
for(int x=0; x < getWidth();x++) {
|
||||||
ArrayList<Cell> arrayCell = new ArrayList<Cell>(); //initialize first dimension with ArrayLists
|
ArrayList<Cell> arrayCell = new ArrayList<Cell>(); //initialize first dimension with ArrayLists
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue