On Ordering Multi-Robot Task Executions within a Cyber Physical System

02/08/2018 ∙ by Tushar Semwal, et al. ∙ ERNET India 0

With robots entering the world of Cyber Physical Systems (CPS), ordering the execution of allocated tasks during run-time becomes crucial. This is so because, in a real world, there can be several physical tasks that use shared resources that need to be executed concurrently. In this paper, we propose a mechanism to solve this issue of ordering task executions within a CPS which inherently handles mutual exclusion. The mechanism caters to a decentralized and distributed CPS comprising nodes such as computers, robots and sensor nodes, and uses mobile software agents that knit through them to aid the execution of the various tasks while also ensuring mutual exclusion of shared resources. The computations, communications and control, are achieved through these mobile agents. Physical execution of the tasks is performed by the robots in an asynchronous and pipelined manner without the use of a clock. The mechanism also features addition and deletion of tasks and insertion and removal of robots facilitating On-The-Fly Programming. As an application, a Warehouse Management System as a CPS has been implemented. The paper concludes with the results and discussions on using the mechanism in both emulated and real world environments.

READ FULL TEXT VIEW PDF
POST COMMENT

Comments

There are no comments yet.

Authors

page 21

This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

1 Introduction

While robotic applications are fast making inroads into a plethora of automated systems, the tight coupling between the application and the robotic hardware seem to deter both their scalability and flexibility. The need of the day is to transform such automated systems into ones that are malleable and accessible over a network. Through this transformation, a fair amount of generic nature can be embedded within such systems, thereby allowing for changes to be made in the patterns or nature of executions of the tasks performed. This flexibility can be realized only if we facilitate networking among all the entities within these systems. Networking can allow the entities to communicate with one another and resolve several issues that crop up during run time. If the entities are mobile, the network becomes dynamic and makes one-to-one communication, a much disorganized task. A centralized approach for controlling the entities may perform well but makes the system rigid, expensive and hardly scalable. On the contrary, a decentralized and distributed control mechanism coupled with a mobile computing environment can empower these systems with autonomy, flexibility and scalability. Such automated scenarios can be viewed to be made up of two basic components – a cyber component that caters to both computing and networking of the entities and a set of physical processes which are executed in the real world by a set of robots using percepts received from either on-board sensors or sensor nodes. Considering the fact that the physical processes are initiated, linked and to some extent controlled by the cyber component, this type of a system can be categorized as a Cyber-Physical System (CPS) [Baheti and Gill (2011)]. Hence, a networked Multi-Robot System (MRS) coupled with a mobile computing environment can provide a fitting framework for a CPS.

Research in MRS has mostly been focused broadly on two main areas viz. task allocation and task partitioning. In the former [Gerkey and Mataric (2001)], tasks are assigned to the appropriate participating entities (robots) in such a way that a desired performance level can be achieved with complete utilization of available resources. The latter, on the other hand, is the process by which a task is divided into a set of subtasks so as to reduce the complexity of its execution [Ratnieks and Anderson (1999)]. Apart from these, there is also a third objective crucial to an MRS based CPS viz. that of task execution which is grossly ignored in MRS specifications. Task execution is an inherent objective (usually defined by the user) that always commences after task allocation or partitioning. While the allocation and partitioning are merely planning models, task execution adheres to the actual implementation which validates the assignments of the tasks. Hence, both task allocation and task partitioning are dependent on task execution without which a task cannot be said completed. Early work on Multi-Robot Task Allocation (MRTA) by Parker 1998 describes an architecture where fault tolerance was incorporated in a heterogeneous set of robots for carrying out different tasks. They demonstrated dynamic task allocation (a subclass of task allocation) within an MRS. A formal analysis of the problems faced in MRTA has been presented in Gerkey and Mataric (2003). Botelho and Alami 1999 describe a technique for allocation and reallocation of tasks. In their work, each robot is provided with details of its own plan. A robot is allowed to make changes in its plan depending upon its capabilities as also those of the other robots. The use of auctioning techniques based on dynamics of a market has been proposed by Dias and Stentz 2000, where the robots are assigned tasks through negotiations with their peers in a distributed manner. Khaluf and Rammig 2013 narrow down the scope of task allocation to time-constrained tasks. However, they have ignored the complexities of real-world task execution and provided only the simulation results.

The approaches discussed so far do not address the complexities involved in ordering of actual task executions in the real world. Ordering such executions requires a careful understanding of the available resources needed to complete a task within a CPS of robots. These resources may be either exclusively available to every robot or they may need to be shared. If the resources are to be shared by the robots within a CPS for the completion of their assigned tasks, then a mechanism for mutual exclusion of shared resources becomes mandatory in order to avoid contentions and deadlocks. Tasks involving shared resources are common in the real-world. For instance, a ticket counter where people wait in a queue, is a typical example of a shared resource. In the realm of MRS, a sole battery-charging terminal where at an instant only one robot can plug-in and charge itself, forms an example where mutual exclusion needs to be exercised. The mutual exclusion problem in an MRS can be solved using centralized control. The central controller can monitor and communicate with all the robots regarding their turns to gain access to all the shared resources. Though simple and straightforward, this solution could drastically load the central controller with heavy computational and communication overheads. Further, any change in the CPS would mean bringing down the central server.

In the domain of distributed computing, the Mutual Exclusion of shared Resources (MER) is referred as a classical benchmark problem to resolve resource contentions Raynal (1986). MER is required when different nodes need to access a shared resource at the same time, lest a race condition Raynal (1986) occur. A CPS constituting mobile networked robots could be looked upon as a Mobile Ad-hoc Network (MANET). The problem of MER becomes more complicated in the context of MANETs Basagni et al. (2004) wherein mobile nodes move in a disorganized manner leading to dynamism in the communication topology. In addition, MANETs are constrained with limited bandwidth, low power usage, low computations capabilities, dynamic topology, etc. Fife and Gruenwald (2003) that increases the complexity of the MER problem as compared to their static counterparts. Solutions to the MER problem in distributed and dynamic networks can be broadly divided into two categories Anchal et al. (2014) — token based and permission based. In the token based approach, a node with a unique token can access the shared resources while others have to wait for the arrival of the token. On the other hand, in the permission based approach, a node can get access to a shared resource if it can get permissions from all other nodes in the network by exchanging messages. Since, in this approach, a node sends a request for getting access through messages to all the connected nodes, it consumes bandwidth and thereby introduces network latency. Although many variants of the MER problem have been proposed Chandy and Misra (1984); Hadzilacos (2001); Bulgannawar and Vaidya (1995); Attiya et al. (2010), an adaptive and scalable solution in context of a CPS, wherein the entities performing tasks need to share physical resources in the real world, has still not been proposed. Wu et al. 2015, have modeled the problem of mutual exclusion of traffic intersections as a variant of the classical mutex problem. Vehicles compete to get access to the traffic intersection by exchanging messages. A vehicle passes through the intersection when it receives permissions from other vehicles involved in the competition. Their approach however, uses multiple messages which lead to communication overheads and network latency. Minimizing such overheads while ensuring MER is crucial for the performance of a CPS.

Depending upon their nature, tasks can be divided into two types - (i) Independent and (ii) Sequential. Independent tasks can be executed in isolation and thus do not in any way rely on other tasks. By sequential, we mean that these tasks follow a topological order such that a task say, is executed only if the execution of the preceding task is completed. In a typical computing environment, when a program includes both parallel and sequentially executable instructions or methods, the associated compiler separates the independent ones from the sequential ones. Based on the program, it assigns the independent ones to individual cores within a multi-core processor to maximize parallelism. The number of such cores which could be looked upon as independent processing units, naturally do not change. On the contrary in a real world multi-mobile-robot scenario where robots are synonymous to such computing cores, this may not be the case. The number of robots available to perform a set of tasks may vary over time. Such variation could be due to the fact that some robots may need to be charged while others could have malfunctioned for some reason. Their number could also increase, if more robots are deployed into the scenario. A precompiling procedure to initially allocate sequential and independent tasks to a set of robots, as in a typical multi-core computing environment could be disastrous.

Further, in the physical world, tasks could be interdependent by virtue of the fact that they require both robots and resources to get executed. For instance, consider the case where robot is to execute a task using a resource while robot is to execute task using the same resource . In this scenario, assuming and to be independent tasks, it can be observed that though both robots and are free to execute the two tasks, the non-availability of concurrently to both and creates a bottleneck. One of them has to wait for the other to free the resource forcing and to be executed sequentially executed. It may be noted here that, independent tasks may also suffer from similar bottlenecks when they require the same resource. Under such conditions, this resource dependency forces these independent tasks to be executed sequentially. One can thus conclude that a technique that can handle the ordering of all types of tasks on-the-fly while also catering and effectively utilizing the varying number of mobile processing units, forms a sine qua non for CPSs comprising mobile robots.

