• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Simulate TimeStamp,Epoch

 
Ranch Hand
Posts: 41
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I am doing sensor network simulation project. In which I have some functions which deals with Timestamp (like getTimeStamp, becomeIdle, setEpoch).
well I almost simulated whole network part i.e. Random Deployment of sensor nodes, Find the node within the sensing range (neighbours). Establish a routing path, sending packets etc.
Well, Now I require to provide a timestamp for each event of sensor node like send packet, receive packet, sleep, wakeup and I don't have any clue, how can i implement it.

After all the Google searching,finally I decided to tell my problem to javaranch. because this my last resource.

Please give me some hint or logic to deploy timestamps.
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know much about it myself, but TIMESTAMP is usually an SQL concept. There is a java.sql.Timestamp class, which might supply what you require.
There is a 2nd Timestamp class which might also be of use, but it appears to require signatures.
If you Google for MySQL and timestamp, you get this sort of thing.

I hope that is of some use for starters: anybody else able to help?
 
rushikesh kale
Ranch Hand
Posts: 41
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks For reply Campbell,

But I dont want real timestamp. I want to simulate the real world network so require dummy timestamp. I also require epoch (Some Time Interval) to show the event duration of particular operation like,time taken to send packets, Idle time of a particular sensor node. etc.

Anyway,I still need helps regarding this!
 
Campbell Ritchie
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't know.

Sorry.

Anybody else?
 
Ranch Hand
Posts: 1374
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by rushikesh kale:
...Well, Now I require to provide a timestamp for each event of sensor node like send packet, receive packet, sleep, wakeup and I don't have any clue, how can i implement it.

Can you please elaborate it? And how
do you relate it with java.

Originally posted by rushikesh kale:
...After all the Google searching,finally I decided to tell my problem to javaranch. because this my last resource.Please give me some hint or logic to deploy timestamps.

Can you please give some of the string combinations that you tried? And what did you mean by deployment of timestamps?
 
rushikesh kale
Ranch Hand
Posts: 41
Oracle
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my Design detail of the Program:
I created the class SensorNode which is use to create sensor object.
It contains properties like name, id, x coordinate, y coordinate, transmission range etc. I am populating them using getter and setter methods.
In my main class, I am taking following inputs:
1. Number of sensor to be deployed
2. Area of the Network (eg. 1000X1000)
3. Range of the sensor
4. Then, I am generating x and y coordinates randomly in a for loop and storing them in new objects of class SensorNode
5. I am also populating other properties of sensors(name, id, range) inside this for loop.
6. After generating these sensor object, i am storing them in a List.
7. By this, I am deploying the sensors randomly in a particular area.
8. Then, I am trying to find neighbours of each sensor i.e sensors which are placed within the range. and storing them, in Neighbouring array.
9. Now, I am trying to form a network, by implementing routing protocol to connect different neighbours.
10. Then, I wrote a function which simulate the message passing mechanism of a network
11. Now, The thing which is remaining is to provide a dummy timestamp for which i need assistance?
 
reply
    Bookmark Topic Watch Topic
  • New Topic