Search code examples
omnet++veins

Error during initialization of TrafficLight node in Veins 4.7.1


How can I use the TrafficLight node in Veins 4.7.1 with a custom app?

I tried to add a trafficlight node the same way we add RSU nodes, i.e.:

import org.car2x.veins.nodes.Scenario;
import org.car2x.veins.nodes.TrafficLight;

network EV_Scenario3 extends Scenario
{
    @display("bgb=844,629");
    submodules:
    tl[2]: TrafficLight {
        @display("p=150,140;i=veins/node/trafficlight;is=s");
    }
}

and define its app in the omnetpp.ini file i.e. *.tl[*].applType = "TrafficLightApp"

This method does not work and I got the following error:

submodule appl: No module type named 'TrafficLightApp' found that implements module interface org.car2x.veins.base.modules.ITrafficlightApplLayer (Not in the loaded NED files?), at C:\Veins\veins-5.7.1\src\veins\nodes\TrafficLight.ned: 35 -- in module (omnetpp::cModule) EV_Scenario3.tl[0] (id-7), during network setup

Any Idea how to use this node, and How can I generate it dynamically like the car nodes?


Solution

  • OMNeT++ does not know a module called TrafficLightApp or this module does not implement the ITrafficlightApplLayer interface.

    If you have created the module TrafficLightApp already, make sure that it also implements the aforementioned interface. If you have not created this module already, you need to create (and register) it first.

    Please note that Veins 4.7 introduces traffic lights but does not provide an application layer for them. You have to build one yourself, implementing the ITrafficlightApplLayer interface.