In this paper, we formulate the problem of ordering the execution of sequential, independent and interdependent tasks to be executed by multiple mobile robots within a CPS and propose a mechanism to solve the same. An agent based approach has been formulated to ensure MER among multiple robots connected to form a dynamic network. A sequence of topologically ordered and interdependent tasks that involves shared resources, forces their execution in the form of a pipeline. Since the number of mobile robots available to execute a set of tasks could vary, we have tried to portray these robots as a pipeline wherein the number of processing units could vary during run-time. A conventional pipelined computing architecture requires a clock in order to synchronize and allocate proper time slots for the execution of processes. The execution times for the various tasks performed by a set of robots however, vary over time due to several real-world problems. If a pipeline needs to cater to such varying times required for the executions, it should possess an inherently adaptive clocking mechanism so as to compensate for such variations.

The algorithm proposed in this paper is novel in the sense that: 1) In this work, we have used intelligent messages in the form of mobile agents to solve the problem of mutual exclusion while executing tasks in a multi-robot distributed environment. Conventional distributed scenarios as in Wu et al. 2015, use message broadcasts to share information and ensure mutual exclusion of shared resources. Message broadcasting drastically increases the communication cost Wu et al. (2015) and can clutter a network. In the proposed mechanism, we have used a conscientious agent migration strategy Minar et al. (1999) which has least inter-node communication cost Godfrey et al. (2013) as compared to other agent based approaches such as CLInG Sempe and Drogoul (2003), EVAP Chu et al. (2007) and Random-walk with cloning Gaber and Bakhouya (2008). 2) Synchronization in distributed settings is a major challenge and is traditionally achieved by using a single node (or a subset of nodes) which provide for clocking. This poses issues of reliability when such nodes fail. In the domain of robotics, the problem of synchronization deteriorates since the time required to execute a given task by a robot can vary due to several environmental factors. In the mechanism proposed herein, the agents ensure an inherent adaptive clocking mechanism to achieve synchronization across the network of robots. In addition, features such as concurrent execution of tasks, on-the-fly addition and deletion of tasks and inclusion and removal of robots, emphasize the flexibility and versatility of the proposed mechanism. Finally, a Warehouse Management System (WMS) as an application has been implemented to demonstrate the feasibility of our approach.

In brief, our major contributions towards the Task Execution Ordering Problem (TEOP) are -

  1. A mobile agent based distributed mechanism for ordering multi-robot task executions.

  2. A solution for the MER problem among multiple robots within a CPS.

  3. Validation of the proposed mechanism through emulation.

  4. Real world implementation of the proposed mechanism with WMS as an application.

The remaining part of paper is organized as follows: Section 2 discusses agent based systems and their applications. Section 3 describes the constituents and system specifications of the proposed CPS. The Task Execution Ordering Problem (TEOP) among multiple robots and the inherent objectives for realizing the CPS are discussed in Section 4 while the proposed mechanism is described in Section 5. Section 6 describes a real-world implementation of the proposed mechanism while Section 7 presents the results obtained in both the emulated and real-world scenarios. Finally, Section 8 concludes the paper and provides directions for future work.

2 Agent based Systems

An agent is as an intelligent software code that has a certain degree of autonomy Franklin and Graesser (1997). Agents are smart beings that reside in the cyber world and carry out tasks or computations on behalf of the users. As human beings in the real-world, agents form their counterpart in the cyber world. They are autonomous, decisive, flexible, adaptive, reactive, pro-active, social, have locality of reference and many other features Schumacher (2001). Agents can be broadly divided into two types — static agents and mobile agents. Usually agents are stationary entities which occupy a fixed location within a networked environment. Mobile agents on the contrary are distinguished by their mobility which allow them to move freely within a network of nodes. Since, mobile agents form an important component of the proposed mechanism for executing and ordering of a sequence of interdependent tasks within a CPS of multiple robots, the succeeding section presents a brief background on the use of these agents.

2.1 Mobile Agents

As mentioned, a mobile agent is a program that can migrate from one node to another within a network and can perform autonomous computations. Along with mobility, these agents also possess other abilities such as cloning, autonomy, payload carrying capability, on-node execution, local decision making, adaptability, etc. Outtagarts (2009). Mobile agents have been used in a myriad of applications ranging from wireless sensor networks Chen et al. (2007), e-commerce Maes et al. (1999), robot control Kambayashi et al. (2005); Godfrey and Nair (2008), security Boukerche et al. (2007) and e-learning Zaiane (2002). Posadas et al. 2008 highlight the advantages of using mobile agents for controlling mobile robots using two approaches of executing tasks. In the first approach, all the mobile robots communicate with a central server to get the necessary actions which aid in the completion of a set of tasks. In the second, the mobile agents are released into the network of mobile robots. These are then made to execute programs locally on each mobile robot based on their local decision making capabilities. The authors report that the latter approach is more effective in terms of time required to execute an action by a mobile robot when compared to the former centralized method. This is so because considerable time is wasted in communication with the central server.

Godfrey and Nair 2012 describe how mobile agents can be used to provide services in an MRS. They also compare the performance of mobile agent migration strategies. Some of the important reasons for the use of mobile agents for the realization of distributed systems are Cruz-Cunha (2011)

  1. Network traffic and latency reduction: Mobile agents perform computations and interactions locally at a node. This results in faster response and avoids excessive message passing.

  2. Adaptation and customization: In traditional distributed systems, as the protocols evolve for transmitting and interpreting the outgoing and incoming data respectively, it becomes cumbersome to update the servers and creates a legacy problem Lange (1998). In such scenarios, mobile agents provide for flexibility as clients can dispatch them to the server for establishing the amendments to the protocols.

  3. Robustness and fault tolerance: In dynamic and distributed networks, it is impractical to continuously maintain static communication links among the nodes. In such cases, the tasks required to be executed can be embedded within the mobile agents. These agents can then be dispatched into such dynamic networks. After being dispatched, these agents become independent and operate autonomously by carrying out executions at the designated nodes in the network. The results can be accumulated later by reconnecting with these agents.

Mobile agents thus can serve as an effective tool for realizing distributed mechanisms over a network of nodes.

2.2 Mobile Agent Framework

A mobile agent framework is an execution environment or a platform which provides support for agent development, programming and deployment within a network. It provides tools for the users to create and manage agents and their behaviours. The agents (static and mobile) are managed by the framework in order to ensure their successful execution and operation. There are various mobile agent frameworks available in a variety of programming languages such as Java, C/C++ or Prolog. JADE Bellifemine et al. (2001), a Java based agent framework, is known for its simple development process along with FIPA 2000 compliance. Mobile-C Mostinckx et al. (2009) is a purely C/C++ based agent framework which, due to its small code size, readily supports embedded devices. JINNI Tarau (1999), Typhon Matani and Nair (2011) and Tartarus Semwal et al. (2015, 2016), being Prolog based frameworks, facilitate rapid prototype development. The work reported herein uses Tartarus, a mobile agent framework for the development and management of static and mobile agents. We have chosen Tartarus as it supports rapid prototyping, multi-threaded execution and faster mobility. In addition, it comes with a pre-installed plug-in channel which allows for the control and interaction with other embedded devices and sensors.

3 Preliminaries

This section presents the entities and characteristics that make up the CPS used herein followed by a formal description of the problem at hand. Further, we discuss the mechanisms to ensure MER when the tasks within a CPS need to be executed in a sequential manner. The manner in which the tasks can be altered, added or removed on-the-fly in/from the sequence is also be illustrated.

3.1 Constituents of the proposed CPS

A CPS is an amalgam of both the cyber and the physical worlds where the term cyber comprises computations, communications and control while the term physical comprises interactions with the real world Shi et al. (2011). Our proposed CPS is composed of heterogeneous entities such as a Multi-Robot System (MRS), mobile agents, sensors and computer nodes. Mobile agents form the cyber entities which carry out computations, manages all the communications and control the dynamics of the MRS. The interaction of robots with the external surroundings where robots execute the sequential tasks forms the physical component. Following are the basic constituents of the proposed CPS under consideration:

  1. Nodes: A node refers to any device that is capable of computations and communications and hosts an agent framework. It can be an embedded system, a personal computer, a robot or even a sensor node. Nodes are connected to each other to form a network W.

  2. Network: A network W is a dynamic wireless Mobile Ad-hoc Network (MANET) wherein a node can connect or disconnect to another node at any point of time. The connections are inherently managed by the nodes within the network using any of the available mechanisms Dhenakaran and Parvathavarthini (2013).

  3. Robots: A set of networked robots R ={|} all of which hosts an agent platform within and can connect to the network W in an ad-hoc manner. These are essentially a subset of nodes responsible for the execution of tasks. Robots are mobile and are equipped with sensors and actuators that enable them to sense their environment and act upon them, respectively.

  4. Tasks: A set of finite tasks T = {|}, capable of being executed by the set of robots R.

  5. Resources: Utilities and nodes other than robots, such as a path, parking/charging bays, a rack containing items which can act as a node, sensor nodes, etc., in the MRS environment required by a robot to accomplish a task, constitute a set of resources = {, , ,…,|}. Resources need to be shared amongst robots in the set R while a robot executes the tasks in T. Once a robot takes over a resource(s), it becomes non-shareable before it is freed by the robot. For clarity, two forms of conventions have been followed in this paper viz. and , where for the task , is a particular resource from the set while .

  6. States: States pertain to robots. indicates that a robot is in state and requires to execute the task . All free robots remain in the state designated as .

  7. Agents: A set of mobile agents = {, , ,…,|}, such that each mobile agent , carries the programs of its associated tasks as its payload. It may be noted that each agent carries the programs for a set of task(s) assigned to it along with the information of the required set of associated resources. An agent also carries with it the State Information (SI) in the form of of the robots which it can serve, and the next state to which the robots transit after execution of .

  8. Job: A Job is a collection of tasks in T along with the associated set of resources in , which are required to be executed by the robots in R and constitute the basic inputs to the system. Here, {(,),(,),..,(,)}, is the task of job and . The intersection of subsets of the type need not be a null set indicating that a particular set of resources could be required by more than one task. These jobs are processed and packed into mobile agents by a Job Distributor . New jobs received by the could commence their execution even when their predecessors are being executed.

Here k, n, r and m I where I is a set of positive integers.

3.2 System Specifications

For a better insight into the complexity of the proposed CPS, the specifications and behavior of the system need to be defined precisely. Listed below are some pertinent points about the system —

  1. The number of nodes in the network W is finite.

  2. Any node can connect or disconnect from the network W at any instant of time.

  3. The system is completely oblivious of the total number of robots R present in the network W at any point of time.

  4. The number of mobile agents inhabiting the network W varies dynamically with the change in the sequence of tasks.

  5. The sequence in which the tasks in the set T need to be executed may be changed as per the requirements.

  6. Each of the robots and the agents are autonomous entities capable of carrying out independent executions.

  7. There is no direct robot-to-robot or agent-to-agent communication.

4 The Task Execution Ordering Problem (TEOP)

Consider a CPS with a finite number of homogeneous robots. Each robot is required to carry out the execution of a finite number of tasks that are interdependent. Since all the robots are required to execute such tasks, a robot may need a set of resources which are shared among its peers. This invokes the necessity for the mutual exclusion of these resources while executing the tasks. As discussed earlier, in the real world the number of robots available for task execution may vary with time. In addition, one may need to alter, add or delete tasks on-the-fly. Under such circumstances, ordering the task executions on-the-fly, becomes a challenging problem. We have modeled this problem as a Task Execution Ordering Problem (TEOP) and proposed a solution to the same using a set of mobile agents.

Figure 1: Graph depicting the inherent sequential and interdependent nature of execution of tasks

For simplicity, consider a straightforward scenario where each task requires a single resource . The scenario can be easily extended to more complex ones where instead of a single resource, a task may require a set of resource which may be common with those of other tasks. Figure 1 represents the problem in the form of a directed acyclic graph. Each node of the graph represents a robot performing a task using the resources in with the help of a mobile agent . Additionally, there are some nodes which represent the operator - AND (.). This operator makes sure that a certain robot can perform a task if and only if the previous dependent task is completed (the sequential execution constraint). Since mobile agents carry the programs of the corresponding tasks, this translates the actual dependency of execution onto these agents. Hence, if a robot is vying for resources to execute a task , the mobile agent carrying the program for the task must be free and available in the network. By free, we mean that the mobile agent should not be resident within a robot nor aiding the execution of the associated task.

The graph shown in the Figure 1

depicts the manner in which the robots execute the tasks while also ensuring mutual exclusion. It may be noted that all the nodes having the same colour correspond to the same robot. Thus only one of these same-coloured nodes can be active at any moment of time. For instance, the red coloured nodes stand for the robot

. The tasks , and thus cannot be executed concurrently since they all need to be executed by the same robot viz. .

As an explanatory example, consider the node denoting execution of task by robot using resource and mobile agent . In order to traverse to this node, both inputs to the AND node viz. and need to be TRUE i.e. should have executed task using and and should have executed using and . This indicates the sequential nature of execution of tasks by viz. . Additionally, the interdependency between and its predecessor nodes and can also be observed. This means that (carried only by agent ), which requires resource for execution, cannot be executed by multiple robots at the same time thereby ensuring mutual exclusion.

4.1 The Inherent Objectives

With several robots and shared resources, ordering the executions of sequential, independent and interdependent tasks, becomes a complex task especially when the number of executing robots and tasks vary at run-time. This section discusses this problem of ordering in terms of its segregated objectives.

Objective 1. The main objective of the work presented in this paper is to honour the mutual exclusion of the use of resources by the robots in R while executing all the tasks in the set T. Let be a binary function that returns during the time slot when the robot has acquired resource . Hence the objective is

subject to

(1)

at any time instant .
Here, execute(, T) denotes that the robot R executes the tasks in the set T. As can be observed from Equation 1, the constraint of the objective function essentially denotes the MER amongst the robots such that no more than one robot can acquire the same resource at any given time.

The Objective 1 essentially makes the robots in R to align their executions in the form of a pipeline. Pipelining Null and Lobur (2014) is extensively used by the computer processors in order to increase throughput. It facilitates the execution of the several of instructions in a single unit of time. For instance, the three main subtasks performed by processors to complete the execution of an instruction are – Fetch, Decode and Execute Null and Lobur (2014). In the absence of a pipeline, the processor has to finish the first instruction which it received from the memory and then move towards the next instruction sequentially. This makes the other functional units of the processor such as the ALU to idle while the Fetch instruction is being performed. However, in a pipelined architecture, when the processor is busy executing an instruction, other units within, can perform other subtasks concurrently. However, these subtasks need to be synchronized by a common clock. Any increase or decrease (addition/deletion) in the number of subtasks can cause asynchronism. This gives rise to our second objective.

Objective 2. The second objective is concerned with maintaining the time period of each stage in the asynchronous robotic pipeline. A pipeline in the context of processors comprises a set of cascaded tightly coupled processing elements. The output of one is given as input to the next. These elements are driven synchronously by a clock whose time period is set to a value greater than the maximum delay incurred between the elements in the pipeline. Finding this maximum time delay and setting the clock accordingly is possible in the domain of a computing system as the execution and delay times once fixed, never change. However, in real world robotic scenarios, these timings depend on the task at hand and the conditions and position or location of the robot. In other words, the time to execute a task could vary temporally. This adds another dimension of complexity since the asynchronously executed tasks whose execution times vary, could cause problems when the robot(s) try to access a shared resource. Under such conditions the use of a synchronous lock whose time period is set to a constant value a priori could prove to be disastrous. It may be noted that when n robots are executing n tasks, each with distinct resources concurrently, the robotic pipeline is full and operating at its maximum, thus satisfying the following optimality criteria –

(2)

at any time instant .

Figure 2: Pipelined execution of a set of sequential and interdependent tasks having shared resources in the proposed CPS where different colours indicates different robots

Objective 3. The final objective of our work is to facilitate the concept of on-the-fly ordering. In our proposed CPS scenario, one may require to modify, add (insert) or delete tasks in/from the set T on-the-fly while the robots are executing tasks in the current set T. Further, it may happen that the robots themselves, which are analogous to the processing elements in a pipeline, need to be inserted or removed due to failures, low batteries etc. Hence, providing such flexibilities to the end users of such a system is of vital importance.

Taking all these challenges into consideration, we have converted the graph in Figure 1 into a pipeline model as depicted in Figure 2. The vertical axis in herein represents the robots in action while the horizontal one represents the time slots when the robot uses the resource in order to accomplish task . In addition, denotes pipelines formed at time slots 1, 2, 3,…,n respectively. As discussed earlier, it can be seen that in time slot 2, the program carried by facilitates to execute using the resource . Concurrently, executes using the program in and the associated resource . Both and remain resident on the respective robots and until the tasks are accomplished and thus are not available to any other robot during slot 2, thus ensuring mutual exclusion among the robots. It may also be noted that executes whose program is carried by using in time slot 3 only after and both have executed and respectively as shown in Figure 1. It can be seen that in the time slot, the pipeline becomes full with all robots , ,…,  in states , , ,…,  executing the allocated tasks , , ,…,  using the associated resources , , ,…,  respectively without any contention. It may be noted that these associated resources could be subsets of , namely , , ,…, .

In the next section, we present the mechanism to achieve the objectives listed above.

5 The Proposed Mechanism

In the CPS scenario used herein, the robots initially reside at a bay or docking station and their states are initialized to . This signifies that all the robots in R are currently vying to execute the associated task viz. . As mentioned earlier, every robot hosts an agent framework that allows these agents to knit through them.

In addition, all the mobile agents in are also released into the network W by the Job Distributor . Task ordering among the jobs is highly dependent on how the assigns tasks and their associated resources to the agents. Thus, a separate section is provided for its discussion along with an underlying algorithm.

5.1 Job Distributor

The Job Distributor assigns the various subsets ({}) within a job to corresponding agents along with the information on the associated set of resources required to execute the tasks. It also embeds the State Information (SI) of the robots it can serve together with next state to which the robots need to transit. Further, the also maintains a list of already assigned resources so that the same resource is not assigned to other agents. An agent returns to the when the assigned task(s) has been executed thereby relinquishing the associated resources. In the example graph shown in Figure 1, a simple scenario was chosen where a task requires only a single resource. But in a real world, it is natural to have tasks that require multiple resources which may need to be shared with other tasks. Further, the tasks within a job could be sequential or independent. The task assignment strategies followed by the for different scenarios are described below:

A. Only sequential tasks – Consider a warehouse scenario wherein an item has to be first fetched from a rack, carried to a packing station and finally packed and shipped to its desired destination. This job comprises a total of 3 sequential tasks - Fetching (), Carrying () and Packing (), all of which are sequential in nature. For cases when these tasks use different resources, the assigns a distinct agent for each task together with the associated set of resources. Thus and , are embedded in . Likewise, and and and are embedded within and . The SI and next SI written onto each of these agents , and are – , and respectively. Since is the last task of the job, the next SI is stored as thereby freeing the robot executing this job. These 3 mobile agents are then released into the network.

B. A mix of sequential and independent tasks – Imagine a job that involves a request for exchange of an item. The set of tasks comprising this job could be - first Fetch () the new item, then Carry () it to the packing station and then Pack () the same. While these tasks are being executed by one robot in a sequential manner, another robot could concurrently Stamp () the item as defective (or some such) and Place () it back to the concerned rack. Since the two sequences ( and ) are independent of each other they do not share any resources. For such kind of jobs, the sets the SI of the assigned agents , and to , and and that of and to and , respectively. This parallel execution of the two sequences ( and ) within a job improves both time and robot utilization.

1:  Input: A Job in the form of a set of tasks and associated resources {Jobs can arrive at the Job Distributer asynchronously}
2:  Output: A set of mobile agents with each agent containing a task(s) and its associated resource(s)
3:  repeat
4:     if All tasks in are Sequential then
5:        if Resources required are available then
6:           if Multiple tasks require same set of resources then
7:              Follow steps as described in Section 5.1.C;
8:           else
9:              Follow steps as described in Section 5.1.A;
10:           end if
11:        else
12:           Wait for the mobile agents to return and relinquish the resources back to the ;
13:        end if
14:     else if Tasks in are a mix of Sequential and Independent then
15:        if Resources required are available then
16:           if Multiple tasks require same set of resources then
17:              Follow steps as described in Section 5.1.C;
18:           else
19:              Follow steps as described in Section 5.1.B;
20:           end if
21:        else
22:           Wait for the mobile agents to return and relinquish the resources back to the ;
23:        end if
24:     end if
25:  until Job is present
ALGORITHM 1 Sequence of steps followed by the Job Distributor

C. Multiple tasks using the same resource(s) – In the above two cases, we assumed that the tasks that were sequential did not use a common resource i.e. (). It may happen that a job comprises two or more tasks which require the same set of resources. Under such conditions, the task assignment is done purely on the basis of the shared resource needed. For example, if is required to execute tasks and while requires . Thus, and are interdependent while is independent (assuming ). Under such scenarios, the assigns both the interdependent tasks and to a single agent while is assigned to another agent . The State Information (SI) embedded within and are given below:
:
:
It can be seen from the above SI that will find a free robot and make it execute and consecutively before freeing it. will find a separate free robot and make it execute concurrently. Since and are now within the same agent, mutual exclusion of the resources shared by these tasks are ensured by the agent itself. It may also happen that . This can be easily reduced to the scenario similar to i.e. all the three tasks and will become interdependent and thus, packed into a single agent by the .

It may be noted that in a set of sequential tasks within a job, say, {}, the resource for a certain task(s) () could be free while those of the others are already assigned to agents of the previous jobs. In such scenarios, the is forced to wait for the agents to return and relinquish the resource(s). However, if is an independent task, the will assign it to a separate agent and release it. The agent then follows Algorithm 2 and executes the assigned task. The algorithm for the is portrayed in Algorithm 1.

5.2 Mobile Agent based Mechanism

Consider a scenario with repetitive jobs with similar tasks and associated resources are landing on the which are then assigned to the corresponding mobile agents and release into the network of robots. Now, as soon as the mobile agent lands on robot (say ), it verifies the current state of that robot. If a matching state is found (which in this case is ), provides the code for the task to the robot ( here). Hence, the robot commences the execution of task by acquiring the resources as per the program received from the agent . After the execution of task by , the mobile agent updates the state of to the next state (depending upon the next task). Consequently, relinquishes the resource and waits for to arrive. The mobile agent then leaves the robot, returns back to and releases the task along with the associated resource information. This task and resource is then assigned to a new mobile agent for the next job (which in the current scenario is similar to the previous job) by the and is then released into the network. If does not find a matching state, it migrates to another neighbouring robot in a conscientious manner, thereby avoiding more recently visited robots.

The mobile agent for job lands up in another robot (say ) in state and makes it execute task using the resource . In this manner, continues to make all robots in state to perform task sequentially. When , which is also migrating within the network, lands in , it aids the latter in the execution of task using . Hence, both the robots and execute the tasks (job ) and (job ) respectively in a concurrent manner forming a 2-stage pipeline. As time progresses all the k robots start executing distinct tasks concurrently to form of a k-stage pipeline. Here, the autonomous mobile agents act as tokens to acquire the associated resources in order to carry out an execution. Algorithm 2 depicts the steps that each mobile agent follows for the execution of their assigned tasks. Thus, it can be seen that by virtue of following this algorithm, the set of agents order the execution of tasks, in a manner that ensures mutual exclusion of shared resources among the jobs.

1:  Input: State {} and Program for task T; { State is if is the first task to be executed else State is }
2:  Output: Execution of task , R;
3:  repeat
4:     migrate_to() ; {Agent migrates to a robot }
5:     =get_state() ; {Agent fetches the current state of robot }
6:     if == then
7:        commence_execution(,) ; {Agent makes robot execute the code for using }
8:         get_next_state(); {Agent calls the function to get the next State Information (SI) stored within it}
9:        update_state(, ); {Agent updates the state of the robot to the next state carried by the agent}
10:     end if
11:     leave_robot() ; {Agent migrates into the network to search for other robots}
12:  until Job is present
Note: A mobile agent carries with it the program or code for a task assigned to it, the state of the robots which it needs to search for and execute the code for along with the very next state the robot should transit (after execution of ), in accordance with the job whose task , it carries.
ALGORITHM 2 Sequence of steps followed by each mobile agent for the execution of their assigned task

The proposed solution ensures that the free robots are selected and mutually excluded once they start a task within a specific job. Thus, once a robot is booked (mutually excluded) for a job by an agent, the same robot continues to execute all tasks related to this job. The robot is finally released only after the last task (contained within the related agent) is executed. Mutual exclusion is also taken care of when tasks common to multiple jobs require the same resource. Common tasks requiring different resources occurring across multiple jobs are executed concurrently. Mobile agents, once released into the network, act autonomously without any central control. With many networked robots in the scenario and with mobile agents knitting through this network, this proposed CPS as a whole, performs in a decentralized and distributed manner.

5.3 Asynchronous Execution Times

Unlike instructions in a CPU, the tasks executed by robots may not have fixed execution times. This could be due to a range of reasons which include wear and tear of various parts, the nature of the paths traversed by a robot, obstacles, charging times and network delays. This issue of non-uniformity in execution times of the various tasks in the pipeline cannot be efficiently handled by the traditional method of using a common clock.

In the present decentralized and distributed CPS, a mobile agent is the only entity that has the code for the execution of a specific task. To mitigate the problem of varying time periods in the robotic pipeline, the mobile agents do not leave a robot until the concerned task is accomplished. Consider a case when is executing task using and takes more time than which is being executed by using . This forces (after the execution of ) to wait for the completion of execution of by . This is because (currently within ) has not yet been released. Thus, even though the time durations that the robots take to switch from one task to another within the pipeline keep varying over time, the mobile agents facilitate pipelined execution without the use of a common clock. This makes the proposed mechanism adaptive to varying task execution times.

5.4 Addition/Deletion of task(s) on-the-fly

A real-world system is always prone to changes which could be sudden or gradual. For a system comprising sequential tasks, these changes can be in the form of addition of new tasks or the deletion of already existing tasks to/from the set T. There may also be a case where an existing task is required to be replaced by a new or modified version. Traditionally in a centralized system, one would have to bring the whole system down by suspending the executions of all the tasks and then restart the same after the modifications are made. This naturally is a time-consuming and inefficient exercise. The proposed method for the execution of sequential tasks inherently allows for On-The-Fly Programming (OTFP) without bringing the system down. In order to ensure the modification of the task sequence, all the state transitions, from one state to the next, are stored a priori locally in the state transition database of each robot. In this context, modification could mean addition, deletion or altering the sequence in which the tasks are executed.

The addition of a new task to the set T requires two new mobile agents — one that updates the state change information in the robots (referred to as the Sequence Agent ()) and another that carries the program for the new task (). The former agent, , which is released into the network W with the new modified sequence, migrates within W and updates the state transition database within each robot to reflect the modifications. Thus, if the initial state transition database in all robots comprised the sequence , , ,…, and the new task to be inserted between and is then this agent updates the sequence to in all robots in . This would mean that a robot completing the execution of task (in state ) would now transit to instead of thereby executing the associated task before using the second newly released agent . Once the modifications are done in each robot, the terminates itself. The second agent is the one that carries the new program as its payload and aids the robots to perform the new task . This agent behaves the same way as all the other agents in the set .

