LTE: "Terminate called after throwing an instance of 'std::out_of_range''

265 views
Skip to first unread message

Alex

unread,
Feb 19, 2017, 5:20:13 PM2/19/17
to ns-3-users
Hi,

I have a scenario with 3 UEs, three ENBs and four buildings.
When I run the script with one set of buildings' positions I get this error:

terminate called after throwing an instance of 'std::out_of_range'
  what
():  vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)


Here are the positions:

 enbPositionAlloc->Add (Vector (50.0, 210.0, 35));
 enbPositionAlloc->Add (Vector (125.0, -140.0, 35)); 
 enbPositionAlloc->Add (Vector (200.0, 40.0, 35)); 

    ueNodes.Get (0)->GetObject<MobilityModel> ()->SetPosition (Vector (0, 10, 1.5)); // (x, y, z) in m
    ueNodes.Get (1)->GetObject<MobilityModel> ()->SetPosition (Vector (0, 10, 1.5)); // (x, y, z) in m
    ueNodes.Get (2)->GetObject<MobilityModel> ()->SetPosition (Vector (0, 10, 1.5)); // (x, y, z) in m

building1->SetBoundaries (Box (5.0,12.0, 20.0, 25,  0.0, 25));
building2->SetBoundaries (Box (17.0,25.0, 20.0, 30, 0.0, 30));
building3->SetBoundaries (Box (27.0,28.0, 30.0, 40, 0.0, 50));
building4->SetBoundaries (Box (29.0,30, 10.0, 11,0.0, 4));


and buildings' positions which are ok, i.e. I don't get that error:


building1->SetBoundaries (Box (5.0,12.0, 10.0, 15,  0.0, 25));
building2->SetBoundaries (Box (17.0,25.0, 10.0, 20, 0.0, 30));
building3->SetBoundaries (Box (27.0,28.0, 20.0, 30, 0.0, 50));
building4->SetBoundaries (Box (29.0,30, 0.0, 1,0.0, 4));


I can't find what's causing this error, could you please help?

Tommaso Pecorella

unread,
Feb 24, 2017, 9:56:09 AM2/24/17
to ns-3-users
Hi,

I can't spot a real problem, perhaps the full code is needed.
However, I'd say that the error is somewhere else.

Have you tried upgrading your ns-3 to the latest development release ? Yes, of course, it's stated in the posting guidelines...

T.
Reply all
Reply to author
Forward
0 new messages