250 likes | 426 Vues
ITCC 2005 April 4-6, 2005 Las Vegas, NV. Managing a Relational Database with Intelligent Agents Ira Rudowsky, Ph.D Brooklyn College/ Dept. Computer and Information Science Institute of Neural and Intelligent Systems Mount Sinai School of Medicine Study Participants:
E N D
ITCC 2005April 4-6, 2005 Las Vegas, NV Managing a Relational Database with Intelligent Agents Ira Rudowsky, Ph.D Brooklyn College/ Dept. Computer and Information Science Institute of Neural and Intelligent Systems Mount Sinai School of Medicine Study Participants: Ira Rudowsky, Ph.D Olga Kulyba Theodore Raphan, Ph.D Mikhail Kunin. Ph.D. Dmitri Ogorodnikov
Introduction • Research in computational neuroscience • Digitized streams of sampled analog and digital data • Static Image • Video Streams • Choice of Prototype Application for Interaction With Database • An existing application (VMF), which is used to display digitized analog data for a small group of neuroscience researchers doing experiments with human and animal subjects. • Data need to be stored in an organized manner so that they can be shared and mined using VMF Managing a Relational Database with Intelligent Agents
VMF Analyzer Application Managing a Relational Database with Intelligent Agents
Relational Database Design • Bold fields in each table represent the primary key, which consists of one or more fields • SUBJECT_ID in EXPERIMENT is a foreign key as it relates to SUBJECT_ID in the SUBJECT table • Links between foreign and primary keys enable search engine to quickly reduce the search space for a query. Managing a Relational Database with Intelligent Agents
Flexible Querying • During the course of experimentation, new types of apparatus are being developed, additional types of subjects are being tested and different types of tests are being devised and need to be easily included in database . • It became necessary to use free-format table entries as descriptors for experiments to maintain manageable tables. Managing a Relational Database with Intelligent Agents
Flexible Querying • General comment field in the EXPERIMENT table provides for: • free-format searches • scalability without adding overhead and complexity • Avoids the cost and time of programming changes to the database and application code • Can search using AND and OR logical connectors to enhance the querying capability Managing a Relational Database with Intelligent Agents
Flexible Querying • Query and Result screens Free Format Text String for Search Results of Search • However, this has raised issues of maintaining data quality when it is entered so that the records are properly indexed for efficient searching. Managing a Relational Database with Intelligent Agents
Data Quality • Data quality problems due to a wide range of errors ranging from simple entry to issues of data quality, which could impact data analysis and further research • A number of software tools have been developed to address problems of data quality. • Data cleansing examining the database following data entry to insure that errors in the data are minimized • Methods of data cleansing include eliminating duplicate records as a result of merged databases • Decomposing data into elemental parts and reassembling the data and verifying them across records • A more systematic technique represents the cleansing as a directed acyclic graph of data transformations. The data cleansing is performed as an iterative procedure that traverses the graph Managing a Relational Database with Intelligent Agents
Data Quality • An alternate approach for data cleansing using artificial intelligence is to utilize an expert system engine, Java Expert System Shell (JESS), together with a set of rules for data cleansing • JESS is a rule engine and scripting environment written entirely in Java. JESS enables the creation of software that has the capacity to "reason" using knowledge supplied in the form of declarative rules. The validation and verification stage, however, requires human intervention. • All presently proposed solutions to the data cleansing problem are generally “reactive” in the sense that the data cleansing is performed after the accumulation of large amounts of data. Managing a Relational Database with Intelligent Agents
Belief, Desire & Intention Agents • Agent-oriented programming has the potential for efficiently dealing with improving the data quality of free formatted fields. • Agent-based systems differ from classical rule-based expert systems in that they behave autonomously and interact with each other. • Agent-based programming is based on representation of agent properties in terms of belief, desire, and intention (BDI). • An agent is specified in terms of its capabilities (things the agent can do) • A set of initial beliefs • A set of initial commitments (an agreement to perform a particular action at a particular time) • A set of commitment rules Managing a Relational Database with Intelligent Agents
BDI Agents • Capabilities are used by agents to decide whether to adopt commitments • An agent will not adopt a commitment to perform an action if the agent determines that there is no possibility for performing that action. Managing a Relational Database with Intelligent Agents
Belief, Desire, Intention • The set of commitment rules determines how the agent acts. • Each commitment rule contains a message condition, a mental condition and an action. • In order to determine whether such a rule fires, the message condition is matched against the message the agent has received and the mental condition is matched against the beliefs of the agent. If the rule fires, the agent becomes committed to performing the action. Managing a Relational Database with Intelligent Agents
Example of BDI Function • Agent A sends a commitment request in a message to Agent B. • Agent B accepts or rejects the request based on the details of the request, its behavioral rules, and current mental model. • Agent B then sends a message to Agent A indicating acceptance or rejection of the request. • If Agent B accepts the request, it agrees to perform the requested action at the requested time if possible. • Agent B may have committed to making an inquiry into a database on behalf of Agent A. Even if Agent B has the ability to connect and query the database, it may not be possible at the specified time due to inaccessibility of the database. • Agent B monitors the execution of the query and reports to Agent A on the success or failure of the commitment. action request to B from A B accepts or reject A’s request If accepted, B attempts to perform A’s request Environment Agent B Agent A message of success or failure Managing a Relational Database with Intelligent Agents
JACKTM Intelligent Agents • JACKTM Agent Language from Agent Oriented Software • Agent pursues its given goals (desires), adopting the appropriate plans (intentions) according to its current set of data (beliefs) Managing a Relational Database with Intelligent Agents
JACKTM Intelligent Agents • Agent pursues its given goals (desires), adopting the appropriate plans (intentions) according to its current set of data (beliefs) • Agent - used to define the behavior of an intelligent software agent by specifying the following: • Events , both internal and external, that the agent is prepared to handle • Events that the agent can post internally to be handled by other plans • Events the agent can send externally to other agents • Plans that the agent can execute • BeliefSets that the agent can refer to Managing a Relational Database with Intelligent Agents
JACKTM Intelligent Agents • Event – an agent is motivated to take action due to: • Internal stimuli – an event an agent sends to itself , usually as a result of executing reasoning methods in plans • External stimuli – messages from other agents or percepts that an agent receives from its own environment • Motivations – goals that the agent is committed to achieving • Categories of events • Normal – represent transient information that the agent reacts to (location of ball in soccer game) • Agent selects first applicable plan instance for the event and executes only that plan • BDI – goal directed i.e., agents commits to the desired outcome, not the method chosen to achieve it • Agent selects from a set of plans, reevaluates if fails excluding failed plans from further consideration Managing a Relational Database with Intelligent Agents
JACKTM Intelligent Agents • Plan Analogous to an agent’s functions – the instructions the agent follows to try to achieve its goals and handle its designated events • Each plan handles a single event, but multiple plans may handle the same event • An agent can further discriminate between plans by executing a plan’s relevant() method to determine whether it is relevant for the instance of a given event • From the relevant plans, it can further decide which areapplicable by executing the planscontext()method Managing a Relational Database with Intelligent Agents
JACKTM Intelligent Agents • BeliefSet maintain an agent’s beliefs about the world • Represents an agent’s beliefs using a tuple-based relational model. • tuples can be true, false or unknown thus the concepts of “beliefs” • ClosedWorld Relations – the tuples stored are believed to be true, those not stored are assumed false • Open World Relations – store both true and false tuples, anything not stored is “unknown” • Events can be posted when changes are made to the beliefset and thus initiate action within the agent based on a change of beliefs Managing a Relational Database with Intelligent Agents
Database – Agent Interaction (1 ) Program.class When a record with SubjectType mouse or monkey is found, it invokes the method submitUpdateRequest() of the Updater agent (2) Updater.agent submitUpdateRequestinvokes therequest() method of the UpdateRequest event (3) UpdateRequest.event therequest method isinvoked (4) SendUpdateCommand.plan invokes update() method of Update (6) SendUpdateCommand.plan @send method sends Update event to the Monitor agent. Selects relevant plan to execute (UpdateMonkey or UpdateMouse) (5) Update.event the update method is executed (8)Finished.event the finished() method is executed (9)SendUpdateCommand.plan the @wait_for method receives the reply from UpdateMonkey and returns control to Program (7) UpdateMonkey.plan Handles theUpdate event, updates record in table @reply messages the Finished event Managing a Relational Database with Intelligent Agents
Conclusion • A simple intelligent agent-database interaction has been developed which can be extended to consider more complex data entries. • It was tested by deliberately introducing errors in data entry and was found to be responsive in correcting errors. Managing a Relational Database with Intelligent Agents
Thank you! You’ve been a great audience! Questions, comments??? Managing a Relational Database with Intelligent Agents
Agents public agent Updater extends Agent { #handles external event UpdateRequest; #sends event Update; #uses plan SendUpdateCommand; #posts event UpdateRequest ev; public Updater(String name) { super(name);} public void submitUpdateRequest(String monitor, String expID, String stype){ postEventAndWait(ev.request(monitor, stype, expID)); } } public agent Monitor extends Agent { #handles external event Update; #sends event Finished; #uses plan UpdateMonkey; #uses plan UpdateMouse; #posts event Update ev; public Monitor(String name){ super(name);} String stype, eid; public void setVars (String s, String e) {stype = s; eid = e; } } Managing a Relational Database with Intelligent Agents
Events public event Update extends BDIMessageEvent { public String stype, eid; #posted as update (String s, String e) {stype = s; eid = e; } } public event UpdateRequest extends BDIGoalEvent { public String monitor, stype, eid; #posted as request (String m, String s, String e){ monitor = m; stype = s; eid = e; } } public event Finished extends BDIMessageEvent { public String stype, eid; #posted as finished(String s, String e) {stype = s; eid = e;} } Managing a Relational Database with Intelligent Agents
Plans public plan SendUpdateCommand extends Plan { #handles event UpdateRequest preqev; #sends event Update ev; #reasoning method body() {try { Update q = ev.update(preqev.stype, preqev.eid); @send (preqev.monitor,q); @wait_for(q.replied()); Finished response = (Finished) q.getReply(); System.out.println(agent.name()+" has been updated in SendUpdateCommand "+response.eid); } catch (NullPointerException npe) { System.out.println("preqev.eid "+preqev.eid); } } } Managing a Relational Database with Intelligent Agents
Plans public plan UpdateMonkey extends Plan { #handles event Update handleUpdateEvent; #sends event Finished fev; #uses interface Monitor self; static boolean relevant(Update evRef) { return ((evRef.stype != null) && (evRef.stype.length() > 0)); } context(){ handleUpdateEvent.stype.equals("monkey"); } #reasoning method body() { self.setVars(handleUpdateEvent.stype, handleUpdateEvent.eid); // OTHER JAVA AND SQL CODE s.executeUpdate("UPDATE EXPERIMENT SET SUBJECTTYPE='animal‘ WHERE EXPID='" + handleUpdateEvent.eid + "'" ); } @reply (handleUpdateEvent,fev.finished(self.stype, self.eid)); } } Managing a Relational Database with Intelligent Agents