Providing relevant information in an ambient services using service requester’s “logical area”

Ambient service is a kind of context-aware services which is related to the surrounding environment of the users. In other words, geographic area around the users is considered as contextual data to provide services. This geographical area around the user is called logical area which would be equivalent for “here” from an ordinary user’s point of view. Most of the time users are looking for resources around themselves or “here”. When “here” area of a user is overlapped or contained by a service area; which called “service domain” in ambient services; then user can get the service. So it is very important to know where is “here”. “Here” is a fuzzy spatial concept which is being frequently used in daily speaking. So it may be stated in requests of users e.g., finding cheapest restaurant “here” or around of somebody. The main step in a spatial context-aware application is determination of relevant information. Hence “here” concept, as a fundamental spatial concept, helps to provide relevant information to users so features located “here” or around of users, in which the best answer is located, should be found. As result, the area of “here” is very important to provide service in such cases. This issue becomes more complicated and important if the service requester is a mobile user, because the area of “here” changes over the time. In that case additional concepts and computations are needed to find “here” of that user. This paper is focused on modeling of “here” in an ambient service framework based on fuzzy set theory.


Introduction
Mobile computing is a revolutionary style of technology emerging from advances in developments of portable hardware and wireless communications. Within the last few years, we were facing advances in wireless communication, computer networks, location-based engines, and on-board positioning sensors. In this regard, mobile computing finds an important role in many fields e.g., telecommunications, computer science and information system. Integration of mobile agent, wireless network, and some GIS capability results in mobile geoinformation system (MGIS) which has fostered a great interest in the GIS field. This paper tries to explain one of the difficulties of providing relevant geoservices to mobile users.
Ambient services are specific kind of mobile services which put more emphasis on association of service with a geographical area around users. By ''ambient services'', we have in view services that are related to the surrounding physical environment of the user and are locally useful i.e., they may not be relevant or useful beyond the boundaries of an area around the user (Loke 2006), this area is called ''logical area''.
So a logical area for a user is the area around the user in which ambient services is relevant and useful. Most of the time users call this ''surrounding physical environment'' as their ''here''. For example they want to find a restaurant or an ATM around themselves so they may express their request as follows: ''I want a restaurant or an ATM which is located ''here''''. Many requesters are ordinary mobile users who do not know very much about process of parsing a request. Consequently, They would prefer use the phrases and words that are using frequently in their requests rather than mathematical concepts e.g., near and late instead of less than 50 m, after 2 p.m. Such fuzzy concepts, which suffer from lack of clarity and being difficult to test, make a big challenge in mobile geoservices (Bassiri et al. 2012). They are frequently encountered because a customer or service requester asks a question about something which can be interpreted in many different ways. Computerized applications are not usually able to implement such vague concepts. In order to model these kinds of concepts, we need a framework which can handle vagueness of these linguistic phrases. Fuzzy logic provides one of the most powerful frameworks to model these vague concepts.
One of the spatial concepts which are frequently used in daily life is ''here''. ''Here'' and ''There'' are two spatial concepts which are frequently used in daily life. As defined in Merriam-Webster dictionary, ''here '' means ''in or at this place'', ''at or in this point'', ''Now'', ''in an arbitrary location'', etc. Among them, the first two entries fit to the aim of this article.
It is obvious that by moving with a certain velocity one can; within certain physical limit; choose the place by ''here''. There is no serious attempt to define and model it neither in GIS nor in database system. As mobile geoservices are provided for low-experienced users who are using fuzzy words like far, near, here, there and etc. in their requests, it is very important to support such concepts by geoinformation systems and services.
If a service requester uses ''here'' in his request e.g., ''I want a restaurant which is located ''here'''', understanding the meaning and the valid area of ''here'' of him is the basis of providing appropriate and effective result. It is not only for defining the area but also for finding relevant information for a context-aware application. In a context-aware application, the main step is recognition of relevant information, hence ''here'' concept helps to pickup relevant information for users.
Imagine a client who is looking for a supermarket around or ''here'' of him. Regarding his position, direction of movement, line of sight, etc., his ''here'' can be different. Service provider should find and provide the address of a supermarket which is located in his ''here''. So service provider is supposed to find ''here'' firstly, and then find a supermarket in this area.
There are some criteria to find ''here'' of a user. Two different users can ask same request and the results can be different respect to their ''here''. Determination of area of ''here'' becomes more complicated if the service requester moves. It is very important to find the valid area of a moving requester's ''here'' in the mobile environment. Mobile users are one of the categories of service requesters whose locations and environments are changing over the time. In order to model their ''here'', it is very important to include additional criteria like direction of their movements.
To model ''here'' conceptually, mathematically and spatially, it is necessary to consider its fuzziness. As it explained before, some phrases have not predefined definition and ''here'' is one of them. ''Here'' does not have a predefined and specific meaning and it can be uncertain and changeable respect to the context. Consequently its valid area should not be modeled in a crisp framework. Regarding its vagueness and fuzziness, fuzzy logic as one of the most powerful tools to handle its fuzziness is implemented and a fuzzy model is proposed to model this unclear word; ''here''.
The paper is organized as follows. Second section is focused on principles of fuzzy logic and a fuzzy system. Section three explains fundamental criteria to find somebody's ''here'' in a mobile information environment. Section 4 implements fuzzy membership functions and IF-THEN rules to infer in which area ''here'' is valid. Last section summarizes this work and suggests future works.

