From: Zohrieh Y. <z_y...@ya...> - 2013-01-23 20:16:28
|
Hi All, Could you please tell me why this error happens? Thanks. The error message: java.lang.IllegalArgumentException: Displacement matrix has different number of dimensions than space at repast.simphony.space.continuous.AbstractContinuousSpace.moveByVector( AbstractContinuousSpace.java:323) at Tom.SaAgent.movetothe( SaAgent.java:156) at Tom.SaAgent.step( SaAgent.java:89) The method Programm: @Override publicvoidmovetothe(GridPoint p) { Context context = ContextUtils.getContext( this); Grid patch = (Grid) context.getProjection( "Simple Grid"); ContinuousSpace space = (ContinuousSpace) context.getProjection("Continuous Space"); NdPoint myPoint = space.getLocation( this); NdPoint otherPoint = - newNdPoint(p.getX(), p.getY(),0); doubleangle = SpatialMath.calcAngleFor2DMovement(space, myPoint ,otherPoint); space.moveByVector(this,1, angle); moveByVector(this,1, angle); patch.moveTo(this, (int) pointWithAliveGrass.getX(), (int)pointWithAliveGrass.getY()); } |