Deletion is done by merely deleting the concerned state in the transition database by this agent. It may be noted that if any of the task(s) previous to the task currently being executed by the robot gets modified, then the robot continues with the successive tasks and does not redo the entire job. The sequence can also be altered in a similar manner to control the order in which the tasks in T are executed. Both addition and deletion, thus facilitate the shuffling of the sequence of tasks in the pipeline on-the-fly. The above feature thus provides OTFP facility to the system.

5.5 Mutual Exclusion for Parallel Tasks

Contrary to the pipelined case, all tasks in the set T can be executed concurrently in a fully parallel CPS. Since each task has its own dedicated resource , the agent can latch on to any robot (provided it is free) and commence executing the associated task. Thus, if there are n tasks (i.e. n agents) and n robots then at any point of time all agents can execute their respective tasks using a robot each. If there are m jobs comprising n tasks each and if all tasks take the same amount of time t for execution, then the total time required for execution of all the jobs would be m*t, where * designates the multiplication operator. Mutual exclusion will be preserved, even if the number of robots is greater than the number of jobs. This is so since each task is associated with a single agent which in turn can use only one robot at any moment of time. It may thus be noted that the mechanism described herein can cater to both sequential and parallel sets of tasks.

5.6 Deadlock Freedom

According to Coffman et al. 1971, a system is in a deadlock state if all the four conditions defined below hold simultaneously –

  1. Mutual Exclusion: The resources required are non-shareable and thus requires mutual exclusion.

  2. No-Preemption: Resources already assigned cannot be preempted.

  3. Circular wait: Presence of circular list or chains of processes waiting for resources acquired by their predecessors.

  4. Hold and Wait: A process is holding at least one resource and is also waiting to occupy another resource.

The conditions (1) and (2) hold for the current proposed system. Mutual exclusion is a necessary requirement since the resources become non-shareable once the robots latch on to them. Preemption comes with the risk of indefinite starvation of a resource(s) by the robot preempted by the system and thus adds to the overall cost of execution.

Consider the resource-allocation graph shown in Figure 1 which has been converted to a pipeline representation portrayed in Figure 2. According to condition (3), if a resource-allocation graph contains at least one cycle, then it can attain a deadlock state. Thus, in order to show that the proposed system is deadlock free, it is sufficient to prove that the graph is acyclic. By applying Kahn 1962 algorithm for topological sorting on the graph shown in Figure 1, a pipeline representation similar to Figure 2 can be obtained. This proves that the graph is a Directed Acyclic Graph (DAG). Hence, condition (3) does not hold for the proposed system thereby making it deadlock free. Depending upon the type of job, condition (4) could hold for certain scenarios and therefore does not guarantee the deadlock free behaviour of the proposed system. Even though condition (3) is sufficient to ensure the deadlock free behaviour of the system, further investigations to remove condition (4) could be carried out and forms the part of future work of this paper.

6 Implementation

In order to validate the efficacy of the proposed mechanism, we chose an automated warehouse as a CPS in order to implement the proposed mechanism. This CPS is used to process shipments after the orders are received at the warehouse. The CPS within the automated warehouse comprises a set of networked robots and smart racks. The robots are required to fetch items from the racks and deliver them to the packaging zones. These chores can be decomposed into several tasks such as follow a path to the selected rack, pick the item, traverse towards the packaging zone and place the item there. This sequence of tasks involves the use of shared resources such as the racks and the paths. Warehouses generally optimize on space which means that the racks are placed close-by thus allowing only one robot to move in between them. This path as also the concerned rack thus form shared resources which can be used by only one robot at any moment of time. This enforces the need to ensure mutual exclusion of resources within the automated warehouse.

In order to ensure that mutual exclusion is preserved, warehouse management systems have to either constantly monitor and control the movement of robots or the robots themselves have to manage and regulate such exclusions. The former method is more centralized and resource intensive where a single or multiple set of servers constantly monitor and control the robots. Centralized methods have their own drawbacks Minar et al. (2000). The latter method, wherein the robots themselves as a whole manage such mutual exclusions and executions, forms a decentralized and distributed approach which is what we portray in this work.

The performance of the proposed mechanism for ordering task execution was validated by emulation followed by experiments using real robots. In order to test the practical viability over large networks, the proposed method was emulated on real networked nodes. Emulation (and not simulation) was carried out to ensure that the experiment is closer to the real environment and captures the real-time issues such as network failure, congestion, packet/data loss, etc. in the system. According to the authors in Chertov et al. (2006), emulation offers more concrete and reliable results than simulation. Tartarus Semwal et al. (2015), a mobile agent platform was used for emulation of the proposed mechanism for sequential and interdependent task execution. Each instance of Tartarus running on a computer acts as a node in the network. For the experiments, a 100-node network was created with sets of nodes running on separate computers connected through a LAN. A separate node acted as the Job Distributor () which receives the request (job) for the items and converts it in the form of tasks per request. Another additional PC (personal computer) was used to log the status of all the entities and events during the experiments. These logs were used to plot the graphs and analyze the results. It may be noted that these additional nodes ( and PC) did not participate in the proposed mechanism.

Figure 3: A warehouse with racks, robots and embedded boards with sensors

Experiments were conducted to rigorously test the features of the proposed method for scalability, adaptivity and OTFP. Each experiment was performed 10 times and the average of the readings was taken into account while plotting the graphs ***A video of the experiment performed is available at the following link:
http://www.iitg.ernet.in/cse/robotics/?page_id=1993
.

7 Experiments and Results

In this section, we discuss the experiments conducted and results obtained from both emulation and real-robots, separately. The section also compares the proposed approach with its centralized counterpart and highlights the conditions when it is favourable to use the former.

7.1 Emulation

As mentioned earlier, a 100-node Tartarus based network was deployed on 10 PCs over a LAN wherein each node represented an instance of Tartarus. For honouring equal distribution of load, each PC was initiated with 10 instances of Tartarus. Depending on their functionality in the real world, the nodes in the emulation scenario are divided into three types. The Robotic nodes (R) and the Shared resource nodes () form the Primary nodes while the remaining constitute the Secondary nodes (). In the present context, these nodes are the inactive nodes which merely allow the agent to flow through in the network such as router, sensor nodes, etc. They may however be made active so as to perform other tasks such as sensing, data processing, etc. based on the application scenario. A static agent residing on each of the R- and -type nodes performed the job of waiting for the mobile agents in order to receive the code for the task to be performed within them. For emulation, the tasks were designed such that it would take seconds to execute each of them assuming an ideal environment without any unforeseen time lags. Figure 3 depicts the primary and secondary nodes for a warehouse scenario.

Figure 4: Centralized versus the proposed decentralized and distributed approach

7.1.1 Comparison with a Centrally Controlled System

In order to fortify our stand on the use of this decentralized and distributed mechanism, it is essential to compare the results of the same with those obtained using a centralized control mechanism. A centralized emulation framework for the experimental set-up was thus made using the same agent platform viz. Tartarus. A centralized server operating at a node was responsible for posting the relevant commands using TCP-message based communication. This centralized scenario thus comprised the central node hosting the server and the R and nodes acting as its clients. The setup was obviously devoid of mobile agents. The proposed mechanism for execution of mutually-exclusive sequential tasks was emulated on this centralized framework. Instead of the mobile agents carrying the programs required for the execution of the tasks, the robots herein had the required programs to execute all the tasks, embedded in their respective memories a priori on-board. The experiment comprised execution of series of jobs with increasing number of tasks. Since the experiment was performed on an emulated framework, a total of 5 different soft computational tasks were chosen viz. Sorting (Sort), Merging (Merge), Addition (Add), Subtraction (Sub) and Division (Div) of data within the nodes. The 5 tasks were repeated for jobs containing more than 5 tasks i.e. if a job has 7 tasks, than the sequential tasks within this job comprises – Sort, Merge, Add, Sub, Div, Sort, Merge. The tasks were designed in such a way that the total computational time for each task was equal to 2 seconds in an ideal environment without any lags.

Initially, no resources are occupied until the execution commences. The central server thus sends a message to the robot node to commence the execution of task . In order to ensure mutual exclusion, messages are passed to the central server by each robot as and when a task is to be initiated or completed. On receiving a message from a robot node, say after the completion of task ), the centralized server sends a message to the node informing that the resource has been relinquished and that the task can now be executed. In this way each robot executes a task only when the central server gives it a green signal to do so. The central server thus manages task execution for all robot nodes and hence serves to ensure mutual exclusion.

