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

FIX: isRealVoid method

parent 992c9a67
Branches
Tags
2 merge requests!3Merge masters,!2Merge dev into develop
...@@ -112,7 +112,8 @@ public class Context extends AmoebaAgent { ...@@ -112,7 +112,8 @@ public class Context extends AmoebaAgent {
for (Percept p : var) { for (Percept p : var) {
Range r; Range r;
Pair<Double, Double> radiuses = getAmas().getHeadAgent().getMaxRadiusesForContextCreation(p); //Pair<Double, Double> radiuses = getAmas().getHeadAgent().getMaxRadiusesForContextCreation(p);
Pair<Double, Double> radiuses = getAmas().getHeadAgent().getRadiusesForContextCreation(p);
r = new Range(this, p.getValue() - radiuses.getA(), p.getValue() + radiuses.getB(), 0, true, true, p); r = new Range(this, p.getValue() - radiuses.getA(), p.getValue() + radiuses.getB(), 0, true, true, p);
...@@ -127,7 +128,7 @@ public class Context extends AmoebaAgent { ...@@ -127,7 +128,7 @@ public class Context extends AmoebaAgent {
p.addContextProjection(this); p.addContextProjection(this);
} }
expand(); //expand();
localModel = getAmas().buildLocalModel(this); localModel = getAmas().buildLocalModel(this);
firstPoint.setOracleProposition(getAmas().getHeadAgent().getOracleValue()); firstPoint.setOracleProposition(getAmas().getHeadAgent().getOracleValue());
...@@ -188,7 +189,9 @@ public class Context extends AmoebaAgent { ...@@ -188,7 +189,9 @@ public class Context extends AmoebaAgent {
ArrayList<Percept> var = getAmas().getPercepts(); ArrayList<Percept> var = getAmas().getPercepts();
for (Percept v : var) { for (Percept v : var) {
Range r; Range r;
Pair<Double, Double> radiuses = getAmas().getHeadAgent().getMaxRadiusesForContextCreation(v); //Pair<Double, Double> radiuses = getAmas().getHeadAgent().getMaxRadiusesForContextCreation(v);
Pair<Double, Double> radiuses = getAmas().getHeadAgent().getRadiusesForContextCreation(v);
r = new Range(this, v.getValue() - radiuses.getA(), v.getValue() + radiuses.getB(), 0, true, true, v); r = new Range(this, v.getValue() - radiuses.getA(), v.getValue() + radiuses.getB(), 0, true, true, v);
...@@ -201,7 +204,7 @@ public class Context extends AmoebaAgent { ...@@ -201,7 +204,7 @@ public class Context extends AmoebaAgent {
v.addContextProjection(this);; v.addContextProjection(this);;
} }
expand(); //expand();
this.confidence = bestNearestContext.confidence; this.confidence = bestNearestContext.confidence;
if (bestNearestContext.getLocalModel().getType() == TypeLocalModel.MILLER_REGRESSION) { if (bestNearestContext.getLocalModel().getType() == TypeLocalModel.MILLER_REGRESSION) {
...@@ -570,7 +573,7 @@ public class Context extends AmoebaAgent { ...@@ -570,7 +573,7 @@ public class Context extends AmoebaAgent {
for (Percept pct : getAmas().getPercepts()) { for (Percept pct : getAmas().getPercepts()) {
currentDistance = this.distance(ctxt, pct); currentDistance = this.distance(ctxt, pct);
if(currentDistance<-pct.getMappingErrorAllowedMin() && getAmas().getCycle()>50) { if(currentDistance<-pct.getMappingErrorAllowedMin() && getAmas().getCycle()>500) {
getEnvironment().trace(TRACE_LEVEL.DEBUG,new ArrayList<String>(Arrays.asList("OVERLAP",pct.getName(), ""+this,""+ctxt)) ); getEnvironment().trace(TRACE_LEVEL.DEBUG,new ArrayList<String>(Arrays.asList("OVERLAP",pct.getName(), ""+this,""+ctxt)) );
overlapCounts+=1; overlapCounts+=1;
overlapDistances.put(pct, Math.abs(currentDistance)); overlapDistances.put(pct, Math.abs(currentDistance));
...@@ -580,7 +583,7 @@ public class Context extends AmoebaAgent { ...@@ -580,7 +583,7 @@ public class Context extends AmoebaAgent {
} }
if (currentDistance > pct.getMappingErrorAllowedMin() && getAmas().getCycle()>50) { if (currentDistance > pct.getMappingErrorAllowedMin() && getAmas().getCycle()>1000) {
getEnvironment().trace(TRACE_LEVEL.DEBUG,new ArrayList<String>(Arrays.asList("VOID",pct.getName(), ""+this,""+ctxt, "distance", ""+currentDistance)) ); getEnvironment().trace(TRACE_LEVEL.DEBUG,new ArrayList<String>(Arrays.asList("VOID",pct.getName(), ""+this,""+ctxt, "distance", ""+currentDistance)) );
voidDistances.put(pct, currentDistance); voidDistances.put(pct, currentDistance);
bounds.put(pct, this.voidBounds(ctxt, pct)); bounds.put(pct, this.voidBounds(ctxt, pct));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment