Information agents are computational software systems that can access to distributed, multiple, and heterogeneous information sources, and can integrate them. Since their information sources are dynamically changing, they have to handle their behavior, and cooperate each other in such environment. To realize such intelligent behavior on the agents, it is helpful to use some frameworks for them. In this paper, we propose MiLog, a logic based mobile agent framework for constructing them. In the framework, we provide following three features: (1)a complete programming language for cooperative information agents based on logic language, (2)powerful library to wrap Web-based services, and to provide Web based service by the agent, (3)interrupted anytime migration capability to react their environmental changes on the agents. The framework is implemented by Java and currently used to develop web-based decision support systems and intelligent information integration systems.
Mobile Agents, Logic Programming, Programming Tools
There have been growing interest on information gathering on the Internet. An Information gathering system is consisted of an information retrieval mechanism and an information integration mechanism . In general, in order to find information from the Internet, we can employ meta-search engines, such as MetaCrawler , SavvySearch , and InfoSpider . Although these meta-search engines can find information with simple procedure, they have no capability to use domain specific strategies or user specific strategies for enhancing the search strategies.
Information agents have been investigated very actively. Information agents are computational software systems that can access to distributed, multiple, and heterogeneous information sources, and can integrate them. Since their information sources are dynamically changing, they have to handle their behavior, and cooperate each other in such environment. For example, item prices on online auction sites are often changed by another bidding. The agent which monitor and gather information on online auction sites must take into account to those changes. Sometimes the change is so often to handle single agent, they must have to handle by two or more agents cooperatively.
To realize such intelligent behavior on the agents, it is helpful to use some frameworks for them. In this paper, we propose MiLog, a logic based mobile agent framework for constructing them. In the framework, we provide following three features:
The framework is implemented by Java and currently used to develop web-based decision support systems and intelligent information integration systems.
The rest of this paper is organized as follows: Section 2 presents an overview of the MiLog framework. Section 3 presents a method for describing wrappers simply on the MiLog framework. Section 4 presents the implementation model for providing inter-operability among agents. In section 5 we presents the architecture of mobile agents on the MiLog framework. In section 6 we discuss the features of the MiLog by presenting a real world application which supports online auctions on the Internet. Section 7 summarizes this paper, and show some possible directions for future researches.
Figure 1 shows the structure of the MiLog system. On the framework, each agent has an interpreter which interprets Prolog programs for the agent. Agents can get information from WWW server by using a WWW access library. For extracting words from Japanese documents, agents can use a morphological analysis library. Agents communicate with other agents by using an inter-operability library. Agents can move to other computers by using an agent transport manager. Agents control their platform-depend resources by using an environment access wrapper. The WWW Request Router enables agents to communicate with HTTP client (i.e. WWW browsers).
The framework has been implemented on the JAVA(tm) language. The agent description language interpreter is an extended Prolog interpreter that enables multi-thread programming with using suspension, interruption and resumption for realizing its mobility. The architecture of the mobility are described in section 5. To process multiple queries concurrently, an agent can share a clause its internal database (for recoding Prolog programs) with their clones. The clones can be used for realizing the multi-thread capabilities.
Figure 2 shows a user interface of the MiLog framework. Each agent has a console window to control, query, and edit the Prolog programs. The agent monitor shows which agents exist currently, which agents are communicating, and which agents are coming or going on the agent platform. In the agent monitor, agents are shown by using graphical icons.
In this section, we show how to describe programs for extracting WWW information on the MiLog framework. In general, the information extraction programs are called the wrappers. The wrappers provide uniform access methods to specific WWW pages written in HTML by using page-specific pattern matching mechanisms. It is difficult for generating the wrappers automatically. The reasons can be summarized as follows: The first reason is that HTML documents represent only their structures for displaying. The patterns to extract some data from such documents are ill-structured. The patterns should be written in an expressive description language. The second reason can be described as follows. Extracting all data from a document wastes CPU and memory even if the document is written in XML.
In the MiLog, an HTML document is stored in a list by using the built-in functions.
For instance, a document that has tags such as
Next, we show an example that extracts some information from a HTML document.
?- extract( [ _, [[tr]], _, [[font|_], [a,[href,HREF]], ItemName,_,['/td']], R], [ ..., [tr], [td], 'Some text...', ['/td'], [td], [font,[...]], [a,[href,'link.html']], 'The item', ['/a'], ['/td'], ['/tr'], ['/table'], ... ] ).
In this example, two data (ItemName and HREF) are extracted by using the predicate extract/2 in which the first argument takes a pattern, and the second argument takes an HTML document. The predicate (or function) extract/2 is efficiently executed by using backtracking and pattern matching on the system. By processing the query, the variable ItemName and HREF are bound to `The item' and `link.html' respectively. The pattern in the query is quite simple. And the query can be processed at enough speeds without useless memory consumption.
To realize inter-operability among agents, there exists a trade-off of usability and compatibility. The usability means how easy can users write programs which realize inter-agent communications and controls (such as bringing some tasks to other agents, sharing some information among several agents, and so on). The compatibility means how widely agents communicate with other agents.
Many agent communication languages (ACLs) are proposed . But they are too large and complex for using local communications among agents. They need some wrappers to communicate with other non agent-based systems (such as search engines or auction sites on the Internet). In general, there exist a lot of needs to realize information agents which can communicate with web-based applications. The MiLog can support users to easily implement wrappers.
In the MiLog framework, we provide the following two types of communication methods. Firstly, a direct querying method to other agents for using local communications. Secondly, an HTTP-based indirect communication method to interact with remote web based systems.
In the MiLog framework, the following two types of local communications among agents are available. Firstly, a shared clause database can be used for local communications. The MiLog provides a predicate to make clone agents from a certain agent. These clone agents can share a clause database which is an internal database to store Prolog programs (or clauses). For example, when the predicate clone2(pine) is called on an agent named tiger, the clone agent named pine is created. Each clone agent runs concurrently with a shared clause database. Secondly, querying to other agents is the other type of local communication methods. An agent can query to another agent when that agent is in the idle status. The MiLog provides several predicates for posting a query to another agent. There are the following predicates for posting a query: a synchronized query predicate, an asyncronized query predicate, a concurrent query predicate, and a query predicate which create target agent's clone to respond. For example, when the predicate query( pine, feeling(FEELING)) is called on an agent tiger, the agent pine evaluates feeling(FEELING) and then make a response such as feeling(good). On the agent tiger the variable FEELING is bound to good.
By using the MiLog framework, agents select these two types of local communication methods based on their needs for communication.
The MiLog framework provides WWW Server/Client capability for agents.
While an agent can access to a WWW server, the agent can act like as a WWW server to respond to another clients.
To access to WWW servers, we provide some built-in predicates.
Users can write wrappers simply and easily.
To respond to requests from other clients, we provide a WWW request router which converts a HTTP request into a Prolog query in local communication, and sends the client an HTTP response.
In order to make an agent be a WWW server, we only add definitions of the clause doService/2 to the agent's program.
Consider the following clause is defined in the program of the agent tiger.
In this case, a user can access to this agent by using a WWW browser with the URL http://some.host.com:1234/tiger?message=feelGood in which the ``:1234/'' is a port number, the tiger is an agent name, the message=feelGood is data used by the predicate doService.
Then the WWW browser can get a responding page(that is, the content of the variable OUT), which includes a string feelGood.
doService( ID, OUT ) :-
OUT = ['<HTML><HEAD></HEAD><BODY>',M,'</BODY></HTML>'].
Figure 3 shows the architecture for implementing mobile agents. Each computer has one meta agent which is a transmitter and a part of an agent transport manager in Figure 1. A mobile agent migrates from computer `A' to computer `B' as following steps :
The meta agents are also written in the MiLog with some extended built-in predicates which controls the internal states of other agents.
The transmitter meta agents are also mobile agents which can migrate from a host to a host. This architecture enables the system to dynamically reconstruct agent migrating and transporting mechanisms such as security manager or hierarchical migration of agents .
Figure 4 shows a sample code of a simple meta agent.
On the STEP1, the mobile agent requests the predicate move/2 to the meta agent.
For example, if mobile agent named mover intends to move the host 220.127.116.11:9012 (this means that IP address is 18.104.22.168 and port number is 9012), the following request is established.
1 move( Agent, Host ) :- 2 serialize( Agent, Bin ), 3 transmitterMetaAgentName(T), 4 request( T, receiveAgent( Agent, Bin ), Host), 5 deleteAgent(Agent),!. 6 move( Agent ,_ ) :- 7 resume( Agent ). 8 receiveAgent( Agent, Bin ) :- 9 deserialize( Agent, Bin ), 10 verify( Agent ), 11 resume( Agent ).
We have proposed BiddingBot, a system which can support bidding to several auction sites simultaneously by the cooperative bidding agents. In this section, we show how BiddingBot system is implemented by using the MiLog framework.
Figure 5 shows the architecture (on the left of the Figure 5) and the user interface (on the right of the Figure 5) of BiddingBot. BiddingBot consists of one leader agent and several bidder agents. Each bidder agent is assigned to an auction site. Each agent is implemented by using the MiLog framework. The bidder agents cooperatively gather information, monitor, and bid in the multiple auction sites simultaneously. The communications among agents are implemented by using shared clause databases and querying to other agents. The leader agent facilitates cooperation among the bidder agents as a match-maker, sends a user's request to the bidder agents, and presents bidding information to the user. The leader agent interacts with a user as a WWW server on the MiLog framework. The cooperation protocol are implemented by finite state machines in which the state is changed by receiving a certain query from other agents. In BiddingBot, each of the bidder agents is specified to her auction site and can behave as a flexible wrapper, since different auction sites represent information in different forms. Wrapper functions on the bidder agents are implemented by using a pattern description language in the MiLog.
In this paper, we proposed the MiLog framework for constructing intelligent information agents on the WWW. We presented the following three useful components on the framework. (1) The information extraction description, (2) The powerful logic programming language interpreter with inter-operability, and (3) The meta agent model and its implementation for mobility of the agents. We presented the following examples to demonstrate how effectively we can program on the MiLog. (a)An expressive pattern description language for wrappers, site-specific information extraction programs to reduce the cost of constructing such ill-formed programs: By using the MiLog, we can simply represent web pages in the style of logic programming. (b) Two types of inter-operability among agents: Firstly, we presented direct inter-operability for local communication with lower overhead. Secondly, we presented indirect inter-operability by using WWW Server/Client mechanisms to interact with other web-based applications or the users by using WWW browser applications. Since the MiLog supports multi-thread programming and messaging mechanisms among agents, we can effectively implement cooperation mechanisms among agents. (c) A meta agent based migration implementation for dynamically selecting the best method for transporting and authorizing agents: We demonstrated a simple meta agent program which can be extended by applying models for security, authorization, and transportation management mechanisms for realizing efficient migrations of agents. We have implemented BiddingBot, an online auction support system by using the MiLog framework. We demonstrate that our approach is useful to incorporate intelligent behaviors into mobile agents.