I was wondering what exactly does the function org.ascape.model.Scape.calculateDistance(LocatedAgent origin,LocatedAgent target)
calculates.Does it calculate the distance according to the option that has been chosen for the Neighborhood of the Space (Moore,Euclidian,Von_Neumann)? As I noticed by observing the values that the function returns, I think that is calculates only the difference of the x coordinate.For example, for the distance between agent1, whose hostCell is [8,14], and agent2, whose hostCell is [13,33], it returns 5 (13-8).

Agent1 Cell [8, 14]
Agent2 Cell [13, 33]
Distance 5.0

In this example, if I have understood well the meaning of the Moore distance, I think that the Moore distance is 19. Is there any other function that returns this distance?

Yes, it is defined by the space of the Scape. Note that Moore distance will always be the max of either the x or y delta. It's possible that you're actually computing distance within a one-dimensional space, so check that. But what I think may be happening is that you're in periodic (toroidal) space in which case the y coordinates are actually nearer each other. How big is the space?

The Space I use is 2-dimensional and its size is 50x50. The option Border Rule is set to Aperiodic, so I don't think that this is the problem. I have noticed that the function calculateDistance() always returns the x difference even if the y difference is bigger. However, the function

this.getHostCell().getDistance(Agent2.getHostCell());

returns the Moore distance between Agent2 and the agent that is calling the function. So, I think that I will do it this way.