Tag Mobility Code

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)
Is there anything wrong with my question? :P
So has rand->uniformReal(0.0, (numReaders * 2.4)) something to do with what you named 'tag'?

In other words: What the heck is a 'tag' in your context? How does it to come into existence? And how is it stored with 'x'?
Thanks for the reply. Yes rand->uniformReal(0.0, (numReaders * 2.4)) is the range where the tag is stored randomly. In other words: numReaders = 5, so 5 * 2.4 = 12. Now from 0 to 12, the tag is distributed randomly in x location.

In other words: What the heck is a 'tag' in your context?
The tag is a node and has its ID. The ID of the tag basically starts after the numReaders, as you can see in Initialization Section. numReaders = 5 and that's why we have the first tag ID in the output is 6 and it goes up to 50 tags. I just post few of the result from the output as an example.

I can post the whole code if you like!
Well, post the relevant code. Show the code for Location and what 'tag' is.

The tag is a node and has its ID
That sounds as if a list or a tree or something like that is involved.
So do you want to copy a 'tag' node from one list to another?
What could 'tag mobility' mean?
I post the codes from the main file and the location class. Basically these codes from a simulator called RFIDSIM which I am using for my research.

what 'tag' is?
This is a RFID tag.

What could 'tag mobility' mean?
meaning the tag moves from a location to another. And this means same tage ID moves from x to y. I think this has to do with time; maybe I write a function where tag moves from x after a period of time but I am not sure!


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//Main.cpp
for(t_uint i = 0; i < numTags; ++i) {
		
		Location location(rand->uniformReal(0.0, (numReaders* 2.4)),0,0);
		
		NodePtr tagNode = Node::create(location, NodeId(numReaders+i));

		ostringstream userDefinedStream;
		userDefinedStream << "Tag ID: " << tagNode->getNodeId() <<
			" Location: " << tagNode->getLocation();
		LogStreamManager::instance()->logUserDefinedItem(
			userDefinedStream.str());
//location.cpp
#include "location.hpp"

Location::Location()
	: m_xCoordinate(0.0), m_yCoordinate(0.0), m_zCoordinate(0.0)
{

}

Location::Location(float x, float y, float z)
	: m_xCoordinate(x), m_yCoordinate(y), m_zCoordinate(z)
{

}

So does that mean you're simulating a vehicle that moves around with a RFID chip that is scanned at various locations?
If so I'd assume that the scanner are at fixed location? What is the scenario you're simulating?

If you're simulating a physical device you cannot use random numbers for its coordinates.
What you need speed and the direction.

But that depends solely on what you're simulating
Topic archived. No new replies allowed.