Principles and review
The concept of fuzzy logic (FL) was conceived by (Zadeh 1985) as a way of processing data by allowing partial set membership rather than crisp set membership. Zadeh reasoned that people do not require precise, numerical information input, and yet they are capable of highly adaptive control. If applications can accept noisy, imprecise input, they would be much more effective and perhaps easier to be applied. Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set is a set without a crisp, clearly defined boundary. It can contain elements with only a partial degree of membership. Fuzzy logic offers several unique features that make it a particularly good choice to handle uncertainty issues (Smith 1993).
In general, fuzzy set concepts preserve details (Peterson 1993) and it can overcome the gap by providing mechanisms for ontologically and cognitively plausible (Sugeno 1985) and error-sensitive (Devi 1985) representation of the reality.
Considering aforementioned advantages and fuzzy nature of ''here'' and ''there'' which is the main issue, in the next parts some important definitions and concepts related to fuzzy logic are explained.

Fuzzy set and membership function
Fuzzy logic starts with the concept of a fuzzy set. A fuzzy set can contain elements with only a partial degree of membership. Fuzzy set theory permits the gradual assessment of the membership of elements in a set; this is described with the aid of a membership function valued in the real unit interval [0, 1].
A fuzzy set is a pair (A, m) where A is a set and m: A ? [0, 1] (Zadeh 1985). The membership function of a fuzzy set is a generalization of the indicator function in classical sets (Zadeh 1985). The membership function which represents a fuzzy set A' is usually denoted by l A . For an element x of X, the value l A (x) is called the membership degree of x in the fuzzy set A' the membership degree l A (x) quantifies the grade of membership of the element x to the fuzzy set A' (Zadeh 1985). The value 0 means that x is not a member of the fuzzy set; the value 1 means that x is fully a member of the fuzzy set. The values between 0 and 1 characterize fuzzy members, which belong to the fuzzy set only partially.

Fuzzy inference
Fuzzy inference is the process of formulating the mapping from a given input to an output using fuzzy logic. The mapping then provides a basis from which decisions can be made, or patterns discerned. Mathematical concepts within fuzzy reasoning are very simple and it is easy to modify a fuzzy inference system (FIS) just by adding or deleting rules so there is no need to create a new FIS from scratch (Kosko 1992); (Lee 1990). In general, a fuzzy inference system consists of four modules (Mamdani 1977) as it shown in Fig. 1.
Fuzzification module transforms the system inputs, which are crisp numbers, into fuzzy sets. This is done by applying a fuzzification function. Knowledge base stores IF-THEN rules provided by experts. Inference engine simulates the human reasoning process by making fuzzy inference on the inputs and IF-THEN rules and defuzzification module transforms the fuzzy set obtained by the inference engine into a crisp value.

Fuzzy IF-THEN rules
In its simplest form, a fuzzy ''IF-THEN'' rule follows the pattern:

''If x is A then y is B''
A and B are linguistic values defined by fuzzy sets in the universes of discourse X and Y. x is the input variable and y is the output variable. The meaning of ''is'' is different in the antecedent and in the consequent of the rule. This is because the antecedent is an interpretation that returns a value between 0 and 1, and the consequent assigns a fuzzy set B to the variable y. The output to the rule is a fuzzy set assigned to the output variable y of the consequent. The rule is executed applying a fuzzy implication operator, whose arguments are the antecedent's value and the consequent's fuzzy set values. The implication results in a fuzzy set that will be the output of the rule (Lee 1990) and (Miller 1993).

Classification of fuzzy inference methods
Fuzzy inference methods are classified in direct methods and indirect methods. Indirect methods are more complex ones. As it shown in Fig. 2, Direct methods, such as Mamdani's and Sugeno's, are the most commonly used (these two methods only differ in how they obtain the outputs) (Devi 1985) so we explain them in below.
Mamdani's fuzzy inference method (Mamdani and Assilian 1975), is the most commonly seen fuzzy methodology. Mamdani's method proposed in 1975 by Ebrahim Mamdani, was among the first control systems built using fuzzy set theory. Mamdani-type inference expects the output membership functions to be fuzzy sets. After the aggregation process, there is a fuzzy set for each output variable that needs defuzzification. It is possible, and in many cases much more efficient, to use a single spike as the output memberships function rather than a distributed fuzzy set. In this regards, Mamdani's method was implemented to deduce our output or ''here''. In general, Sugeno-type systems can be used to model any inference system in which the output membership functions are either linear or constant. Mamdani's method and Sugeno's are similar with respect to many aspects (Sugeno 1977) and (Sugeno 1985). The first two parts of the fuzzy inference process, fuzzifying the inputs and applying the fuzzy operator, are exactly the same. The main difference between Mamdani and Sugeno is that the Sugeno output membership functions are either linear or constant. A typical rule in a Sugeno fuzzy model has the following form: If Input 1 = x and Input 2 = y, then Output is z = ax ? by ? c.
In order to create our Fuzzy system to find out somebody's ''here'', a set of criteria which has an outstanding role in finding ''here'' is defined. Next section is focused on explaining these criteria or input variable and their membership functions. Section 4 is deducing output applying these input variables in a fuzzy inference system.

Impact criteria of ''here''
In this section the important criteria which make the meaning of ''here'' clear, are explained. Distance, Line of sight of viewer, field of view Topological relationships between features around service requester or mobile user, are some of these criteria have important role in clarifying spatial meaning of ''here''. Understanding the ''here'' of a user or service requester is much more complicated if he is a moving one. In order to understand the meaning of ''here'' of him, direction of his movement should be considered as well.
Distance of origin to destination is the first factor. Obviously concepts of closeness and farness, which play an important role to identify ''here'', are two fuzzy and uncertain concepts. When ''here'' was stated by a service requester who is far from his point of interest (e.g. ATM and restaurant) ''here'' can have a general meaning. However when mobile user is nearer, it does not cover a wide range of area. It is possible to have two quietly different understanding from two ''here'' said by two different service requester. Our program should reason the requester's ''here'', like human being's brain. Our brain considers many factors to call a place ''here'' and one of them is distance between it and the audience. In order to make it clearer, an example is provided too. If your friend says ''here I cannot find any pharmacy'', considering that he is living abroad, you may understand that in that city or in that country he has such a problem so his ''here'' covers a larger area. If you want to help him, you can tell him addresses of some pharmacy in that country or city. However if he says exactly same sentence being in near to you e.g., in your street, you will help him by telling him some landmarks to find the pharmacy which is located in that street. In this example, your understanding from same ''here'' is quietly different, considering distance between origin and destination. This example just shows that how distance can used to recognize ''here''. In real situation the service requesters are not speaking in person or on the phone with the service provider so it is not a good idea to measure the distance between service requester and provider. In these cases, a maximum bounding box should be considered to search for the point of interests of the user. This bounding box can be considered as user's mobile screen. This box is used to limit our search. The search for finding the most appropriate point of interest (e.g., restaurant and museum,) is performed in this box. If user and nearest interest feature is far, the valid area of his ''here'' is large. If the nearest point of interest is close to him, his ''here'' has a more limited area.
In a mobile information system realizing distance properties such as adjacency, proximity, similarity, nearest neighbor, crow-fly distance, or ''over-the-road'' is very important. Distance should be measured based on user's context, e.g., if user is driving his car, it is better to use graph-oriented approaches like dikjestra or A-star algorithms to calculate the distance. However, for a walking user Euclidian function is recommended to calculate the distance (formula 1).
Calculated distance between requester and provider should be fuzzified to enter the fuzzy system. Membership function of distance is shown in Fig. 3. As it shown in Fig. 3, Distance can be categorized into three category of very near, approximately near and far. These linguistic phrases can be understood by ordinary people.
Line of sight is one of the other factors which can exclude some parts of an area from the areas where ''here'' is meaningful. In general the place, landmark or any object is located in somebody's ''here'' when that object can be seen directly. For example you can say ''Here, two pharmacies exist.'', if you can see those pharmacies directly. If the pharmacies are not seen completely for example some parts of one of the pharmacies, the sentence may be changed to ''approximately here, two pharmacies exist.'' Depending on the possibility of seeing an object or an area, that object or that area is contained by conceptual ''here'' of somebody. Knowing how tall is the service requester and the height object to be seen, make it possible to deduce if the object is visible from his point of view or not. Imagine you are looking for a building in your ''here''. If that building is seen completely, you confirm that building is here. However, if some part of that building is visible from your position, you may approve being of that building in your ''here''. Seeing bigger part of the object, increase your certitude to confirm that object is located in your ''here''. Formula 2 shows the percent of visibility of an object. If there is no intervening object that acts as an obstacle, then you can see the object 100 % and if the intervening object is as high as the object which is supposed to be seen, then (L2-H)/L2 is zero and you cannot see it. (L2-H)/L2 is a factor which shows percent of visibility of an object.
where L1 is your height and L2 is height of object to be seen. H shows the height Intervening object and D1 shows distance between user and intervening object.
D2 is distance between intervening object and the object to be seen.
Membership function of line of sight is shown in Fig. 4. As it shown in below, visibility of an object can be classified into three major categories; very visible, somehow visible and invisible.
One of the other criteria used in recognizing ''here'' is topological relationships. One of the most important topological relationships which have been implemented to distinguish ''here'' is connectivity. Usually Connection or disconnection of two streets is considered when somebody wants to call an area as his ''here''. In fact, people think that a street is located in their ''here'' if that street links to the street where they are at right moment. If a street is not connected to the street where they are, they will not say that ''that street is located here'', even it is the nearest street to them. If two street meet each other in a junction, they may be located in their ''here''. If one street is reachable passing two junction, that may include as your ''here'' and so on. In order to define an appropriate membership function for topological relationship, it is very important to quantify connection and disconnection.
Within the framework of this paper influencibility stands for spatial causal relations, i.e., object must come in contact with another (Malek 2001). Let us take influenceability as an order relation (symbolized by0) and primitive relation. It is natural to postulate that influenceability is irreflexive, antisymmetric, but transitive. Let X Â X be the Cartesian product X with itself. Then, influenceability can be defined for every x; y 2 X as: x 0 y :¼ R In ¼ f\ðx; yÞ; l In ðx; yÞ [ jðx; yÞ 2 X Â Xg Connection as a reflexive and symmetric relation (Cohn and Hazarika 2001) for two objects x and y can be defined by influenceability as follows: Membership function of this input variable is shown in Fig. 5. As it can be seen in Fig. 5, connectivity is categorized into three major classes; very connected, probably connected and disconnected.
Finding the most appropriate membership curve for all of these criteria or input variables is based on experience and concept of that variable.
One of the important contexts of a mobile user is direction of movement. It should be considered in context aware mobile services. Using direction make the meaning of ''here'' clearer. Direction can be expressed both by the quantitative measures like degree or grad, and qualitative ones like behind, left. The latter measure can be considered as a fuzzy variable for finding somebody's ''here''. A moving service requester considers an object in his ''here'', if that object is placed on his way. Imagine that a person is driving in the highway looking for a gas station. The search in the database should be something like ''a gas station in here''; therefore the result should be a gas station which has not been passed. It is because that roll back in a highway is not reasonable. Note that the bearing measured based on the user coordinate system is not defined relative to an external reference direction; instead, it is defined with respect to an intrinsic axis of orientation that is imposed by the mobile's physical configuration.
Consequently for a moving service requester, ''here'' may not mean behind of him. In addition his speed has an important role. If you drive with high speed, your behind is not definitely called ''here'' but if you are walking you may call your behind or around of you as your ''here'' but with lower possibility. Direction can be calculated with a high accuracy using formula 3 or it can be estimated approximately. In both cases, the existence of an object on the way or on the same direction of movement is a fuzzy variable.

3
It is possible to model ''here'' based on these input variables as it explained in next section.

Implementation
The fuzzy inference system (FIS) enables us to infer the output, using defined membership functions of inputs and inferring by a fuzzy inference engine and predefined rules. In order to infer valid area of ''here'', four input variables distance, topological relationship, direction and line of sight were defined and their membership functions were assigned respectively. Mamdani's inference method was selected to infer the output or ''here''.
As it stated before, after defining membership functions of all inputs, it is turne of defining rules in the inference engine. Some of these rules can be seen in the Fig. 6.
The general strategy of defining the set of rules is selected by ourselves because of not having any related sample. Some of these rules can be seen in Table 1 and Fig. 6.
If all of the inputs are in their extreme situation (e.g., distance is very near, direction is completely straightforward and so on), the output is in its best situation or exactly here. If one or two of inputs are in the second situation (e.g., distance is approximately near and (or) line of sight is somehow visible and so on), output situation is approximately here. In the rest of situation, output situation is possibly here. These rules enable the inference engine to deduce information about ''here''. Running our system make the membership function of ''here'' as it shown in Fig. 7.
As it shown in Fig. 7, ''here'' can be defuzzified into three major categories; exactly here, approximately here and possibly here. In order to have a better understanding of a service requester's ''here'', membership function of ''here'' is considered to find the valid area of each service requester's ''here''.
Two different situation and user were considered to test. The first one, which is shown in Fig. 8, includes a stationary user. In order to find its ''here'', all the criteria except direction of movement were considered. According to the physical distance between the user and the providers, the line of sight using DTM of this area and topological relation of surrounding objects, the ''here'' is obtained and result illustrated in Fig. 8.
The second service requester is moving, another criterion, direction, was considered too. As it can be seen in Fig. 9, the extension of the user's ''here'' is match with the direction of movement. Gradual colors show the ''here'' of each service requesters. The lightest colors around each requester shows ''possibly here'', darkest blue shows the area of ''exactly here'' and the third ring indicates ''approximately here'' of a service requester. It is possible to find the features which are located in these three classes of ''here''. For example, selected features, which are highlighted with blue, are the features which are located in ''exactly here'' of the user of Fig. 9. The service provider can select the feature that are located in ''exactly here'' area.
In order to validate our model, we conduct a survey and make 100 questionnaires and distributed 100 people to find how people validate the results of our inference engine. In this survey, 100 users in different ages who are frequently go a specific area and are familiar with that area were selected randomly to test the inference engine. Developed software was installed on all devices of users. The user interface (UI) of the software consists of a so called slippy map and related controls for navigating through the map. Users were supposed to click on one of the features shown on their cell phones' screen. Once they clicked, our service provider generated a fuzzy polygon to show ''here'' of that point, sent them back and also stored those areas in spatial database for further usage using DAC (Data Access Component). The service provider used the same rough inference engine to find these areas and it send them a GML (Geography Markup Language) document which contains the ''here'' polygons. In this interaction, if ''here'' area of specific feature or point was generated previously [as response to request of other user(s)], it just retrieved from spatial database thus improving the performance of the system. The mobile device of user then renders ''here'' area of clicked point or feature. Hundred users were supposed to comment on fuzzy area of ''here'' for the clicked point or feature displayed on the mobile screen. They fulfilled a questionnaire to express whether they think in the same way. In these questionnaires, users were asked which features should have been considered as features in ''here'' of the selected feature from their point of view and to what extent result were close to their conceptions. They were supposed to assign a    about ''here'' of a feature. Result of questionnaires including assigned scores showed that 63 % of users considered our model acceptable in addition the difference between drawn polygons by users and inferred polygons be inference engine was less than 6 % of the average of drawn and inferred polygon's area. For example for a selected feature whose area is 100 (m 2 ), provided polygon for ''here'' area based on inference engine and drawn polygon of ''here'' area by users are sharing more than 94 (m 2 ). In other word, intersection between inferred polygon and drawn polygon are more than 94 (m 2 ), it is possible to consider our inference engine able to model ''here'' area successfully. Now the model has been tested and we can claim that ''here'' can be generated mathematically. So it is possible to answer users' request. For example if a user is looking for ''a restaurant which is located ''here'''', first ''here'' is inferred for him. All feature locating in his ''here'' are selected, as it was shown in Fig. 10 and now it is possible to select a restaurant from all selected feature based on its attribute field. So in order to provide ambient services in users' logical area, first their logical area should be found. Then using a select by location, all features in the logical area are selected and after that based on an attribute, best answer(s) is found. Then that information is provided to user.

Conclusion
In order to take advantage of mobile GIS capabilities, the our need to model and manipulate the human related concepts like ''here'' using compatible representations, is rapidly increasing. In response to this one fundamental issue of great concern in geospatial research is how to most effectively capture such concepts around us in geoservices.
Making this task even more challenging is the fact that uncertainties should be considered in the representation, analysis and use of geospatial information. Describing the uncertainty of the boundaries of here or there clearly require different tools than those provided by probability theory. In light of this it is natural that fuzzy set theory has become a topic of intensive interest in this area.
''Here'' as a spatial concept which has not been modeled and defined in GIS, was considered in this paper. In this regards a fuzzy model is proposed to model unclear word; ''Here''. Consequently important criteria which have the important roles in making the meaning of ''here'' clear were understood. Distance, line of sight of viewer, topological relationships between features around service requester or mobile user and direction of service requester's movement considered.
Defining membership functions of inputs and choosing fuzzy inference engine and predefined rules, it is possible to model ''here''. Four input variable were defined and Mamdani inference method was selected. Finally using predefined rules, membership function of ''here'' obtained. The values were classified into three classes; exactly here, approximately here and possibly here. The membership function was implemented for three service requesters, two moving and a stationary one. The implementation shows the fuzzy area of their ''here'' successfully. It is possible to provide proximity based services easily.
In order to test our model, 100 persons were supposed to test our model. Each person was supposed to draw a polygon on a map of area, in which he was, to show his ''here''. This polygons were compared with the outputs of our model and surprisingly, more than 94 % couples of maps, have similarity between 65 and 98 % and this certifies that this model works pretty well. Open Access This article is distributed under the terms of the Creative Commons Attribution License which permits any use, distribution, and reproduction in any medium, provided the original author(s) and the source are credited.