From 9ba015829db607e9f8daa37ecdd33f658094e404 Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Wed, 29 May 2024 20:57:50 +0200 Subject: [PATCH 1/9] non working getSaveState+randomfield --- src/backend/Simulator.java | 51 ++++++++++++++++++++++---------------- 1 file changed, 30 insertions(+), 21 deletions(-) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index b491400..2cb3f33 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -1,6 +1,6 @@ package backend; import java.util.ArrayList; - +import java.util.Random; import windowInterface.MyInterface; //import backend.Rules; @@ -50,7 +50,7 @@ public class Simulator extends Thread { //TODO : add missing attribute initialization - ruleSurviveCriteria.add(2);//initializing system with conway rule + ruleSurviveCriteria.add(2);//initializing system with Conway rule ruleSurviveCriteria.add(3); ruleBirthCriteria.add(3); //initialize grid with dead cells @@ -354,7 +354,22 @@ public class Simulator extends Thread { */ public ArrayList getSaveState() { //TODO : complete method with proper return - return null; + //We need to create an array of strings + //each string should be the sum of all int transformed to strings in each Arrays of int + ArrayList arrayLines=new ArrayList(); + for(int x=0;x stringArray) { //TODO : Same idea as other load methods, but for agent list - if(stringArray.size()<=0) { - System.out.println("empty agents file"); - return; - } - //TODO : remove previous rule (=emptying lists) - - - for(int x=0; x Date: Thu, 30 May 2024 15:54:40 +0200 Subject: [PATCH 2/9] Fix of MyInterface and thus getSaveState :) --- src/windowInterface/MyInterface.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/windowInterface/MyInterface.java b/src/windowInterface/MyInterface.java index 67ae441..9d23d2b 100644 --- a/src/windowInterface/MyInterface.java +++ b/src/windowInterface/MyInterface.java @@ -23,6 +23,7 @@ import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.awt.event.ActionEvent; public class MyInterface extends JFrame { @@ -326,7 +327,10 @@ public class MyInterface extends JFrame { String fileName=SelectFile(); if (fileName.length()>0) { ArrayList content = mySimu.getSaveState(); - writeFile(fileName, (String[]) content.toArray()); + + String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); + + writeFile(fileName, strArr); } } From 7ae1795911a114a2a22989dec381cd5feafd809a Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Thu, 30 May 2024 16:23:21 +0200 Subject: [PATCH 3/9] fixing the axes of the saveState --- src/backend/Simulator.java | 2 +- src/windowInterface/MyInterface.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 2cb3f33..4020aac 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -360,7 +360,7 @@ public class Simulator extends Thread { for(int x=0;x0) { ArrayList content = mySimu.getSaveState(); - String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); - writeFile(fileName, strArr); } } From d3efcf814026eebc2b20d4aeff0a49ac819635f8 Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Thu, 30 May 2024 16:42:36 +0200 Subject: [PATCH 4/9] saveRule implementation --- src/backend/Simulator.java | 20 ++++++++++++++++++-- src/windowInterface/MyInterface.java | 6 +++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 4020aac..3d31737 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -476,8 +476,24 @@ public class Simulator extends Thread { */ public ArrayList getRule() { //TODO : complete method with proper return - - return null; + ArrayList arrayline=new ArrayList(); + String lineOne=""; + for(int i=0;i lines) { diff --git a/src/windowInterface/MyInterface.java b/src/windowInterface/MyInterface.java index 623d4fe..1d1dc80 100644 --- a/src/windowInterface/MyInterface.java +++ b/src/windowInterface/MyInterface.java @@ -327,8 +327,7 @@ public class MyInterface extends JFrame { String fileName=SelectFile(); if (fileName.length()>0) { ArrayList content = mySimu.getSaveState(); - String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); - writeFile(fileName, strArr); + } } @@ -336,7 +335,8 @@ public class MyInterface extends JFrame { String fileName=SelectFile(); if (fileName.length()>0) { ArrayList content = mySimu.getRule(); - writeFile(fileName, (String[]) content.toArray()); + String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); + writeFile(fileName, strArr); } } From 70bbd4fdc3b848b9f35511ffb446bb6fe2ab07a1 Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Thu, 30 May 2024 18:21:20 +0200 Subject: [PATCH 5/9] clickaction name and clickaction changed to work with agents --- src/backend/Simulator.java | 58 ++++++++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 3d31737..fb2e95e 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -27,7 +27,7 @@ public class Simulator extends Thread { private boolean stopFlag; private boolean pauseFlag; private boolean loopingBorder; - private boolean clickActionFlag; + private int clickActionFlag; private int loopDelay = 150; private ArrayList ruleSurviveCriteria= new ArrayList(); @@ -40,7 +40,7 @@ public class Simulator extends Thread { stopFlag=false; pauseFlag=false; loopingBorder=false; - clickActionFlag=false; + clickActionFlag=0; cells = new ArrayList>(); newCells = new ArrayList>(); @@ -277,16 +277,29 @@ public class Simulator extends Thread { //TODO : complete method //if clickActionFlag = true then create an agent //else if flag = false then change value of cell - if(clickActionFlag) { + switch (clickActionFlag) { + case 0 : System.out.print(x ); System.out.println(y); - }else { - System.out.println(getAliveNeighbors(x, y, LIFE_AREA_RADIUS)); //print nb of neighbours + break; + case 1 : if(getCell(x, y)==0) { setCell(x, y, 1); }else {setCell(x, y, 0);} - } - + break; + case 2 : + if(getCell(x, y)==0) { + setCell(x, y, 1); + }else {setCell(x, y, 0);} + break; + case 3 : + if(getCell(x, y)==0) { + setCell(x, y, 1); + }else {setCell(x, y, 0);} + break; + default: + break; + } } /** @@ -463,7 +476,23 @@ public class Simulator extends Thread { public void toggleClickAction() { //TODO : complete method - clickActionFlag = !clickActionFlag; + switch (clickActionFlag) { + case 0: + clickActionFlag++; + break; + case 1: + clickActionFlag++; + break; + case 2: + clickActionFlag++; + break; + case 3: + clickActionFlag=0; + break; + default: + break; + } + } /** @@ -539,7 +568,18 @@ public class Simulator extends Thread { public String clickActionName() { // TODO : initially return "sheep" or "cell" // depending on clickActionFlag - return ""; + switch (clickActionFlag) { + case 0: + return "position"; + case 1: + return "cell"; + case 2: + return "sheep"; + case 3: + return "wolf"; + default: + return ""; + } } } From 3467b887ea69b34cbab7a87b96bbac8fd782de7e Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Thu, 30 May 2024 19:55:50 +0200 Subject: [PATCH 6/9] Agents can live and die according to their liveturn method --- src/backend/Sheep.java | 3 ++- src/backend/Simulator.java | 36 +++++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/backend/Sheep.java b/src/backend/Sheep.java index b05d141..6bd6985 100644 --- a/src/backend/Sheep.java +++ b/src/backend/Sheep.java @@ -32,11 +32,12 @@ public class Sheep extends Agent { public boolean liveTurn(ArrayList neighbors, Simulator world) { if(world.getCell(x, y)==1) { world.setCell(x, y, 0); + hunger-=2; } else { hunger++; } this.moveRandom(); - return hunger>10; + return hunger<10; } private void moveRandom() { diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index fb2e95e..f39a0aa 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -196,18 +196,25 @@ public class Simulator extends Thread { // only modify if sure of what you do // to modify agent behavior, see liveTurn method // in agent classes + ArrayList arrayDeadAgent=new ArrayList(); + int counter=0; for(Agent agent : agents) { - ArrayList neighbors = - this.getNeighboringAnimals( - agent.getX(), - agent.getY(), - ANIMAL_AREA_RADIUS); - if(!agent.liveTurn( - neighbors, - this)) { - agents.remove(agent); + + ArrayList neighbors = this.getNeighboringAnimals(agent.getX(), agent.getY(), ANIMAL_AREA_RADIUS); + if(!agent.liveTurn(neighbors,this)) { + //agents.remove(agent); + arrayDeadAgent.add(counter); } + counter++; } + int counterTwo=0; + for(Integer i : arrayDeadAgent) { + if (i==arrayDeadAgent.get(0)) { + agents.remove(i.intValue()); + }else{agents.remove(i.intValue()-counterTwo);} + counterTwo++; + } + //then evolution of the field // TODO : apply game rule to all cells of the field @@ -288,14 +295,13 @@ public class Simulator extends Thread { }else {setCell(x, y, 0);} break; case 2 : - if(getCell(x, y)==0) { - setCell(x, y, 1); - }else {setCell(x, y, 0);} + Sheep Shaun=new Sheep(x,y); + agents.add(Shaun); + System.out.println(agents); break; case 3 : - if(getCell(x, y)==0) { - setCell(x, y, 1); - }else {setCell(x, y, 0);} + Wolf agrou=new Wolf(x,y); + agents.add(agrou); break; default: break; From e93caa207d7f6b6739bc4ca82ff6ac9c7ff06074 Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Thu, 30 May 2024 21:50:20 +0200 Subject: [PATCH 7/9] saveAgent and load agent working(save agent needs modification to take into account the type of agent) --- src/backend/Simulator.java | 70 +++++++++++++++++++--------- src/windowInterface/MyInterface.java | 6 ++- 2 files changed, 52 insertions(+), 24 deletions(-) diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index f39a0aa..a02a65c 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -141,46 +141,36 @@ public class Simulator extends Thread { } public int getAliveNeighbors(int x, int y, int radius) { - //to compensate for the cell itself being alive or not int aliveNeighbors = -1; if(getCell(x,y) == 0) { aliveNeighbors++; } - - //for each neighbor for(int i = x-radius; i <= x+radius; i++) { for(int j = y-radius; j <= y+radius; j++) { if(i!=-1 && i!=getWidth() && j!=-1 && j!=getHeight()) { //if neighbor is not outside the map - if(getCell(i,j) == 1) { //if alive, add 1 to counter aliveNeighbors++; } - } else if(loopingBorder==true && (i==-1 || i==getWidth() || j==-1 || j==getHeight() )) { //if looping borders enabled and neighbor outside map int I=i; int J=j; - if(I==-1) { I=getWidth()-1; } else if(I==getWidth()) { I=0; } - if(J==-1) { J=getHeight()-1; } else if(J==getHeight()) { J=0; - } - - if(getCell(I,J) == 1) { //if alive, add 1 to counter + }if(getCell(I,J) == 1) { //if alive, add 1 to counter aliveNeighbors++; } - } } } @@ -197,22 +187,16 @@ public class Simulator extends Thread { // to modify agent behavior, see liveTurn method // in agent classes ArrayList arrayDeadAgent=new ArrayList(); - int counter=0; for(Agent agent : agents) { ArrayList neighbors = this.getNeighboringAnimals(agent.getX(), agent.getY(), ANIMAL_AREA_RADIUS); if(!agent.liveTurn(neighbors,this)) { //agents.remove(agent); - arrayDeadAgent.add(counter); + arrayDeadAgent.add(agents.indexOf(agent)); } - counter++; } - int counterTwo=0; for(Integer i : arrayDeadAgent) { - if (i==arrayDeadAgent.get(0)) { - agents.remove(i.intValue()); - }else{agents.remove(i.intValue()-counterTwo);} - counterTwo++; + agents.remove(i.intValue()-arrayDeadAgent.indexOf(i)); } //then evolution of the field @@ -558,13 +542,55 @@ public class Simulator extends Thread { } public ArrayList getAgentsSave() { - //TODO : Same idea as the other save method, but for agents - return null; + ArrayList arrayLines=new ArrayList(); + String sumAgentToLine=""; + for(Agent agent :agents) { + sumAgentToLine+=agent.getX()+","; + sumAgentToLine+=agent.getY(); + if (agents.indexOf(agent) stringArray) { + public void loadAgents(ArrayList lines) { //TODO : Same idea as other load methods, but for agent list + if(lines.size()<=0) { + return; + } + String firstLine = lines.get(0); + String[] firstLineElements = firstLine.split(";"); + if(firstLineElements.length<=0) { + return; + } + for(int j =0; j0) { ArrayList content = mySimu.getSaveState(); - + String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); + writeFile(fileName, strArr); } } @@ -344,7 +345,8 @@ public class MyInterface extends JFrame { String fileName=SelectFile(); if (fileName.length()>0) { ArrayList content = mySimu.getAgentsSave(); - writeFile(fileName, (String[]) content.toArray()); + String[] strArr = Arrays.copyOf(content.toArray(), content.toArray().length, String[].class); + writeFile(fileName, strArr); } } From 5a12b1c0888cec6610895ed427092d133cb67cfb Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Fri, 31 May 2024 18:08:32 +0200 Subject: [PATCH 8/9] add few test files and specifying types for agent load and save --- Agents/SheepsandWolf | 1 + Agents/spreaded_out_flock | 1 + Rule/testblob | 2 + World/glider_test | 100 +++++++++++++++++++++++++++++++++++++ World/random | 100 +++++++++++++++++++++++++++++++++++++ src/backend/Agent.java | 1 + src/backend/Sheep.java | 4 +- src/backend/Simulator.java | 38 ++++++++------ src/backend/Wolf.java | 61 ++++++++++++++++++++++ 9 files changed, 292 insertions(+), 16 deletions(-) create mode 100644 Agents/SheepsandWolf create mode 100644 Agents/spreaded_out_flock create mode 100644 Rule/testblob create mode 100644 World/glider_test create mode 100644 World/random create mode 100644 src/backend/Wolf.java diff --git a/Agents/SheepsandWolf b/Agents/SheepsandWolf new file mode 100644 index 0000000..c87e039 --- /dev/null +++ b/Agents/SheepsandWolf @@ -0,0 +1 @@ +24,22,1;48,23,1;72,23,1;23,52,2;52,48,2;74,46,2; diff --git a/Agents/spreaded_out_flock b/Agents/spreaded_out_flock new file mode 100644 index 0000000..8b9fa47 --- /dev/null +++ b/Agents/spreaded_out_flock @@ -0,0 +1 @@ +37,33;77,30;79,48;70,69;15,55;26,16;41,15;65,29;67,48;56,58;42,60;46,39;74,20; diff --git a/Rule/testblob b/Rule/testblob new file mode 100644 index 0000000..5a21389 --- /dev/null +++ b/Rule/testblob @@ -0,0 +1,2 @@ +2;3;1;3;5;8 +3;3;5;7 diff --git a/World/glider_test b/World/glider_test new file mode 100644 index 0000000..79d95b4 --- /dev/null +++ b/World/glider_test @@ -0,0 +1,100 @@ +0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0 +0;0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;1;1;1;1;0;0;0;0;0;1;1;1;1;0;0;0;0;0;1;1;1;1;1;1;0;0;0;1;0;1;0;1;0;0;1;0;0;0;1;1;0;1;0;0;1;0;1;0;0;1;0;0;1;1;1;1;1;0;1;0;0 diff --git a/src/backend/Agent.java b/src/backend/Agent.java index 9eeef1e..1b0845a 100644 --- a/src/backend/Agent.java +++ b/src/backend/Agent.java @@ -35,6 +35,7 @@ public abstract class Agent { // if false, agent dies at end of turn // see step function in Simulator public abstract boolean liveTurn(ArrayList neighbors, Simulator world); + public abstract int getAgentType(); } diff --git a/src/backend/Sheep.java b/src/backend/Sheep.java index 6bd6985..3f51310 100644 --- a/src/backend/Sheep.java +++ b/src/backend/Sheep.java @@ -55,6 +55,8 @@ public class Sheep extends Agent { y-=1; } } - + public int getAgentType() { + return 1; + } } diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index a02a65c..e86c5f3 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -546,7 +546,8 @@ public class Simulator extends Thread { String sumAgentToLine=""; for(Agent agent :agents) { sumAgentToLine+=agent.getX()+","; - sumAgentToLine+=agent.getY(); + sumAgentToLine+=agent.getY()+","; + sumAgentToLine+=agent.getAgentType(); if (agents.indexOf(agent)2) { + int typeAgent = Integer.parseInt(elements[2]); + switch (typeAgent) { + case 1 : + Sheep Shaun=new Sheep(x,y);//adds a sheep for type 1 + agents.add(Shaun); + //System.out.println(agents); + break; + case 2 : + Wolf agrou=new Wolf(x,y);//adds a Wolf for type 2 + agents.add(agrou); + break; + default: + break; + } + } + else { + Sheep Shaun=new Sheep(x,y);// adds Sheep if the save doesn't specify the type of the Agent agents.add(Shaun); - //System.out.println(agents); - break; - case 3 : - Wolf agrou=new Wolf(x,y); - agents.add(agrou); - break; - default: - break; } } diff --git a/src/backend/Wolf.java b/src/backend/Wolf.java new file mode 100644 index 0000000..aa812fa --- /dev/null +++ b/src/backend/Wolf.java @@ -0,0 +1,61 @@ +package backend; + +import java.awt.Color; +import java.util.ArrayList; +import java.util.Random; + +// example of basic animal. +// do not hesitate to make it more complex +// and DO add at least another species that interact with it +// for example wolves that eat Wolf +public class Wolf extends Agent { + + int hunger; + Random rand; + + Wolf(int x,int y){ + //first we call the constructor of the superClass(Animal) + //with the values we want. + // here we decide that a Wolf is initially white using this constructor + super(x,y,Color.red); + // we give our Wolf a hunger value of zero at birth + hunger = 0; + //we initialize the random number generator we will use to move randomly + rand = new Random(); + } + + /** + * action of the animal + * it can interact with the cells or with other animals + * as you wish + */ + public boolean liveTurn(ArrayList neighbors, Simulator world) { + if(world.getCell(x, y)==1) { + world.setCell(x, y, 0); + } else { + hunger++; + } + this.moveRandom(); + return hunger>10; + } + + private void moveRandom() { + int direction = rand.nextInt(4); + if(direction == 0) { + x+=1; + } + if(direction == 1) { + y+=1; + } + if(direction == 2) { + x-=1; + } + if(direction == 3) { + y-=1; + } + } + public int getAgentType() { + return 2; + } + +} From d43c547709cb6e143c59d074d18ce464e6e1d9a2 Mon Sep 17 00:00:00 2001 From: "l.dupuis-burtin" Date: Sat, 1 Jun 2024 00:02:17 +0200 Subject: [PATCH 9/9] Final commit before bonus implementation --- src/backend/Agent.java | 12 ++++++- src/backend/Sheep.java | 10 ++++-- src/backend/Simulator.java | 38 +++++++++++----------- src/backend/Wolf.java | 47 +++++++++++++++++++++++----- src/windowInterface/MyInterface.java | 28 +++++++++++++++++ 5 files changed, 105 insertions(+), 30 deletions(-) diff --git a/src/backend/Agent.java b/src/backend/Agent.java index 1b0845a..2596d4a 100644 --- a/src/backend/Agent.java +++ b/src/backend/Agent.java @@ -7,7 +7,8 @@ public abstract class Agent { protected int x; protected int y; protected Color color; - + protected ArrayList agents; + boolean deathMarker=false; protected Agent(int x, int y, Color color) { this.x = x; this.y = y; @@ -30,6 +31,12 @@ public abstract class Agent { return dist neighbors, Simulator world); public abstract int getAgentType(); + public void toggleDeathMarker() { + deathMarker=true; + } } diff --git a/src/backend/Sheep.java b/src/backend/Sheep.java index 3f51310..17af1ac 100644 --- a/src/backend/Sheep.java +++ b/src/backend/Sheep.java @@ -13,6 +13,7 @@ public class Sheep extends Agent { int hunger; Random rand; + Sheep(int x,int y){ //first we call the constructor of the superClass(Animal) //with the values we want. @@ -30,14 +31,17 @@ public class Sheep extends Agent { * as you wish */ public boolean liveTurn(ArrayList neighbors, Simulator world) { + if(deathMarker) { + return false; + } if(world.getCell(x, y)==1) { world.setCell(x, y, 0); - hunger-=2; + hunger-=5; } else { hunger++; } this.moveRandom(); - return hunger<10; + return hunger<30; } private void moveRandom() { @@ -58,5 +62,5 @@ public class Sheep extends Agent { public int getAgentType() { return 1; } - + } diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index e86c5f3..0c486c8 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -29,8 +29,7 @@ public class Simulator extends Thread { private boolean loopingBorder; private int clickActionFlag; private int loopDelay = 150; - private ArrayList ruleSurviveCriteria= new ArrayList(); - + private ArrayList ruleSurviveCriteria= new ArrayList();//array lists used to compute the Rules private ArrayList ruleBirthCriteria=new ArrayList() ; //Rules rule = new Rules(); //TODO : add missing attribute(s) @@ -186,17 +185,18 @@ public class Simulator extends Thread { // only modify if sure of what you do // to modify agent behavior, see liveTurn method // in agent classes + ArrayList arrayDeadAgent=new ArrayList(); for(Agent agent : agents) { ArrayList neighbors = this.getNeighboringAnimals(agent.getX(), agent.getY(), ANIMAL_AREA_RADIUS); if(!agent.liveTurn(neighbors,this)) { //agents.remove(agent); - arrayDeadAgent.add(agents.indexOf(agent)); + arrayDeadAgent.add(agents.indexOf(agent));//if an agent doesn't fulfill its condition to live it will be listed as dead before being removed } } - for(Integer i : arrayDeadAgent) { - agents.remove(i.intValue()-arrayDeadAgent.indexOf(i)); + for(Integer i : arrayDeadAgent) {//removing agent from agents taking into account the change in index + agents.remove(i.intValue()-arrayDeadAgent.indexOf(i));//since the size of the array lowers at each iteration } //then evolution of the field @@ -266,8 +266,10 @@ public class Simulator extends Thread { */ public void clickCell(int x, int y) { //TODO : complete method - //if clickActionFlag = true then create an agent - //else if flag = false then change value of cell + //if clickActionFlag = 0 then get the position + //else if flag = 1 then change value of cell + //else if flag=2 then set a sheep + //else if flag=3 then set a wolf switch (clickActionFlag) { case 0 : System.out.print(x ); @@ -281,7 +283,7 @@ public class Simulator extends Thread { case 2 : Sheep Shaun=new Sheep(x,y); agents.add(Shaun); - System.out.println(agents); + //System.out.println(agents); break; case 3 : Wolf agrou=new Wolf(x,y); @@ -304,7 +306,7 @@ public class Simulator extends Thread { return status; } - public int getNewCell(int x, int y) { + public int getNewCell(int x, int y) {//getCell for the new array of cells for the next step //TODO : complete method with proper return int status = newCells.get(x).get(y).getAlive(); //int status = newCells.get(x).get(y); @@ -346,7 +348,7 @@ public class Simulator extends Thread { public void setCell(int x, int y, int status) { cells.get(x).get(y).setAlive(status); } - public void setNewCell(int x, int y, int status) { + public void setNewCell(int x, int y, int status) {//same but for the new cells array newCells.get(x).get(y).setAlive(status); } @@ -360,10 +362,10 @@ public class Simulator extends Thread { //We need to create an array of strings //each string should be the sum of all int transformed to strings in each Arrays of int ArrayList arrayLines=new ArrayList(); - for(int x=0;x arrayline=new ArrayList(); String lineOne=""; - for(int i=0;i lines) { + public void loadRule(ArrayList lines) {//opposite of getRule if(lines.size()<=0) { System.out.println("empty rule file"); return; @@ -608,7 +610,7 @@ public class Simulator extends Thread { public String clickActionName() { // TODO : initially return "sheep" or "cell" // depending on clickActionFlag - switch (clickActionFlag) { + switch (clickActionFlag) {//returns a string depending pn the value pf clickActionFlag case 0: return "position"; case 1: diff --git a/src/backend/Wolf.java b/src/backend/Wolf.java index aa812fa..251f13b 100644 --- a/src/backend/Wolf.java +++ b/src/backend/Wolf.java @@ -6,8 +6,9 @@ import java.util.Random; // example of basic animal. // do not hesitate to make it more complex -// and DO add at least another species that interact with it -// for example wolves that eat Wolf +//not very peculiar agent +//this class creates wolves that kill the agents that are of the Sheep subclass +//the wolves objects are moving towards any agent, making their behavior as a pack and going towards Sheep object to eat them public class Wolf extends Agent { int hunger; @@ -30,13 +31,43 @@ public class Wolf extends Agent { * as you wish */ public boolean liveTurn(ArrayList neighbors, Simulator world) { - if(world.getCell(x, y)==1) { - world.setCell(x, y, 0); - } else { - hunger++; + ArrayList inAreaAgents=new ArrayList(); + for(Agent agent : world.getAnimals()) { + if (this.getDistance(agent)<=1) { + agent.toggleDeathMarker();//if a wolf is near a sheep(radius of 1) then the sheep will die the following liveTurn + hunger-=50; + } + else if (agent.isInArea(agent.getX(), agent.getY(), 5)) {//look for agents in area and add them to the array list inAreaAgents + inAreaAgents.add(agent); + } + + }//gets the agent with the smallest distance with this wolf + if (inAreaAgents.size()>0) { + Agent smallestDistanceAgent=inAreaAgents.get(0); + for(Agent agentNear:inAreaAgents) { + if(this.getDistance(agentNear)0) { + x-=1; + }else if ((x-smallX)<0) { + x+=1; + } + if((y-smallY)>0) { + y-=1; + }else if ((y-smallY)<0) { + y+=1; + } + }else { + this.moveRandom(); } - this.moveRandom(); - return hunger>10; + + + return hunger<50; } private void moveRandom() { diff --git a/src/windowInterface/MyInterface.java b/src/windowInterface/MyInterface.java index 0b1d4b5..625d966 100644 --- a/src/windowInterface/MyInterface.java +++ b/src/windowInterface/MyInterface.java @@ -13,6 +13,7 @@ import javax.swing.event.ChangeListener; import backend.Simulator; +import javax.imageio.ImageReader; import javax.swing.JButton; import javax.swing.JFileChooser; import javax.swing.JLabel; @@ -155,6 +156,14 @@ public class MyInterface extends JFrame { generateRandomBoard(); } }); + /**panelRight.add(btnLoadImage); + + JButton btnLoadImage = new JButton("Load Image"); + btnLoadImage.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent arg0) { + clicLoadImage; + } + });*/ panelRight.add(btnRandGen); @@ -321,6 +330,25 @@ public class MyInterface extends JFrame { this.repaint(); } } + /**public void clicLoadImage() { + String fileName=SelectFile(); + //ArrayList stringArray = new ArrayList(); + if (fileName.length()>0) { + try { + ImageReader fileContent = new ImageReader(new FileReader(fileName)); + String line = fileContent.readLine(); + while (line != null) { + stringArray.add(line); + line = fileContent.readLine(); + } + fileContent.close(); + } catch (Exception e) { + e.printStackTrace(); + } + mySimu.loadAgents(stringArray); + this.repaint(); + } + }*/ public void clicSaveToFileButton() {