Below you have all the implementations of the functions you have mentioned. As you can see in the first case the comment for getPositionAt()
says:
It is intended to be passed simTime()
as actualTime
and returns the
actual position.
Seems like these functions do not cover your case at all.
You can see how these functions work at Move.h
. The comments are detailed enough too
/**
* @brief Returns the position of the Move (Host) at the specified point in time.
* It is intended to be passed simTime() as actualTime and returns the actual position.
*
* Assumes that direction represents a normalized vector (length equals 1.0).
* Further this function does not check whether the given time point is before
* the startTime of the actual move pattern. So in this case one might obtain
* an unintended result.
*
*/
virtual Coord getPositionAt(simtime_t_cref actualTime = simTime()) const
{
// if speed is very close to 0.0, the host is practically standing still
if ( FWMath::close(speed, 0.0) ) return startPos;
// otherwise: actualPos = startPos + ( direction * v * t )
return startPos + ( direction * speed * SIMTIME_DBL(actualTime - startTime) );
}
virtual const Coord& getCurrentPosition() const
{
if (lastPos.z != DBL_MAX)
return lastPos;
return startPos;
}
getPositionAt()
is also implemented at TraCIMobility.h
as:
virtual Coord getPositionAt(const simtime_t& t) const {
return move.getPositionAt(t) ;
}
and getCurrentPosition()
is implemented at BaseMobility.h
as:
/** @brief Returns the current position at the current simulation time. */
virtual Coord getCurrentPosition(/*simtime_t_cref stWhen = simTime()*/) const {
//return move.getPositionAt(stWhen);
return move.getStartPos();
}