Hello experts, I really need help with this problem. I divided my question into three sections, Initialization, Implementation and Output. Basically Initialization where I initialized my variables and Implementation where I implement the code. In implementation section line 6, There is a loop where numTags is 50. In line 7, the tag is being located randomly in the range from 0.0 to numReaders * 2.4. Location is a class which has three parameters x,y and z and this code is from the main file. Output section shows the result of this code. As you can see in x where the location of tag is stored. This means the tag is static because the location is stored only in x. Don't worry about z.
My question is how can I make the tag mobility? I mean how can I make the tag moves from location x to z?
This code is from a simulator and I am trying to modify it, so I can make the tag mobility. My friend told me that maybe I can use the time in the simulator to introduce tag mobility, but I am still trying to figure out how the time system works.
Please share any idea or suggestion
If something is not clear, please ask me!
1 2 3 4 5 6 7 8
|
//Initialization Section
t_uint numTags = 50;
t_uint numReaders = 5;
//Implementation Section
for(t_uint i = 0; i < numTags; ++i) {
Location location(rand->uniformReal(0.0, (numReaders * 2.4)),0,T);
}
| |
//Output Section
event userDefined -time 0.000000000000 Tag ID: 6 Location: (x=4.80796, y=0, z=0)
-event userDefined -time 0.000000000000 Tag ID: 7 Location: (x=8.3855, y=0, z=0)
-event userDefined -time 0.000000000000 Tag ID: 8 Location: (x=1.77704, y=0, z=1)
-event userDefined -time 0.000000000000 Tag ID: 9 Location: (x=4.59177, y=0, z=1)
-event userDefined -time 0.000000000000 Tag ID: 10 Location: (x=3.01736, y=0,z=1)
-event userDefined -time 0.000000000000 Tag ID: 11 Location: (x=1.75231, y=0,z=0)