加入收藏 设为首页 联系站长
首页 | 虚拟动态 | Cisco模拟 | Juniper仿真 | 虚拟机 | 网络仿真 | 软件路由 | 技术专题 | 相关软件 | 交流论坛
>首页 -> 网络仿真 -> NS

TOP

[Bug Fix]:NAM Editor
[ 录入者:admin | 时间:2007-10-28 00:35:13 | 作者: | 来源: | 浏览:306次 ]
NAM Editor is not NAM. You can invoke it by "NAM ->File->New Nam Editor..."

NAM Editor can be used for topology and scenario generation. However, when you delete an object (Node, Link, Agent, etc), You will get a "Segmentation fault".

Answer:

in /nam-version/editview.cc,
    EditView::cmdDeleteObj(float cx, float cy)

if (p == NULL) {
    defTag_->remove();
} else {
    if (p->classid() == ClassNodeID) {
      Node * n = (Node *) p;
      EditorNetModel * emodel_ = (EditorNetModel *) model_;
      emodel_->removeNode(n);
      draw();
    }
    else if (p->classid() == ClassEdgeID) {
      Edge * e = (Edge *) p;
      EditorNetModel * emodel_ = (EditorNetModel *) model_;
      emodel_->removeLink(e);
      draw();
    }
    else if (p->classid() == ClassAgentID) {
      Agent * a = (Agent *) p;
      EditorNetModel* emodel_ = (EditorNetModel *) model_;
      emodel_->removeAgent(a);
      draw();
    }
    else if (p->classid() == ClassTrafficSourceID) {
      TrafficSource * ts = (TrafficSource *) p;
      EditorNetModel* emodel_ = (EditorNetModel *) model_;
      emodel_->removeTrafficSource(ts);
      draw();
    }
    else if (p->classid() == ClassLossModelID) {
      LossModel * lossmodel = (LossModel *) p;
      EditorNetModel* emodel_ = (EditorNetModel *) model_;
      emodel_->removeLossModel(lossmodel);
      draw();
    }

}



Please replace the if with "else if" and make the nam again. Then try the Nam Editor again:)

[上一篇]Network Simulator, NS-2 Blog [下一篇]用GDB调试NS和NAM
※相关文章
 

评论

称  呼:
内  容:

相关栏目

最新文章

热门文章

推荐文章

赞助商链接