VEINS OMNeT++ SIMULATION
VEINS OMNeT++ is a framework which runs for vehicular network simulations.VEINS utilizes TCP Conncetion and python scripts for enabling SUMO framework which acts as a model in OMNeT++ Simulation Framework.
Characteristics of veins:
- Consists of two distinct simulator OMNET++ and SUMO.
- OMNET++ used for network simulation.
- SUMO for traffic simulation.
- To perform IVC simulation, both simulators are running in parallel, connected via a TCP socket
- Standardized as the TraCl.
- Nodes can then interact with the running road traffic simulation
- This allows bi-directionality-coupled simulation of road traffic and network traffic.
Download Sample Source Code for VEINS OMNeT++
[code lang="js"]
void TraCIScenarioManager::insertVehicles() {
for (std::map<int, std::queue<std::string> >::iterator i = vehicleInsertQueue.begin(); i != vehicleInsertQueue.end(); )
{ std::string route = routeIds[i->first];
MYDEBUG << "process " << route << std::endl;
std::queue<std::string> vehicles = i->second;
while (!i->second.empty()) {
bool suc = false;
std::string type = i->second.front();
std::stringstream veh;
veh << type << "_" << vehicleNameCounter;
MYDEBUG << "trying to add " << veh.str() << " with " << route << " vehicle type " << type << std::endl; suc = getCommandInterface()->addVehicle(veh.str(), type, route, simTime());
if (!suc) {
i->second.pop();
}
else {
MYDEBUG << "successful inserted " << veh.str() << std::endl; queuedVehicles.insert(veh.str()); i->second.pop();
vehicleNameCounter++;
}
}
std::map<int, std::queue<std::string> >::iterator tmp = i;
++tmp;
vehicleInsertQueue.erase(i);
i = tmp;
}
}
[/code]