The variation in the performances of the centralized and the proposed mobile agent based decentralized and distributed mechanisms have been portrayed in Figure 4. As can be observed, when the number of tasks per job is below 30, the centralized mechanism seems to perform a tad better than the proposed version. However, as the number of tasks grow (beyond 30), the throughput of the centralized system degrades rapidly since the average time for execution of a task increases. With increasing number of tasks, the volume of information to be exchanged (between the robot nodes and the server) in order to manage the execution of these tasks and ensure mutual exclusion, also increases drastically. Such a large number of server-to-client communications results in a majority of time being wasted on acknowledging and replying to the various nodes. When the central server is loaded with such a large number of requests, it takes more time for the completion of the tasks due to these computational constraints. In the case of the proposed decentralized approach, the rate of increase in the average time required for completion of the jobs can be observed to be gradual thus indicating the superiority of this approach. These results also show that the system is scalable in the sense that it is hardly affected by the increase in number of tasks per job (aka. mobile agents).

Figure 5: Addition/Deletion of tasks on-the-fly

7.1.2 Task Addition and Deletion

As previously mentioned, each of the tasks takes 2 seconds to complete execution in an ideal environment. To study the effect of addition/deletion of tasks on-the-fly, tasks were added and deleted during execution. This caused the length of the sequence of tasks in a job to vary at run time. Figure 5 shows the average time spent per task after addition or deletion of tasks in the set T. The numbers above and below the curve in the graph depict the number of tasks comprising the job being executed. As can be seen in Figure 5, the experiment initially started off with 10 tasks. While these tasks were being executed, a new task was inserted into the system by the Job Distributor (). This was achieved by following the procedures mentioned in Section 5.4, eventually modifying the total number of tasks in the task sequence to 11, 12, 15, 12, 20…and so on as depicted in Figure 5. It may be noted that some of the tasks were also deleted in between the run. One can observe that the graph is almost linear which clearly indicates that, though tasks are added/deleted through OTFP, there seems to be no significant impact on the net time taken for execution. This is so because the extra delays due to communication overheads and computational requirement are distributed among the nodes of the underlying network. This concurrency reduces the effective increase in such lags. In a centralized approach, all these overheads would add up on the controlling entity, thereby degrading its performance.

7.2 Real-Robot Experiments

In order to provide a proof-of-concept of the actual working of the proposed technique in the real world, a prototype of the warehouse automation scenario was implemented using a set of mobile robots. The job of each mobile robot was to pick an item from a rack, carry it to the packaging zone situated at another location and place it there, from where on it could be parceled and dispatched. As shown in Figure (a)a, the experimental setup contains mobile robots and shared resources. The latter include the smart racks and three zones viz. a line following zone, a wall following zone and a packaging zone, all of which need to be shared i.e. they need to be used by the robots in a mutually exclusive manner. A job is divided into four sequential tasks designated to , which are briefly described below:

  1. : A mobile robot waiting at the robot bay executes by virtue of which it moves forward before it detects a wall. On detecting the wall, it takes a right turn and again moves forward to finally stop when it detects a black line.

  2. : This task makes the mobile robot to open its claws and start following the black line before a green marker is detected. This marker denotes the location of the smart rack.

  3. : The robot picks the item from the smart rack using its claws and then follows the wall until a red marker is detected. It then places the item in the packaging zone, thus executing task .

  4. : The robot follows a black line before a yellow marker is detected which denotes the start location, thus reentering the bay once again, thereby accomplishing task .

(a)
(b)
Figure 6: (a) Top view of the test-bed (b) Structure of one of the LEGO® MINDSTORMS® NXT robot used in the experiments

For experimentation with real robots, we used a set of LEGO® MINDSTORMS® NXT robots. Since these robots cannot host the Tartarus platform within their controller block, they were connected to respective computers (hosting Tartarus) via Bluetooth. An interface similar to LPA-PRO-NXT interface Jha and Nair (2012) was used to control the robots via these computers that formed the nodes of the network. The movement of the robots was based on one castor wheel and a two-wheel differential drive. A pair of claws attached to the front of the robots facilitated the picking of items while an on-board ultrasonic sensor gauged the distance of objects in front. The robot was capable of following a black line path using a pair of IR sensors. In addition, a colour sensor detected different markers laid on the floor. Figure (b)b shows the structure of one such robot.

As soon as a request for an item is received by the , the same is converted into a job J and the corresponding set of mobile agents carrying their respective programs (one per agent) is released into the network. A set of four experiments were performed with the number of robots varying from 1 to 4. A total of 4 jobs were assumed to be always fed into the system. In the first experiment, only one robot was made available at the bay. This signifies a case when one robot needs to perform all the tasks in a sequential manner. R which is initially in state is thus the only robot available to receive the program for task from agent . After receiving the program, starts executing since the shared resources viz. all the zones and smart racks are free. As mentioned earlier, a mobile agent resides within the robot before the latter completes the associated task. After the task is completed, the mobile agent leaves the robot and starts migrating into the network in search of another robot in a similar state that requires the associated program.

After task is accomplished, goes ahead in the pipeline only if the resources required to execute are available. This is only possible when receives the program to execute via the corresponding agent . Task is that of picking an item from the rack. The third task is to place this item at the packaging zone. After is accomplished performs the final task of following the black line and returning to the bay from where it started. This experiment is one of the conventional ways of performing a sequence of tasks with a single robot. It can thus be used as a baseline while comparing the results obtained from experiments using the proposed decentralized and distributed method using pipelined execution.

In the second, third and fourth set of experiments, the same jobs were executed but now in a pipelined manner with the numbers of robots enumerated as 2, 3 and 4 respectively.

Figure 7 depicts four graphs (viz. (a)a, (b)b, (c)c and (d)d). Each graph herein corresponds to the results obtained when the number of robots were varied from 1 to 4 respectively. The X-axis in each graph represents the time consumed (in seconds) by the tasks while the Y-axis represents the jobs to be done. The numbers imprinted on the boxes within the graphs denote the execution times taken by the corresponding tasks.

(a)
(b)
(c)
(d)
Figure 7: (a) Execution of tasks using a single robot (b), (c) and (d) Pipelined execution for varying number of robots i.e. 2, 3 and 4 respectively

Figure (a)a shows the results obtained when there is only one robot available to complete the jobs. The different patterns filled inside the boxes in each row denote the corresponding tasks viz. , , and . As can be seen in the Figure 7, each row of boxes i.e. tasks denotes a specific job. As soon as all the tasks comprising a job are completed, the robot switches to executing the first task of the next job. In the case when there is only a single robot there are no inter-job execution delays. This is so because the robot does not have to wait for any shared resources to become free for its use.

Figures (b)b, (c)c and (d)d show results for cases when the number of robots available are 2, 3 and 4 respectively, in the experiments. In the Figure (b)b, two distinct colours have been used to show the two robots — blue signifying while green representing . It can be observed that when is executing waits in the robot bay before the resource acquired by is relinquished. When completes the task , it relinquishes the associated resource , which in turn triggers to commence execution of while switches to execute using resource . Execution commences only after the associated agent ( for and for ) reach the concerned robot and provide the relevant programs. Thus, when the mobile agent triggers execution of by , the rest of the robots at the bay cannot execute since the associated mobile agent is now busy with . This inherently ensures proper ordering of execution of tasks while also obeying mutual exclusion.

Subsequently, both and enter the pipeline and concurrently execute tasks and respectively. It can be observed that the robots seem to take unequal times to execute the same tasks which in turn cause idle periods between the executions of two consecutive tasks. Each idle period between the tasks along the row indicates the extra time the robot waits for the resource of the subsequent task to be relinquished by its predecessor. In the real world, execution times depend on the wear and tear that the robots undergo, their controllers, charge on the battery and other environmental conditions. In Figures (c)c and (d)d, these idle periods are more prominent due to the presence of more robots. Thus, one cannot provide guarantees that a task will take the same amount of time to complete as it did earlier as in the emulation experiments. The speed-up obtained when 2, 3 and 4 robots was used were found to be 1.75, 1.84 and 2.21 respectively.

7.2.1 A mix of Sequential and Independent tasks within a job

Real-world jobs usually comprise heterogeneous tasks where a few of them could be sequential while the rest may be independent. Results for the experiments conducted for such jobs have been portrayed in Figure 8. The experiment was conducted in an emulated environment similar to the one discussed in Section 7.1. As can be seen from the figure, job and are composed of purely sequential tasks and thus are executed in sequence. Jobs , , and comprises two sequences of tasks which are independent of each other. Thus, as shown in the figure, the proposed system manages to execute the two sequences of tasks within a job in sub-optimal parallel manner.

Figure 8: Execution of jobs comprising both sequential and independent tasks

7.2.2 Modification of the Sequence of Tasks

Figure 9 shows the graph when a task is added and deleted on-the-fly from the sequence of tasks . In this experiment, a new task was introduced via during the execution of in Job 2. It was then deleted immediately after its execution in Job 2. The same task was again added during the execution of in Job 4. The additions and deletion were performed using mobile agents as described in Section 5.4. The new task in the context of our warehouse scenario was a detour from the normally used path which constituted the mobile agent and the associated resource . After completed task caused it to execute in Job 2. Since is now free, (saffron coloured row box) commenced execution of using concurrently, as seen in Figure 9. It can be seen that the introduction of task introduced a large idle period in Job 3. This was because when was executing task , , having finished execution of , commenced the execution of . The case arose because the time for executing by was less than that for executing by . Addition and deletion of tasks on-the-fly seemed to have no effect on the other concurrently running tasks.

Figure 9: Execution of tasks using 3 robots - Addition and Deletion of task on-the-fly

7.2.3 Removal of robots

The batteries of all the robots needs to be recharged after their energy levels go below a certain predefined threshold. The threshold was chosen in such a way that even if this threshold were to be crossed at the commencement of a job, the robot would have enough energy to complete all the remaining tasks in that job and then return to the robot bay for charging. This is synonymous to the removal of a robot from the system. It can be observed in Figure 10, that was removed after it completed Job 2 in a 3-robot scenario. The absence of , caused to perform the task in Job 5 just after completed in Job 4. As can be observed the pipeline continues to execute tasks concurrently in spite of the absence of .

Figure 10: Execution of tasks using 3 robots - Removal of a robot () on-the-fly

It can thus be observed from the results of the experiments, both emulation and real-world, that though the task execution times vary, the system adapts to these changes and maintains the pipeline even in the absence of a clock. Also, the resources associated to the tasks are used in a manner that mutual exclusion is preserved without any direct communication.

8 Discussions and Conclusions

This paper portrays a mechanism for ordering the execution of a set of interdependent tasks within a CPS of robots and sensor nodes operating in the real-world under the constraint of mutual exclusion. The CPS, which forms part of an automated warehouse has been used as the target application. This mechanism, however, can be easily ported to other scenarios where shared resources are utilized and mutual exclusion needs to be implemented. It has also been shown that a centralized solution could no doubt be an option to solving the mutual exclusion problem but its performance degrades as we scale the system. The use of mobile agents makes the mechanism described herein decentralized, distributed and scalable and also allows for changes to be made in the tasks as also the set of robots operating within the system, during run times. The mechanism can also cater to more than a single set of sequential tasks executed concurrently thus forming multiple parallel pipelined sequential tasks where the elements of the pipeline can be shared among other pipelines.

The proposed system is limited by the size of the network of nodes. For very large networks (nodes 1000), there could be considerable delays while searching for a robot to be serviced by a mobile agent. The situation may worsen (delays may increase) if bandwidth for communication is scarcely available. One solution to control such a limitation is to use pheromone-conscientious migration strategy Godfrey and Nair (2010), which allows for a bi-directional search on part of the robotic nodes and the agents across the network. Tackling the complexity of the tasks whose programs are carried by the mobile agents, opens up future scope for the research. While on one side a box-pushing operation may need just a single robot, complex tasks, such as carrying a long object, may require multiple robots to synchronize their operations. After reserving the required number of robots, the concerned agent within this proposed system could release a new set of agents or clones Semwal et al. (2016) capable of performing the concerned tasks as also synchronizing them using stigmergy based mechanisms as discussed in Jha et al. (2014).

The Job Distributor () is the only central entity in the proposed system which could be replaced by its distributed version. This means that instead of a single entity that does the task of book-keeping of the allocated resources, each node could act as an individual but scaled down version of the proposed . These mini versions of the could then communicate with one another to ensure a distributed locking mechanism. This work can also be extended to scenarios where different robots have different abilities such that some subset of robots can execute only certain tasks. The challenge would then be to choose only those robots which are fit for execution of the required tasks. Since physical processes are performed in the real-world, the entities of a typical CPS are bound to encounter unpredictable changes in the environment. Further, these physical processes inherently operate at a different time-scale leading to the creation of an asynchronous environment within the system.

Both these challenges are addressed inherently, to an extent by the mechanism described in this paper. A robot could fail or be removed from the CPS environment leading to unpredictability of the nature of execution of the pipeline. Unpredictable incidents such as these can conventionally cause the stalling of the pipeline. The absence of a common clock for the pipeline aids the mechanism in coping up with this situation. Since the mobile agents manage the execution and mutual exclusion, the waiting times differ based on the availability of the shared resources which in turn aids in re-synchronizing such unforeseen changes in the environment. This also addresses the challenge posed by fluctuations in the execution times taken by the physical processes or tasks performed by the robots. Additionally, since mobile agents carry the related programs for task execution, this mechanism can support heterogeneity in terms of the use of a range of computational entities including robots and sensor nodes. New entities can be plugged into the CPS along with mobile agents carrying the programs for the associated tasks. The use of mobile agents facilitates the OTFP feature which allows such injection or addition and deletion of tasks on-the-fly. This feature can also help in purging deprecated or faulty programs from the system and replacing them with the correct ones during run time. It is also envisaged to augment this mechanism with Self-healing as in Jha et al. (2014) so that a failure within the CPS is quickly noted and the concerned agent is drawn towards the node so that the task(s) can be re-executed, if required.

The authors would like to thank the Department of Science and Technology, Government of India, for the funding provided under the FIST scheme to set up the Robotics Lab. at the Department of Computer Science and Engineering, Indian Institute of Technology Guwahati, where the entire work reported herein, was carried out.

The first and second authors would also like to acknowledge the Ministry of Human Resource Development, Government of India, and Tata Consultancy Services (TCS), India, for the financial support provided to them during the course of this work.

References

  • (1)
  • Anchal et al. (2014) Anchal, P. Saini, and C. R. Krishna. 2014. An Efficient Permission-Cum-Cluster Based Distributed Mutual Exclusion Algorithm for Mobile Adhoc Networks. In Proceedings of the 2014 International Conference on Parallel, Distributed and Grid Computing (PDGC). 141–146.
  • Attiya et al. (2010) H. Attiya, A. Kogan, and J. L. Welch. 2010. Efficient and Robust Local Mutual Exclusion in Mobile Ad Hoc Networks. IEEE Transactions on Mobile Computing 9, 3 (March 2010), 361–375.
  • Baheti and Gill (2011) R. Baheti and H. Gill. 2011. Cyber-physical Systems. The Impact of Control Technology 12 (2011), 161—-166.
  • Basagni et al. (2004) S. Basagni, M. Conti, S. Giordano, and I. Stojmenovic. 2004. Mobile ad hoc networking. John Wiley & Sons.
  • Bellifemine et al. (2001) F. Bellifemine, A. Poggi, and G. Rimassa. 2001. JADE: a FIPA2000 compliant agent development environment. In Proceedings of the International Conference on Autonomous Agents and Multiagent Systems. 216–217.
  • Botelho and Alami (1999) S. C. Botelho and R. Alami. 1999. M+: A scheme for multi-robot cooperation through negotiated task allocation and achievement. In Proceedings of the IEEE International Conference on Robotics and Automation, Vol. 2. 1234–1239.
  • Boukerche et al. (2007) A. Boukerche, R. B. Machado, K. R. L. Jucá, J. B. M. Sobral, and M. S. M. A. Notare. 2007. An agent based and biological inspired real-time intrusion detection and security model for computer network operations. Computer Communications 30, 13 (2007), 2649–2660.
  • Bulgannawar and Vaidya (1995) S. Bulgannawar and N. F. Vaidya. 1995. A distributed K-mutual exclusion algorithm. In Proceedings of the 15th International Conference on Distributed Computing Systems. 153–160.
  • Chandy and Misra (1984) K. M. Chandy and J. Misra. 1984. The Drinking Philosophers Problem. ACM Transactions on Programming Language and Systems 6, 4 (Oct. 1984), 632–646.
  • Chen et al. (2007) M. Chen, S. Gonzalez, and V. C. M. Leung. 2007. Applications and design issues for mobile agents in wireless sensor networks. IEEE Wireless Communications 14, December (2007), 20–26.
  • Chertov et al. (2006) R. Chertov, S. Fahmy, and N. B. Shroff. 2006. Emulation versus Simulation: A case study of TCP-targeted denial of service attacks. In Proceedings of the 2nd International Conference on Testbeds and Research Infrastructures for the Development of Networks and Communities, (TRIDENTCOM’06). 10 pp.–325.
  • Cruz-Cunha (2011) M. M. Cruz-Cunha. 2011. Handbook of Research on Mobility and Computing: Evolving Technologies and Ubiquitous Impacts. (2 Volumes). IGI Global,1–1584.
  • Dhenakaran and Parvathavarthini (2013) S. S. Dhenakaran and A. Parvathavarthini. 2013. An Overview of Routing Protocols in Mobile Ad-Hoc Network. International Journal of Advanced Research in Computer Science and Software Engineering 3, 2 (2013), 251–259.
  • Dias and Stentz (2000) M. B. Dias and A. Stentz. 2000. A free market architecture for distributed control of a multirobot system. In Proceedings of the 6th International Conference on Intelligent Autonomous Systems (IAS6’11). 115–122.
  • Fife and Gruenwald (2003) L. D. Fife and L. Gruenwald. 2003. Research Issues for Data Communication in Mobile Ad-hoc Network Database Systems. ACM SIGMOD Record 32, 2 (June 2003), 42–47.
  • Franklin and Graesser (1997) S. Franklin and A. Graesser. 1997. Is it an agent, or just a program? A Taxonomy of Autonomous Agents. Intelligent Agents III 1193 (1997), 21–36.
  • Gerkey and Mataric (2001) B. P. Gerkey and M. J. Mataric. 2001. Principled Communication for Dynamic Multi-Robot Task Allocation. Lecture Notes in Control and Information Sciences 271 (2001), 353–362.
  • Gerkey and Mataric (2003) B. P. Gerkey and M. J. Mataric. 2003. Multi-robot task allocation: Analyzing the complexity and optimality of key architectures. In Proceedings of the IEEE International Conference on Robotics and Automation, ICRA’03, Vol. 3. 3862–3868.
  • Godfrey and Nair (2008) W. W. Godfrey and S. B. Nair. 2008. An immune system based multi-robot mobile agent network. Lecture Notes in Computer Science LNCS (2008), 424–433.
  • Godfrey and Nair (2012) W. W. Godfrey and S. B. Nair. 2012. A Pheromone based Mobile Agent Migration Strategy for Servicing Networked Robots. In Proceedings of the 5th International ICST Conference on Bio-Inspired Models of Network, Information, and Computing Systems, 533–541.
  • Hadzilacos (2001) V. Hadzilacos. 2001. A Note on Group Mutual Exclusion. In Proceedings of the Twentieth Annual ACM Symposium on Principles of Distributed Computing (PODC ’01). 100–106.
  • Jha et al. (2014) S. S. Jha, W. W. Godfrey, and S. B. Nair. 2014. Stigmergy-Based Synchronization of a Sequence of Tasks in a Network of Asynchronous Nodes. Cybernetics and Systems 45, 5 (June 2014), 373–406.
  • Jha and Nair (2012) S. S. Jha and S. B. Nair. 2012.

    A Logic Programming Interface for Multiple Robots. In

    Proceedings of the 3rd IEEE National Conference on Emerging Trends and Applications in Computer Science, (NCETACS’12). 152–156.
  • Kambayashi et al. (2005) Y. Kambayashi, M. Takimoto, and Y. Kodama. 2005.

    Controlling Biped Walking Robots Using Genetic Algorithms in Mobile Agent Environment. In

    Proceedings of the 3rd IEEE International Conference on Computational Cybernetics, (ICCC’05). 29–34.
  • Khaluf and Rammig (2013) Y. Khaluf and F. Rammig. 2013. Task Allocation Strategy for Time-Constrained Tasks in Robots Swarms. In Proceedings of the European Conference on Artificial Life. 737–744.
  • Khanna et al. (2015) A. Khanna, A. K. Singh, and A. Swaroop. 2015. Dynamic Request Set based Mutual Exclusion Algorithm in MANETs. International Journal of Wireless and Microwave Technologies (IJWMT) 5, 4 (2015), 1–14.
  • Suzuki and Kasami (1985) I. Suzuki and T. Kasami. 1985. A distributed mutual exclusion algorithm. ACM Transactions on Computer Systems (TOCS) 3, 4 (1985), 344–349.
  • Lange (1998) D. B. Lange. 1998. Mobile objects and Mobile agents: The future of distributed computing? In Proceedings of the European Conference on Object-Oriented Programming (ECOOP’98), Lecture Notes in Computer Science, vol 1445., 1–12.
  • Maes et al. (1999) P. Maes, R. H. Guttman, and A. G. Moukas. 1999. Agents That Buy and Sell. ACM Communication 42, 3 (March 1999), 81–91.
  • Matani and Nair (2011) J. Matani and S. B. Nair. 2011. Typhon: A Mobile Agents Framework for Real World Emulation in Prolog. In

    Proceedings of the 5th International Conference on Multi-Disciplinary Trends in Artificial Intelligence

    (MIWAI’11). 261–273.
  • Coffman et al. (1971) E. G. Coffman, M. Elphick, and A. Shoshani. 1971. System Deadlocks. ACM Comput. Surv. 3, 2 (June 1971), 67–78.
  • Kahn (1962) A. B. Kahn. 1962. Topological sorting of large networks. Communications of the ACM 5, 11 (1962), 558–562.
  • Minar et al. (2000) N. Minar, M. Gray, O. Roup, R. Krikorian, and P. Maes. 2000. Hive: Distributed agents for networking things. IEEE Concurrency 8 (2000), 24–33.
  • Mostinckx et al. (2009) S. Mostinckx, T. V. Cutsem, S. Timbermont, E. G. Boix, É. Tanter, and W. D. Meuter. 2009. Mobile-C: A mobile agent platform for mobile C/C++ agents. Software - Practice and Experience 39 (2009), 661–699.
  • Null and Lobur (2014) L. Null and J. Lobur. 2014. The essentials of Computer Organization and Architecture. Jones & Bartlett Publishers.
  • Outtagarts (2009) A. Outtagarts. 2009. Mobile agent-based applications: A survey. International Journal of Computer Science and Network Security 9, 11 (2009), 331–339.
  • Parker (1998) L. E. Parker. 1998. ALLIANCE: An architecture for fault tolerant multirobot cooperation. IEEE Transactions on Robotics and Automation 14, 2 (1998), 220–240.
  • Posadas et al. (2008) J. L. Posadas, J. L. Poza, J. E. Simó, G. Benet, and F. Blanes. 2008. Agent-based distributed architecture for mobile robot control. Engineering Applications of Artificial Intelligence 21, 6 (Sept. 2008), 805–823.
  • Godfrey and Nair (2010) W. W. Godfrey and S. B. Nair. 2010. A pheromone based mobile agent migration strategy for servicing networked robots. In International Conference on Bio-Inspired Models of Network, Information, and Computing Systems. Springer, 533–541.
  • Ratnieks and Anderson (1999) F. L. W. Ratnieks and C. Anderson. 1999. Task partitioning in insect societies. Insectes Sociaux 46, 2 (1999), 95–108.
  • Raynal (1986) M. Raynal. 1986. Algorithms for mutual exclusion. The MIT Press, Cambridge, MA (1986).
  • Semwal et al. (2016) T. Semwal, Nikhil S, S. S. Jha, and S. B. Nair. 2016. TARTARUS: A Multi-Agent Platform for Bridging the Gap between Cyber and Physical Systems. In Proceedings of the 2016 International Conference on Autonomous Agents & Multiagent Systems (AAMAS’16), 1493–1495.
  • Schumacher (2001) M. Schumacher. 2001. Multi-agent systems. Objective Coordination in Multi-Agent System Engineering: Design and Implementation (2001), 9–32.
  • Semwal et al. (2015) T. Semwal, M. Bode, V. Singh, S. S. Jha, and S. B. Nair. 2015. Tartarus: A Multi-agent Platform for Integrating Cyber-Physical Systems and Robots. In Proceedings of the 2015 Conference on Advances In Robotics (AIR’15). Article 20, 6 pages.
  • Shi et al. (2011) J. Shi, J. Wan, H. Yan, and H. Suo. 2011. A survey of Cyber-Physical Systems. In Proceedings of the 2011 International Conference on Wireless Communications and Signal Processing (WCSP’11). 1–6.
  • Tarau (1999) P. Tarau. 1999. Jinni: Intelligent mobile agent programming at the intersection of Java and Prolog. In Proceedings of the 4th International Conference on The Practical Application of Intelligent Agents and Multi-Agents, (PAAM’99), Vol. 99. 109–123.
  • Wu et al. (2015) W. Wu, J. Zhang, A. Luo, and J. Cao. 2015. Distributed Mutual Exclusion Algorithms for Intersection Traffic Control. IEEE Transactions on Parallel and Distributed Systems 26, 1 (Jan 2015), 65–74.
  • Zaiane (2002) O. R. Zaiane. 2002. Building a recommender agent for e-learning systems. In Proceedings of the International Conference on Computers in Education. 55 – 59.
  • Gaber and Bakhouya (2008) J. Gaber and M. Bakhouya. 2008. Mobile Agent-Based Approach for Resource Discovery in Peer-to-Peer Networks. Agents and Peer-to-Peer Computing. 63–73.
  • Minar et al. (1999) N. Minar, K. H. Kramer, and P. Maes. 1999. Cooperating Mobile Agents for Dynamic Network Routing. 287–304.
  • Godfrey et al. (2013) W. W. Godfrey, S. S. Jha, and S. B. Nair. 2013. On a Mobile Agent Framework for an Internet of Things. In Proceedings of the 2013 International Conference on Communication Systems and Network Technologies. 345–350.
  • Sempe and Drogoul (2003) F. Sempe and A. Drogoul. 2003. Adaptive patrol for a group of robots. In Proceedings of the 2003 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS 2003) (Cat. No.03CH37453), Vol. 3. 2865–2869 vol.3.
  • Chu et al. (2007) H. N. Chu, A. Glad, O. Simonin, F. Sempe, A. Drogoul, and F. Charpillet. 2007. Swarm Approaches for the Patrolling Problem, Information Propagation vs. Pheromone Evaporation. In Proceedings of the 19th IEEE International Conference on Tools with Artificial Intelligence(ICTAI’07), Vol. 1, 442–449.