What is the unit of travel time and speed in Veins? - omnet++

I'm working on Veins in OMNeT++, by using TraCI commands to get the travel time of roads using this method:
double getCurrentTravelTime().
The value which I get from this is very small. So I wondered what the unit of travel time is and also how to get the mean speed in SuMO or Veins?

This commands queries variable 0x5a from an edge. Its meaning is documented on the SUMO wiki, on page http://www.sumo.dlr.de/wiki/TraCI/Edge_Value_Retrieval:
current travel time (0x5a): double, Returns the current travel time (length/mean speed).
Where not specified otherwise, SUMO uses the international system of units, that is, the return value is in seconds.

Related

How can I increase speed of vehicles in Veins?

I am using OMNeT++ 5.4.1, Veins 7.4.1, and SUMO 0.30.0.
As the maximum speed of vehicles in Veins is 13.99, I really want to increase it up to 33. How can I do it? is it possible in Veins or should I do it in SUMO?
You may need to modify the network. Probably the vehicles are only allowed to drive 50 km/h (about 13.99 m/s considering the deviations allowed by the models) on the streets you are looking at. Use SUMO's netedit to edit the maximum edge speeds.

Throughput's change is not logical when mobile UEs are increasing their distance

I'm trying to measure throughput when the distance between two mobile UE is changing. I'm using Omnet++. and measuring throughput in the mac layer.
It's supposed to be that when the distance increases throughput should decrease (well-known inverse relationship)
But in my simulation it doesn't happen. Does anyone have any idea about it in omnet++?
I also attached the chart of throughput during the time
enter image description hereenter image description here
Thanks
#thardes2 Ok, I'm using Omnet++. In my scenario, there is 1 base station and 2 UE without any mobility during the simulation. I run the simulation 20 times (10,20,30 ,... 200m) and try to measure the throughput which is calculated in the MAC layer in the LteHarqBufferRx.cc (in a way total received bytes / simulation time)
double tputSample = (double)totalRcvdBytes_ / (NOW - getSimulation()->getWarmupPeriod());
macOwner_->emit(macThroughput_, tputSample);
I used SinglePair-UDP-Infra scenario in D2D sample in Simulte and verything is working well, but my issue is: Why throughput doesn't reduce when distance increases? Even in some long distance throughput increases!!! Am I calculating throughput in a wrong place?
Thank you for your help

Labview fluid flow

This is a two part question:
I have a fluid flow sensor connected to an NI-9361 on my DAQ. For those that don't know, that's a pulse counter card. None the less, from the data read from the card, I'm able to calculate fluid flowing through the device in Gallons per hour, min, sec, etc. But what I need to do is the following:
Calculate total number of gallons of fluid that has flowed through the sensor since the loop began running
if possible, store that total so that it can be incremented next time the program runs
I know how to calculate it by hand, just not sure how to achieve the running summation required to calculate total amount of fluid that has passed through the sensor, or how to store the variable being incremented at the next program execution. I'm presuming the latter would involve writing a TDMS file, then opening and reading back the data, unless there's a better way?
Edit:
Below is the code used to determine GPM flow through my sensor. This setup is in accordance with the 9361 manual; it executes and yields proper results.
See this link for details:
http://zone.ni.com/reference/en-XX/help/373197L-01/criodevicehelp/crio-9361/
I can extrapolate how many gallons flow per second, or sample period, the 1526.99 scalar is the fluid flow manufacturer's constant - number of pulses per gallon passing through the sensor. The 9361 is set to frequency/period mode, so I'm calculating cycles per second, dividing by the constant for cycles per gallon to get gallons per second/min.
I suppose I could get a time reference by looking at the sample period, so I guess the better question is, how do I keep an incrementing sum?

speed of vechile in veins increases slowly

I'm using veins 4.4, OMNeT++ 5.0 and SuMO 0.25. I have set vehicle speed to 0 to stop them by traciVehicle->setSpeed(0) then after certain case i set them to 20 by traciVehicle->setSpeed(20) to cross the intersection but for no reason it increases slowly till its time finish , so can i make it faster ???
A vehicle in SuMO has the speedMode parameter which determines how it should behave for instance in terms of acceleration and deceleration.
By default this parameters is set to consider all checks like keeping a safe gap to other vehicles and the maximum acceleration. When set to 0 the vehicle ignores all checks like the maximum acceleration.
Try setting different values for the speedMode in Veins to achieve the expected vehicle behavior. You can do so by using the TraCICommandInterface and the TraciVehicle. Have a look at the TraCITestApp for an example. Also you could play around with the maximumSpeed parameter.
i solved the problem by regenerating my map and after that vehicles crossed in its expected speed.i think unknown error occurred in my (.net or .rou ) files while i was debugging my code.

How to get current simulation time in omnet++?

I am measuring energy level when the packet comes to one of the specific LCN from anothers.I want to get the current simulation time when packet arrives to this LCN.To do this, I used
SimTime();
function but it always gives me the 0. So, how can I get current simulation time. I need to draw the energy level of the LCN with respect to time until simulation ends.I mean what is energy level of of LCN when the time is 10? (for example)
When you call SimTime() you actually call the constructor for the class SimTime.
What you are looking for is the global function simTime().

Resources