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

ADD: differentiate conflict and concurrence on overlaps

parent 3920ed85
No related branches found
No related tags found
2 merge requests!3Merge masters,!2Merge dev into develop
......@@ -601,7 +601,24 @@ public class Context extends AmoebaAgent {
HashMap<Percept, Double> request = boundsToRequest(bounds);
if(request != null) {
return new EndogenousRequest(request, bounds, 7, new ArrayList<Context>(Arrays.asList(this,ctxt)), REQUEST.OVERLAP);
double currentDistanceToOraclePrediction = this.getLocalModel().distance(this.getCurrentExperiment());
double otherContextDistanceToOraclePrediction = ctxt.getLocalModel().distance(ctxt.getCurrentExperiment());
Double averageDistanceToOraclePrediction = getAmas().getHeadAgent().getAverageRegressionPerformanceIndicator();
Double distanceDifference = Math.abs(currentDistanceToOraclePrediction-otherContextDistanceToOraclePrediction);
getEnvironment().trace(TRACE_LEVEL.DEBUG, new ArrayList<String>( Arrays.asList(this.getName(),"currentDistanceToOraclePrediction",""+ currentDistanceToOraclePrediction,"otherContextDistanceToOraclePrediction",""+ otherContextDistanceToOraclePrediction, "distanceDifference", ""+distanceDifference)));
if(distanceDifference<averageDistanceToOraclePrediction) {
return new EndogenousRequest(request, bounds, 6, new ArrayList<Context>(Arrays.asList(this,ctxt)), REQUEST.CONCURRENCE);
}
else {
return new EndogenousRequest(request, bounds, 7, new ArrayList<Context>(Arrays.asList(this,ctxt)), REQUEST.CONFLICT);
}
}
}
else if(overlapCounts == getAmas().getPercepts().size()-1 && voidDistances.size() == 1 && getAmas().getCycle() > 750) {
......@@ -708,10 +725,13 @@ public class Context extends AmoebaAgent {
//double minDistanceToOraclePrediction = Math.min(getAmas().getHeadAgent().getDistanceToRegressionAllowed(), getAmas().getHeadAgent().getDistanceToRegressionAllowed());
Double averageDistanceToOraclePrediction = getAmas().getHeadAgent().getAverageRegressionPerformanceIndicator();
if((currentDistanceToOraclePrediction<averageDistanceToOraclePrediction) && (otherContextDistanceToOraclePrediction<averageDistanceToOraclePrediction)) {
Double distanceDifference = Math.abs(currentDistanceToOraclePrediction-otherContextDistanceToOraclePrediction);
getEnvironment().trace(TRACE_LEVEL.DEBUG, new ArrayList<String>( Arrays.asList(this.getName(),"currentDistanceToOraclePrediction",""+ currentDistanceToOraclePrediction,"otherContextDistanceToOraclePrediction",""+ otherContextDistanceToOraclePrediction, "distanceDifference", ""+distanceDifference)));
if(distanceDifference<averageDistanceToOraclePrediction) {
getEnvironment().trace(TRACE_LEVEL.DEBUG, new ArrayList<String>( Arrays.asList(this.getName(),"currentDistanceToOraclePrediction",""+ currentDistanceToOraclePrediction,"otherContextDistanceToOraclePrediction",""+ otherContextDistanceToOraclePrediction)));
for(Percept pct : ranges.keySet()) {
......
......@@ -1835,7 +1835,7 @@ public class Head extends AmoebaAgent {
EndogenousRequest currentRequest = itr.next();
if(currentRequest.getType() == REQUEST.OVERLAP) {
if(currentRequest.getType() == REQUEST.CONFLICT || currentRequest.getType() == REQUEST.CONCURRENCE) {
existingRequestTest = existingRequestTest || currentRequest.testIfContextsAlreadyAsked(request.getAskingContexts());
}
......
......@@ -5,6 +5,8 @@ import java.io.Serializable;
public enum REQUEST implements Serializable {
OVERLAP,
CONFLICT,
CONCURRENCE,
VOID,
SELF
......
......@@ -32,10 +32,10 @@ public class F_N_Launcher implements Serializable {
public static final double spaceSize = 50.0 ;
public static final int nbOfModels = 3 ;
public static final int normType = 2 ;
public static final boolean randomExploration = false;
public static final boolean randomExploration = true;
public static final boolean limitedToSpaceZone = true;
//public static final double mappingErrorAllowed = 0.07; // BIG SQUARE
public static double mappingErrorAllowed = 0.03; // MULTI
public static double mappingErrorAllowed = 0.04; // MULTI
public static final double explorationIncrement = 1.0 ;
public static final double explorationWidht = 0.5 ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment