Hi everyone,

                       i am trying to run a simulation script and having this 
error while the script is run in ns-2. can anyone tell me why this error is 
coming. the simulation script is attached with this email. the error is         
 assertion failed at mobilenode.cc


ns: common/mobilenode.cc:409: int MobileNode::set_destination(double, double, 
double): Assertion `initialized()' failed.

the funcion looks like 
////////////////////////////////////////////////////////////////////////////////////////
int
MobileNode::set_destination(double x, double y, double s)
{
    
assert(initialized());//////////////////////////////////////////////////////////////////----->the
 problem is here    ////see the initialized function below
    if(x >= T_->upperX() || x <= T_->lowerX())
        return -1;
    if(y >= T_->upperY() || y <= T_->lowerY())
        return -1;
        update_position();    // figure out where we are now
        destX_ = x;
    destY_ = y;
    speed_ = s;
        dX_ = destX_ - X_;
    dY_ = destY_ - Y_;
    dZ_ = 0.0;        // this isn't used, since flying isn't allowed
    double len;
        if (destX_ != X_ || destY_ != Y_) {
        // normalize dx, dy to unit len
        len = sqrt( (dX_ * dX_) + (dY_ * dY_) );
        dX_ /= len;
        dY_ /= len;
    }.....................................................
//////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
inline int initialized() {
        return (T_ && log_target_ &&                                            
 ----------->this function is not giving the required output
            X_ >= T_->lowerX() && X_ <= T_->upperX() &&
            Y_ >= T_->lowerY() && Y_ <= T_->upperY());
    }
////////////////////////////////////////////////////////////////////////////////////////////

can anyone tell me how to fix this problem.       many thanks in advance ...
bye

_________________________________________________________________
Windows Liveā„¢: Keep your life in sync. Check it out!
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009

Reply via email to