Special Issue on Distributed Computing and Artificial Intelligence

There is a wide range of military and civil applications where Wireless Sensor Networks (WSNs) and MultiAgent Systems (MASs) can be used for providing contextawareness for troops and special corps. On the one hand, WSNs comprise an ideal technology to develop Real-Time Locating Systems (RTLSs) aimed at indoor environments, where existing global navigation satellite systems do not work properly. On the other hand, agent-based architectures allow building autonomous and robust systems that are capable of working on highly dynamic scenarios. This paper presents two piracy scenarios where the n-Core platform can be applied. n-Core is a hardware and software platform intended for developing and deploying easily and quickly a wide variety of WSNs applications based on the ZigBee standard. In the first scenario a RTLS is deployed to support boarding and rescue operations. In the second scenario a multi-agent system is proposed to detect the unloading of illegal traffic of merchandise at ports. Keywords— Wireless Sensor Networks, Real-Time Locating Systems, Multi-Agent Systems, Maritime Piracy. Manuscript received June 15, 2012. This work has been supported by the Spanish Ministry of Science and Innovation (Subprograma Torres Quevedo). Óscar García is with the R&D Department of Nebusens, S.L.. Scientific Park of the University of Salamanca, Building M2, calle Adaja s/n, 37185, Villamayor de la Armuña, Salamanca, Spain (corresponding author to provide phone: +34923134594; e-mail: oscar.garcia@nebusens.com). Ricardo S. Alonso is with the R&D Department of Nebusens, S.L.. Scientific Park of the University of Salamanca, Building M2, calle Adaja s/n, 37185, Villamayor de la Armuña, Salamanca, Spain (e-mail: ricardo.alonso@nebusens.com). Dante I. Tapia is with the R&D Department of Nebusens, S.L.. Scientific Park of the University of Salamanca, Building M2, calle Adaja s/n, 37185, Villamayor de la Armuña, Salamanca, Spain (e-mail: dante.tapia@nebusens.com). Fabio Guevara is with the R&D Department of Nebusens, S.L.. Scientific Park of the University of Salamanca, Building M2, calle Adaja s/n, 37185, Villamayor de la Armuña, Salamanca, Spain (e-mail: fabio.guevara@nebusens.com). Fernando de la Prieta is with the Department of Computer Science and Automation, University of Salamanca. Plaza de la Merced, s/n, 37008, Salamanca, Spain (e-mail: fer@usal.es). Raúl A. Bravo is with the Department of Computer Science and Automation, University of Salamanca. Plaza de la Merced, s/n, 37008, Salamanca, Spain (e-mail: raulabel@usal.es).


I. INTRODUCTION
IRELESS Sensor Networks (WSNs) are used for gathering the information useful to build context-aware environments, whether in home automation, industrial applications or smart hospitals [1]. Nevertheless, the information obtained by Wireless Sensor Networks must be managed by intelligent and self-adaptable technologies to provide an adequate interaction between the users and their environment. In this sense, agents and Multi-Agent Systems (MASs) [2] comprise one of the areas that contribute expanding the possibilities of Wireless Sensor Networks.
One of the most interesting applications for WSNs is Real-Time Locating Systems (RTLSs). Although outdoor locating is well covered by systems such as the current GPS or the future Galileo, indoor locating needs still more development, especially with respect to accuracy and low-cost and efficient infrastructures [3]. Therefore, it is necessary to develop RTLSs that allow performing efficient indoor locating in terms of precision and optimization of resources. In this sense, the use of optimized locating techniques allows obtaining more accurate locations using even fewer sensors and with less computational requirements [3].
In this sense, Nebusens and the BISITE Research Group of the University of Salamanca have developed n-Core [4], a hardware and software platform intended for developing and deploying easily and quickly a wide variety of WSN applications based on the ZigBee standard [5]. n-Core consists of several modules, fully integrated among them, which provide all the functionalities of the platform through an Application Programming Interface (API), including two engines to develop specific applications, one to build automation applications and another intended for creating Real-Time Locating Systems [4].
This paper, which is an extension of the work published in the proceedings of DCAI 2012 [6], proposes two maritime piracy case studies where n-Core can be applied. The first one consists of a RTLS that can be deployed to support maritime boarding and rescue operations. This system, called n-Core Polaris [ W based on WSNs and MASs and includes the n-Core's innovative set of locating and automation engines. n-Core Polaris is an especially useful tool in environments where it is needed to locate people or assets in real-time with a fast deployment, such as natural or nuclear disasters. This way, the system will support special corps when performing rescue operations that involve a hostile boarding. In this regard, the system will provide them with real-time information, facilitating the coordination of the operation and avoiding casualties.
The second case study consists of a MAS intended for detecting the unloading of illegal traffic of merchandise at ports. On the one hand, the MAS uses the Global Positioning System (GPS) to keep track of the location of ships at a global scale. On the other hand, the system makes use of the WSNs and the automation and locating engines provided by n-Core. This way, the system can detect the proximity of a certain ship to a port, identifying automatically the merchandise that is unloaded. This information is compared with the assets that were loaded at the port of origin, thus detecting and preventing illegal traffic situations.
The rest of the paper is structured as follows. The next section explains the problem description, as well as the research areas involved in the development of the n-Core platform and the n-Core Polaris RTLS. Then, the main characteristics of the innovative n-Core platform and n-Core Polaris system are described. After that, two case studies where the n-Core platform is proposed to be applied to fight against maritime piracy are described. Finally, the conclusions and future lines of work are presented.

II. PROBLEM DESCRIPTION
In recent years, the problem of maritime piracy has become worryingly well-known all over the world due to attacks against fishing ships and oil tankers in Indian Ocean's waters near Somalia coast [8]. These attacks imply substantial human, social and economic costs for the fishing and merchant countries due to military expenses, ransoms, as well as the reduction of the international commerce and fishing. In this regard, the use of technology can help civilian and military personnel both at sea and at ground to face emergency situations, reducing drastically the costs derived from an eventual rescue intervention, as well as the expenses in preventive measures.
Nevertheless, technology should help users to perform surveillance and rescue tasks without distracting them. In addition, technology should increase the knowledge about the environment by users, have a steep learning curve, as well as be non-invasive, context-aware, efficient and inexpensive. Some of the research areas and technologies proposed in this work to fight against maritime piracy are Wireless Sensor Networks, Multi-Agent Systems and Real-Time Locating Systems.
One of the most important technologies used for providing context-awareness for systems and applications is Wireless Sensor Networks (WSN) [1]. Context-aware technologies allow civil and military developments to automatically obtain information from users and their environment in a distributed and ubiquitous way. The context information may consist of many different parameters such as location, the ambient status (e.g., temperature), vital signs (e.g., heart rhythm), etc. Sensor networks need to be fast and easy to install and maintain. In this regard, Wireless Sensor Networks are more flexible and require less infrastructural support than wired sensor networks, existing plenty of technologies for implementing WSNs, such as RFID, UWB, ZigBee, Wi-Fi or Bluetooth [1].
Moreover, the information obtained by WSNs can be managed by intelligent and self-adaptable technologies to provide an adequate interaction between the users and their environment. In this sense, the development of agents is an essential piece in the analysis of data from distributed sensors and gives them the ability to work together and analyze complex situations, thus achieving high levels of interaction with humans [2]. Furthermore, agents can use reasoning mechanisms and methods in order to learn from past experiences and to adapt their behavior according to the context [9].
Tracking the real-time position of people and assets can make the difference in a maritime piracy scenario. One of the most interesting applications for WSNs is Real-Time Locating Systems (RTLSs). The most important factors in the locating process are the kinds of sensors used and the techniques applied for the calculation of the position based on the information recovered by these sensors. Besides, there is a need to develop Real-Time Locating Systems that perform efficient indoor locating in terms of precision and resource optimization [3] [10]. This optimization of resources includes the reduction of the costs and size of the sensor infrastructure involved on the locating system. Real-Time Locating Systems can be categorized by the kind of its wireless sensor infrastructure and by the locating techniques used for calculating the position of the tags (i.e., the locating engine). This way, there is a combination of several wireless technologies, such as RFID, Wi-Fi, UWB and ZigBee, and also a wide range of locating techniques that can be used for determining the position of the tags. Among the most widely used locating techniques we have signpost, fingerprinting, triangulation, trilateration and multilateration [3] [11] [12]. However, each of these must deal with important problems when trying to develop a precise locating system that uses WSNs in its infrastructure, especially for indoor environments.

III. THE N-CORE PLATFORM AND THE N-CORE POLARIS RTLS
Nebusens and the BISITE (Bioinformatics, Intelligent Systems and Education Technology) Research Group of the University of Salamanca have developed the n-Core platform [4]. The n-Core platform is based on the IEEE 802.15.4/ZigBee international standard, which operates in the 868/915MHz and 2.4GHz unlicensed bands. Unlike Wi-Fi or Bluetooth, ZigBee is designed to work with low-power nodes and allows up to 65,534 nodes to be connected in a star, tree or mesh topology network [5]. The n-Core platform consists of several modules, fully integrated among them, which provide all the functionalities of the platform.
At the hardware level, the n-Core platform provides a set of radio-frequency devices, called n-Core Sirius A, Sirius B and Sirius D (Figure 1). Each n-Core Sirius device includes an 8bit RISC (Atmel ATmega 1281v) microcontroller with 8KB RAM, 4KB EEPROM and 128KB Flash memory and an IEEE 802.15.4/ZigBee 2.4GHz (AT86RF230) or 868/915MHz (AT86RF212) transceiver, and several communication ports (GPIO, ADC, I2C, PWM and UART through USB or DB-9 RS-232) to connect to distinct devices, such as computers, sensors and actuators [4].
At the software level, all n-Core Sirius devices are provided with a specific firmware that offers all its functionalities. This way, developers do not have to write embedded code. They can either simply configure the devices functionalities from a specific tool or write high-level code using the n-Core Application Programming Interface (API) from a computer. The n-Core API allows creating easily end-user applications from any compatible language and Integrated Development Environment (IDE), for example, C/C++, .NET, Java, or Python, among many others. n-Core also offers through this API different modules/engines to develop specific applications, including an automation engine (for controlling sensors and actuators), a locating engine (includes innovative algorithms to calculate the position of any n-Core device) and a data engine (for transmitting general-purpose data frames among devices).
Therefore, the functionalities provided by the n-Core Platform allow building systems in a wide range of application areas, including home automation (control of lighting and HVAC, control of electronic devices, security), healthcare (location of patients and medical staff, access control and wander prevention), industry (location of workers, monitoring of assets and dangerous materials, process automation), environment (monitoring of environmental data, irrigation systems, animal tracking) or energy (control of energy costs, monitoring of consumption patterns), among others.
Besides, n-Core Polaris is an innovative Real-Time Locating System also developed by Nebusens and BISITE over the n-Core platform, and features a tested accuracy, flexibility and automation integration [4] [7] [13]. Therefore, the wireless infrastructure of n-Core Polaris is made up of a set of n-Core Sirius devices. In the n-Core Polaris RTLS, n-Core Sirius B devices are used as tags, while n-Core Sirius D devices are used as readers (i.e., position references). This way, n-Core Sirius B devices are carried by users and objects to be located, whereas n-Core Sirius D devices are placed throughout the environment to detect the tags. Finally, n-Core Sirius A devices are used for connecting sensors and actuators through their communication ports. Figure 2 shows the basic architecture of the n-Core Polaris RTLS. The kernel of the system is a computer that is connected to a ZigBee network formed by n-Core Sirius devices. That is, the computer is connected to an n-Core Sirius D device through its USB port. This device acts as coordinator of the ZigBee network. The computer runs a web server module that offers the innovative locating techniques provided by the n-Core API. On the one hand, the computer gathers the detection information sent by the n-Core Sirius D devices acting as readers to the coordinator node. One the other hand, the computer acts as a web server offering the location info to a wide range of possible client interfaces. In addition, the web server module can access to a remote database to obtain information about the users and register historical data, such as alerts and location tracking.
The operation of the system is as follows. Each user or object to be located in the system carries an n-Core Sirius B acting as tag. Each of these tags broadcasts periodically a data frame including, amongst other information, its unique identifier in the system. The rest of the time these devices are in a sleep mode, so that the power consumption is reduced. This way, battery lifetime can reach even several months, regarding the parameters of the system (broadcast period and transmission power). A set of n-Core Sirius D devices is used as readers throughout the environment. The broadcast frames sent by each tag are received by the readers that are close to them. This way, readers store in their memory a table with an entry per each detected tag. Each entry contains the identifier of the tag, as well as the RSSI (Received Signal Strength Indication) and the LQI (Link Quality Indicator) gathered from the broadcast frame reception. Periodically, each reader sends this table to the coordinator node connected to the computer. The coordinator forwards each table received from each reader to the computer through the USB port (or using any other data transmission link, such as a military RF/SAT link). Using these detection information tables, the n-Core API applies a set of locating techniques to estimate the position of each tag in the environment. These locating techniques include signpost, trilateration, as well as an innovative locating technique that takes into account different confidence levels when estimating the distances between tags and readers from the detected RSSI values (due to multipath effects, some detected RSSI intervals are less reliable than others).
Then, the web server module offers the location data to remote client interfaces as web services using SOAP (Simple Object Access Protocol) over HTTP (Hypertext Transfer Protocol). Figure 3 shows a screenshot of the web client Graphical user Interface (GUI). This client interface has been designed to be simple, intuitive and easy-to-use. Through the different interfaces, administrator users can watch the position of all users and objects in the system in real-time. Furthermore, administrators can define restricted areas according to the users' permissions. This way, if a user enters in an area that is forbidden to him according to his permissions, the system will generate an alert that is shown to the administrator through the client interfaces. In addition, such alerts are registered into the database, so administrators can check anytime if any user violated his permissions. Likewise, administrators can query the database to obtain the location track of a certain user, obtaining statistical measurements about its mobility or the most frequent areas where it moves.
Furthermore, users can use one of the general-purpose buttons provided by the n-Core Sirius B devices to send an alert to the system. Similarly, administrators can send alerts from the system to a user or a set of users, which can confirm the reception using other of the buttons. The system not only provides locating features, but also scheduling and automation functionalities. The system can be easily integrated with a wide range of sensors and actuators using the variety of communication ports included in the n-Core Sirius A devices. By means of the automation engine provided by the n-Core API, the n-Core Polaris system can schedule automation tasks, as well as monitor all sensors in the environment in real-time.

IV. PROPOSED SCENARIOS
This section describes two case studies where the n-Core Platform is proposed to be applied to fight against maritime piracy and illegal traffic. First one presents a scenario where the n-Core Polaris RTLS is proposed to be applied to fight against maritime piracy and illegal traffic. The second one proposes a system that allows monitoring automatically ships' merchandise containers.

A. Real-Time Locating System for Boarding Support and Rescue
The system proposed in this case study consists of a Real-Time Locating System that can be deployed to support maritime boarding and rescue operations. In this scenario, the main objective is to avoid casualties, as well as avoid ransom payments and discourage further hijackings. As n-Core Polaris can be deployed in just few minutes throughout the area of interest and works properly indoors, such as buildings or tunnels, achieving an indoor accuracy with just 1m error [4] [7] [13], these features make it suitable for military applications where is required to monitor the position of people and objects in real-time and with minimal installation and deployment times. Figure 4 shows the basic schema of n-Core Polaris running in a boarding and rescue scenario. Each member of the rescue military troops carries an n-Core Sirius B device so that the system can locate him in a certain area at all times, both indoors and outdoors. In addition, some soldiers can carry additional n-Core Sirius B devices to be used as tags by Fig. 4. Schema of the n-Core Polaris RTLS in a boarding and rescue scenario.
civilians. This way, soldiers put an additional n-Core Sirius B device on each civilian, activating it to be tracked by the system. Likewise, some soldiers carry a set of n-Core Sirius D devices to be placed as additional beacons in the environment and acting as distances references in the system. Furthermore, there is an n-Core Sirius A device acting as coordinator node in the system and that can be carried by a soldier or by a boat close to the rescue area. This n-Core Sirius A device is connected to a GPS receiver to obtain its global position as the main reference. In addition, this device is connected to a remote control center through a military radiofrequency or satellite link. The remote control center runs a Multi-Agent System that includes reasoning mechanisms and makes use of the locating techniques provided by the n-Core API, as can be seen in Figure 5. The remote control center gathers the detection data sent by the n-Core Sirius D acting as readers to the coordinator node.

B. Multi-Agent System for Controlling the Unloading of Illegal Traffic of Merchandise
The second case study consists of a system that allows monitoring automatically the containers that are transported from port to port by cargo ships. This system makes use of the n-Core platform and agent technology. This way, each of the containers that are transported by sea carries an n-Core Sirius A device that alerts the system if a container is manipulated improperly during a travel. The load of each container in each ship is controlled when both leaving the source port and arriving at the destination port. By means of GPS technology and radio and satellite communications, the system can know where a container is globally at all times. Thus, the loading and unloading tasks are facilitated, preventing in the same way the traffic of illegal merchandise, such as drug, arms or contraband. Figure 6 shows the schema and main components of the system. As can be seen, each ship container includes an n-Core Sirius A device to identify it, locate it, as well as control if it is opened, stolen, lost, or if it should not be in that ship. All these features are possible by means of the automation and locating engines provided by the n-Core platform. In addition, each ship includes an intelligent system with reasoning mechanisms running on a local server in order to locate and keep track of all containers in the ship (through ZigBee), locate globally the ship (using GPS) and communicate with ports and control centers (via satellite link communications). Furthermore, every ship is registered when leaving and arriving at a port, by means of a MAS that makes use of the n-Core API features and an n-Core Sirius A device for each dock. This way, all containers and their seals are also checked at port. Finally, all ships' load is tracked from port to port using a global MAS aimed at processing massive data.

V. CONCLUSIONS AND FUTURE WORK
Piracy and illegal traffic imply human, economic, social and political costs. In this sense, it is necessary to apply noninvasive, context-aware, efficient and inexpensive technology to minimize these costs. Systems based on Multi-Agent Systems, Wireless Sensor Networks and Real-Time Locating Systems can give support to military and civil authorities to deal with these problems.
There are different wireless technologies that can be used on RTLSs. The ZigBee standard offers interesting features over the rest of technologies, as it allows the use of large mesh networks of low-power devices and the integration with many other applications.
In this regard, the n-Core platform and the n-Core Polaris RTLS can provide an important competitive advantage to applications where it is necessary to gather sensing data, automate tasks and know the location of people or objects. Among its multiple application areas are the healthcare, the industrial or the agricultural sectors, as well as those related to security. Its optimal indoor and outdoor functioning makes the n-Core platform and the n-Core Polaris RTLS flexible, powerful and versatile solutions.
Regarding its performance, the n-Core Polaris indoor locating system has been awarded as the winner of the first international competition on indoor localization and tracking, organized by the Ambient-Assisted Living Open Association (AALOA) [13]. These results demonstrate that n-Core Polaris is a robust system suitable to be used in indoor environments and that can locate users and assets with up to 1m accuracy without interfering in the daily-life of people.
Future lines of work include obtaining ideas from specialized military and civilian users to get feedback and improve the proposed case study. Then, it will be performed a detailed analysis and design process to develop and deploy prototypes to test performance and get additional feedback.