Skip to content
Snippets Groups Projects
Commit 4749924b authored by BrunoDatoMeneses's avatar BrunoDatoMeneses
Browse files

ENH: space size tests on square experimentations

parent 89a7a468
No related branches found
No related tags found
1 merge request!1Merge Master
...@@ -39,11 +39,21 @@ public class BadContextLauncherEasy implements Serializable { ...@@ -39,11 +39,21 @@ public class BadContextLauncherEasy implements Serializable {
amoeba.setDataForErrorMargin(0.5, 1, 1, 0.4, 10, 100); amoeba.setDataForErrorMargin(0.5, 1, 1, 0.4, 10, 100);
amoeba.setDataForInexactMargin(0.5, 1, 1, 0.4, 10, 100); amoeba.setDataForInexactMargin(0.5, 1, 1, 0.4, 10, 100);
/* Default */
// amoeba.setAVT_acceleration(2);
// amoeba.setAVT_deceleration(1./3.);
// amoeba.setAVT_percentAtStart(0.2);
/* Custum */
amoeba.setAVT_acceleration(0.5);
amoeba.setAVT_deceleration(0.5);
amoeba.setAVT_percentAtStart(0.001);
amoeba.setRememberState(false); amoeba.setRememberState(false);
amoeba.setGenerateCSV(false); amoeba.setGenerateCSV(false);
/* This is the initialization of the studied system. It's only for the sake of example, not a part of AMOEBA initialization*/ /* This is the initialization of the studied system. It's only for the sake of example, not a part of AMOEBA initialization*/
BadContextManager bcm = new BadContextManager(); BadContextManager bcm = new BadContextManager(50.0);
bcm.setWorld(amoeba.getScheduler().getWorld()); bcm.setWorld(amoeba.getScheduler().getWorld());
ArrayList<Percept> percepts = new ArrayList<Percept>(); ArrayList<Percept> percepts = new ArrayList<Percept>();
......
...@@ -27,10 +27,18 @@ public class BadContextManager implements StudiedSystem, Serializable{ ...@@ -27,10 +27,18 @@ public class BadContextManager implements StudiedSystem, Serializable{
/** The first step. */ /** The first step. */
boolean firstStep = true; boolean firstStep = true;
double spaceSize;
/** The world. */ /** The world. */
World world; World world;
Random generator; Random generator;
public BadContextManager(double size) {
this.spaceSize= size;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see kernel.StudiedSystem#playOneStep(double) * @see kernel.StudiedSystem#playOneStep(double)
*/ */
...@@ -41,8 +49,8 @@ public class BadContextManager implements StudiedSystem, Serializable{ ...@@ -41,8 +49,8 @@ public class BadContextManager implements StudiedSystem, Serializable{
if (generator == null) generator = new Random(29); if (generator == null) generator = new Random(29);
x = (generator.nextDouble() - 0.5) * 200; x = (generator.nextDouble() - 0.5) * spaceSize * 4;
y = (generator.nextDouble()- 0.5) * 200; y = (generator.nextDouble()- 0.5) * spaceSize * 4;
} }
/* (non-Javadoc) /* (non-Javadoc)
...@@ -51,9 +59,9 @@ public class BadContextManager implements StudiedSystem, Serializable{ ...@@ -51,9 +59,9 @@ public class BadContextManager implements StudiedSystem, Serializable{
@Override @Override
public HashMap<String, Double> getOutput() { public HashMap<String, Double> getOutput() {
HashMap<String, Double> out = new HashMap<String, Double>(); HashMap<String, Double> out = new HashMap<String, Double>();
double size = 55;
result = (y > -size && y < size && x < size && x > -size) ? 0.0 : 1.0;
result = (y > -spaceSize && y < spaceSize && x < spaceSize && x > -spaceSize) ? 0.0 : 1.0;
// result = (x > 2*y) ? 0.0 : 1.0; // result = (x > 2*y) ? 0.0 : 1.0;
out.put("x",x); out.put("x",x);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment