I am recording the data in omnet++ using the coutVector method the problem I am facing is instead of every time it stores the value in the variable it basically creates a new variable of the same name and stores the data value into it at that instance. my question how to store all the data values in a single variable? At the end of the simulation, I have data in the .vec file but it is 100 variables of the same name and each contains each instance of data in time, I want to make one variable contain all the data. in header file I define,
protected:
cOutVector variable;
in .cc file
variable.setName("Reward");
variable.record(new_var);
That is of my code look like, One thing to clear is that This .cc file will run in each instance of simulation time. Here is the screeshot
It's not visible on your screenshot, but if you widen the Module column a bit, you will probably see, that each row and so each variable named Reward
belongs to a different module. So you most likely call the .record()
method only once for each of your modules. The result is correct in the sense that each module must have its own Reward
variable.