Transmission of messages in veins, about vehicles and Rsu

23 Views Asked by At

First I added an RSU-like unit to the network as a central control unit I set timers in TraciDemo11p and TraciDemoRSU11p to send messages

void TraCIDemo11p::handleMessage(cMessage* msg) {
    
    if (msg->isSelfMessage()) {
        TraCIDemo11pMessage* wsm = new TraCIDemo11pMessage();
        populateWSM(wsm);
        std::string arrayAsString;
        for (int i = 0; i < N; i++) {
            for (int j = 0; j < N; j++) {
                arrayAsString += std::to_string(mij[i][j]) + " ";
            }
            arrayAsString.pop_back();
            arrayAsString += "\n";
        }
        std::string newWSM_str = arrayAsString;
        wsm->setAMessage(newWSM_str.data());
        wsm->setDemoData(mobility->getRoadId().c_str());
        wsm->setSenderAddress(myId);
        sendDown(wsm);
        scheduleAt(simTime() + 53, msg);
    }
    else {
        DemoBaseApplLayer::handleMessage(msg);
    }

}

tyvoid TraCIDemoRSU11p::handleMessage(cMessage* msg)
{

    if (msg->isSelfMessage()) {
        TraCIDemo11pMessage* wsm = new TraCIDemo11pMessage();
        populateWSM(wsm);
        wsm->setAMessage(RSUsavedAMessage.data());
        wsm->setSenderAddress(myId);
        sendDown(wsm);
        scheduleAt(simTime() + 250, msg);
    }
    else {
        DemoBaseApplLayer::handleMessage(msg);
    }
}

The code can run normally when the number of vehicles is less than or equal to 20. The following error occurs when I adjust the number of vehicles to 30. How should I correct the error

<!> TraCI server reported status 255 executing command 0xc4 ("Edge '' is not known."). -- in module (veins::TraCIDemo11p) RSUExampleScenario.node[31].appl (id=207), at t=250.000244822538s, event #49654

I hope you can tell me where the error occurred and how to fix it, thank you

0

There are 0 best solutions below