ManiAm / VENTOS_Public

VEhicular NeTwork Open Simulator (VENTOS)
http://maniam.github.io/VENTOS/
GNU General Public License v3.0
57 stars 25 forks source link

Simulation of newly added example "7_platooning" #32

Closed bargisou closed 6 years ago

bargisou commented 6 years ago

Why is it that the simulation is only shown in the OMNET++ but no message transfer in OMNeT++ and only the net file is generated showing routes and edges but no vehicles running for the entire simulation.

bargisou commented 6 years ago

Is there any way to solve the below mentioned problem?

image

ManiAm commented 6 years ago

That is a generic problem. You need to check the Eclipse IDE console output to understand what is going on.

ManiAm commented 6 years ago

I have added the 7_platooning scenario to show the example in section '3.7 Adding Vehicle Platoon' of the manual.

ManiAm commented 6 years ago

Probably the addNode.xml file is empty. and the simulation terminates at time 0s, because there is no nodes in the simulation. Follow the manual ...

bargisou commented 6 years ago

Actually I have added a "add_0" node and made changes in the edge,node and route files accordingly.

ManiAm commented 6 years ago

The configuration should look like this:

include ../omnetpp_general.ini
[Config tutorial1]
description = "This config shows you how to add nodes into simulation"
Network.TraCI.active = true
Network.TraCI.SUMOapplication = "sumo-guiD"
Network.TraCI.SUMOconfig = "07_platooning/example.sumocfg"
Network.TraCI.terminateTime = 600s
Network.addNode.id = "add_0"

And the addNode.xml can have this content:

<?xml version="1.0" encoding="UTF-8"?>

<addNode id="add_0">
<vehicle_platoon id="plt1" type="passenger" size="5" route="route0" depart="0" departLane="1" departPos="40" platoonMaxSpeed="20" color="red" />
</addNode>
bargisou commented 6 years ago

Yes.It is the same

bargisou commented 6 years ago

The error still persists .But the files seem to be the same as you mentioned above.

im1 im2 im3 im4 im5 im6 im7

bargisou commented 6 years ago

The console window says the following: <!> std::runtime_error: cannot open file addNode.xml -- in module (VENTOS::TraCI_Start) Network.TraCI (id=2), during network initialization Is there any command to simulate the addnode.xml file? Are we supposed to change tutorial.cc according to section 8 or section 9?

ManiAm commented 6 years ago

The error message is strange! VENTOS cannot find the addNode.xml file! Can you run your simulation in debug mode and tell me the line that throws this run-time error?

P.S: In the edge file, you created a 1 lane street, but in the addNode file you want to insert the platoon in lane 1? I think lanes starts with 0 index.

bargisou commented 6 years ago

Even if I change the depart lane to 0 index as you said the error still persists which says "SIMULATION ENDED AT TIME 0 & TCPIP Socket error" and in the console window "Cannot open file addnode.xml"

bargisou commented 6 years ago

I am not able to run the simulation in debug mode. im8 im9

bargisou commented 6 years ago

Does the addnode.xml file need to be compiled when changes are made using command line before run configuration?

bargisou commented 6 years ago

Is there any way out through this to find out where exactly the problem lies?

ManiAm commented 6 years ago

Unfortunately I do not have any more hints for you!

The last option is to send your example as a file to me and I would have a look at it later on. Also send me an screenshot of your run configuration in eclipse.

bargisou commented 6 years ago

The required files are attached below:

On Thu, May 10, 2018 at 8:53 AM, Mani Amoozadeh notifications@github.com wrote:

Unfortunately I do not have any more hints for you!

The last option is to send your example as a file to me and I would have a look at it later on. Also send me an screenshot of your run configuration in eclipse.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/32#issuecomment-387940494, or mute the thread https://github.com/notifications/unsubscribe-auth/AiHiDjgC3bb9ADt56gtbg6U5WHZu8HO5ks5tw7KbgaJpZM4T0iv- .

-- Sourabh Bargi

/****/ /// @file tutorial.cc /// @author Mani Amoozadeh maniam@ucdavis.edu /// @author second author name /// @date Sep 2016 /// /****/ // VENTOS, Vehicular Network Open Simulator; see http:? // Copyright (C) 2013-2015 /****/ // // This file is part of VENTOS. // VENTOS is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //

include "tutorial.h" // including the header file above

namespace VENTOS {

// Define_Module macro registers this class with OMNET++ Define_Module(VENTOS::tutorial);

tutorial::~tutorial() {

}

void tutorial::initialize(int stage) { if(stage == 0) { active = par("active").boolValue();

    if(active)
    {
        // get a pointer to the TraCI module
        TraCI = TraCI_Commands::getTraCI();

        // subscribe to initializeWithTraCISignal
        Signal_initialize_withTraCI = registerSignal("initializeWithTraCISignal");
        omnetpp::getSimulation()->getSystemModule()->subscribe("initializeWithTraCISignal", this);

        // subscribe to executeEachTimeStepSignal
        Signal_executeEachTS = registerSignal("executeEachTimeStepSignal");
        omnetpp::getSimulation()->getSystemModule()->subscribe("executeEachTimeStepSignal", this);
    }
}

}

void tutorial::finish() { if(!active) return;

// unsubscribe from initializeWithTraCISignal
if(omnetpp::getSimulation()->getSystemModule()->isSubscribed("initializeWithTraCISignal", this))
    omnetpp::getSimulation()->getSystemModule()->unsubscribe("initializeWithTraCISignal", this);

// unsubscribe from executeEachTimeStepSignal
if(omnetpp::getSimulation()->getSystemModule()->isSubscribed("executeEachTimeStepSignal", this))
    omnetpp::getSimulation()->getSystemModule()->unsubscribe("executeEachTimeStepSignal", this);

}

void tutorial::handleMessage(omnetpp::cMessage *msg) {

}

void tutorial::receiveSignal(omnetpp::cComponent source, omnetpp::simsignal_t signalID, long i, cObject details) { Enter_Method_Silent();

// if Signal_executeEachTS is received, then call executeEachTimestep() method
if(signalID == Signal_executeEachTS)
{
    tutorial::executeEachTimestep();
}
// if Signal_initialize_withTraCI is received, then call initialize_withTraCI() method
else if(signalID == Signal_initialize_withTraCI)
{
    tutorial::initialize_withTraCI();
}

}

void tutorial::initialize_withTraCI() {

}

void tutorial::executeEachTimestep() { static int departedVehs = 0; // get number of departed vehicles in the current time step departedVehs += TraCI->simulationGetDepartedVehiclesCount();

static int arrivedVehs = 0; // get the number of arrived vehicles in the current time step

arrivedVehs += TraCI->simulationGetArrivedNumber(); std::cout << "\ntime step: " << omnetpp::simTime().dbl(); std::cout << ", departed vehs: " << departedVehs; std::cout << ", arrived vehs: " << arrivedVehs; std::cout << "\n" << std::flush;

} }

bargisou commented 6 years ago

Can I merge and leave different platoon

On Jun 26, 2018 9:49 AM, "Mani Amoozadeh" notifications@github.com wrote:

Closed #32 https://github.com/ManiAm/VENTOS_Public/issues/32.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ManiAm/VENTOS_Public/issues/32#event-1700425880, or mute the thread https://github.com/notifications/unsubscribe-auth/AiHiDiQY5ED2o4tg9nroDEOMTXhE8yeTks5uAbY7gaJpZM4T0iv- .