travelersgroup

Travelers Management (or anything that moves)

The Travelers Management is an SDDL application based on ContextNet to manage travelers. Although it was originally developed to help travelers and travel agents to communicate among themselves in real time based on their geographical region, the system can also be used to manage people or any mobile entity. Some examples would be students and staff inside a school, recue teams in an action field, etc.

The Travelers Management System tracks the user's location in real time within regions bound by geographical coordinates. Users within the same region can communicate with the group through a gateway. The client software has a free/busy status configurable by the users to allow or deny message receiving. All messages are always sent as broadcasts to the group, never as unicasts to a single user.

To download the source code, click here. Unpack the zip or rar file in a folder preserving the tree structure as shown:

An additional region description with some buildings from PUC-Rio can be downloaded by clicking here.

The standard Java library and three additional libraries are required to compile the Travelers Management System:

The application is divided into two executable modules: DefineGrupo, a service responsible for group assignment, map management, and communication control; and ClienteMovel, client-side application, responsible for updating the client's location, as well as sending and receiving messages. The ClienteMovel also manages the FREE/BUSY client status.

To compile the application, it is necessary to copy all Travalers Management files and folders. Starting at the application root folder, issue the compiler commands as shown.

  • Compiling DefineGrupo:

javac -classpath .:<path to ContextNet>/'*':<path to JMapViewer>/JMapViewer.jar:<path to Commons CLI>/commons-cli-1.3.1.jar -d . br/com/meslin/DefineGrupo.java

  • Compiling ClienteMovel:

javac -classpath .:<path to ContextNet>/'*':<path to JMapViewer>/JMapViewer.jar:<path to Commons CLI>/commons-cli-1.3.1.jar -d . br/com/meslin/ClienteMovel.java

The regions are described in a text file using geographic coordinates (Java-style floating-point numbers) as the vertices of a polygon. A region may be concave or convex with as many vertices as necessary. All region files should be listed in another text file, one filename per line. The following is an example of a region-file list file and region file:

  • File with a region-list file:
regiao1.txt
regiao2.txt
regiao3.txt
regiao4.txt
regiao5.txt
  • File with a region description:
9.1 16.2
11.3 13.4
14.5 11.6
11.7 9.8
9.9 6.0
7.1 9.2
4.3 11.4
7.5 13.6

Now it is necessary to start the OpenSplice, the DefineGrupo and some ClienteMovel applications. The best way to accomplish this task is to open a command line window (terminal or console) for each one. Putting some applications in the background in the same window may cause the output of them to be interleaved and misunderstood.

It is necessary to use the Primstech OpenSplice, an open-source SDDL implementation. The OpenSplice can (or cannot) be downloaded from http://www.prismtech.com/dds-community. Installation and execution instructions are found at http://www.lac-rio.com/dokuwiki/doku.php?id=installingdds.

  • Starting OpenSplice:

java -jar <path to ContextNet>/contextnet-2.5.jar <gateway address> <port> OpenSplice

Note.: during simulation, you can use your computer or 127.0.0.1 (localhost) address as the gateway address. The standard port is 5500.

First, the OpenSplice should be started and then the DefineGroupo service should be started as shown below. The region-list file name can be informed as an optional command line parameter. If not provided, the file name will be “nomes.txt”.

  • Starting DefineGrupo:
java -classpath .:<path to ContextNet> /'*':<path to JMapViewer>/JMapViewer.jar:<path to Commons CLI>/commons-cli-1.3.1.jar br.com.meslin.DefineGrupo <region-list file name>

After starting SDDL and DefineGrupo applications, the ClienteMovel client can be started. Each client can use an exclusive or a shared path description file. The path file consists of an integer number that represents the amount of time in milliseconds that a user will stay in a place and two Java-style floating-pointing numbers representing the latitude and longitude of the geographic coordinates. Below is an example of a path file:

  • File with a path:
10000 9 11
10000 6 18
10000 6 6
10000 13 9
10000 13 4
  • Starting one ClienteMovel:
java -classpath .:<path to ContextNet> /'*':<path to JMapViewer>/JMapViewer.jar:<path to Commons CLI>/commons-cli-1.3.1.jar br.com.meslin.ClienteMovel -f <client-path file name> -u <username>

The –f <client-path file name> is an optional command line parameter as the –u <username>. The client-path filename default is “caminho.txt” and the default username is usuario<some number>.

Note.: the username must be unique because it is the user ID.

As the ClienteMovel client applications issue many log messages to the standard error output while running, to make a clear output interface, the standard error output may be redirected to /dev/null or to another terminal (issue the tty command at the other terminal to discover its name) as shown below:

  • Starting ClienteMovel redirecting the log output to null:
java -classpath .:<path to ContextNet> /'*':<path to JMapViewer>/JMapViewer.jar:<path to Commons CLI>/commons-cli-1.3.1.jar br.com.meslin.ClienteMovel -f <client-path file name> -u <username> 2> /dev/null

The ClienteMovel client application can send messages to all users in its region. If the client is within more than one region, the message is sent to all users in all its regions.

Users can disable message receiving by sending the command [BUSY] as a message. This message will not be sent to the group. To enable message receiving, the command [FREE] must be sent as a message – it will not be sent to the group. Even in the [BUSY] state, users can send messages to their groups, but will not receive any group messages. Messages are shown only in the [FREE] mode.

Some screenshots are shown below:

  • Map with five regions and four users:

  • PUC's buildings as regions:

  • User sending messages (Please notice the use of CTRL-R to rewrite the message):

This work is a task of Introduction to Mobile Computing course, 2016, second semester. Computer Department, PUC-Rio.

Alexandre Meslin: meslin@inf.puc-rio.br

  • travelersgroup.txt
  • Last modified: 2017/07/21 03:08
  • (external edit)