Log.log(AGENT_MODEL, "My position: [%.2f,%.2f,%.2f]", agent.position.getX(), agent.position.getY(), agent.position.getZ());
}
//do not delete yet, may come handy if simpleCalculation does not yield good results
private Vector3D useSophisticatedCalculation(Map<FixedObject, Vector3D> fixedObjects){
Vector3D min = intersection(fixedObjects, 0.0);
double MAX_NAO_HEIGHT = 0.7;
Vector3D max = intersection(fixedObjects, MAX_NAO_HEIGHT);
Vector3D increment = min.subtract(max).divide(APPROXIMATION_ALGORITHM_STEPS);
double minError = Double.POSITIVE_INFINITY;
Vector3D bestResult = max;
double lastError = Double.POSITIVE_INFINITY;
for (int i = 0; i < APPROXIMATION_ALGORITHM_STEPS ; i++){
Vector3D tested = min.subtract(increment.multiply(i));
double error = 0.0;
for (FixedObject flag : fixedObjects.keySet()){
double seenDistance = fixedObjects.get(flag).getR();
double realDistance = flag.getAbsolutePosition().subtract(tested).getR();
error += pow(seenDistance - realDistance, 2.0);