itcc 2005 april 4-6, 2005 las vegas, nv managing a relational database with intelligent agents ira...

25
ITCC 2005 ITCC 2005 April 4-6, 2005 Las Vegas, NV April 4-6, 2005 Las Vegas, NV Managing a Relational Database Managing a Relational Database with Intelligent Agents 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

Post on 21-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

ITCC 2005ITCC 2005April 4-6, 2005 Las Vegas, NVApril 4-6, 2005 Las Vegas, NV

Managing a Relational Database Managing a Relational Database

with Intelligent Agentswith Intelligent Agents

Ira Rudowsky, Ph.D

Brooklyn College/ Dept. Computer and Information ScienceInstitute of Neural and Intelligent Systems

Mount Sinai School of Medicine

Study Participants:Ira Rudowsky, Ph.D Olga KulybaTheodore Raphan, Ph.D Mikhail Kunin. Ph.D.

Dmitri Ogorodnikov

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 2

IntroductionIntroduction 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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 3

VMF Analyzer VMF Analyzer ApplicationApplication

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 4

Relational Database Relational Database DesignDesign

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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 5

Flexible QueryingFlexible 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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 6

Flexible QueryingFlexible 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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 7

Flexible QueryingFlexible 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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 8

Data QualityData 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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 9

Data QualityData 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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 10

Belief, Desire & Intention Belief, Desire & Intention AgentsAgents

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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 11

BDI AgentsBDI 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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 12

Belief, Desire, IntentionBelief, 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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 13

Example of BDI FunctionExample 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

message of success or failure

Agent A Agent B

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 14

JACKJACKTMTM Intelligent Agents 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)

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 15

JACKJACKTMTM Intelligent Intelligent AgentsAgents

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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 16

JACKJACKTMTM Intelligent Agents 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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 17

JACKJACKTMTM Intelligent Agents 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 are applicable by executing the plans context() method

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 18

JACKJACKTMTM Intelligent Agents 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

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 19

Database – Agent Database – Agent InteractionInteraction

(1 ) Program.classWhen a record with

SubjectType mouse or monkey is found, it invokes the method

submitUpdateRequest() of the Updater agent

(2) Updater.agentsubmitUpdateRequest invokes the request()

method of the UpdateRequest event

(3) UpdateRequest.event the request method is invoked

(5) Update.event the update method is executed

(6) SendUpdateCommand.plan@send method sends Update event to the Monitor agent.

Selects relevant plan to execute (UpdateMonkey or UpdateMouse)

(7) UpdateMonkey.planHandles the Update event,

updates record in table@reply messages the Finished event

(9)SendUpdateCommand.plan the @wait_for method receives the

reply from UpdateMonkey and returns control to Program

(4) SendUpdateCommand.plan invokes update() method of Update

(8)Finished.eventthe finished() method is

executed

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 20

ConclusionConclusion 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.

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 21

Thank you!Thank you!You’ve been a great audience!

Questions, comments???

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 22

AgentsAgentspublic 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; }}

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 23

EventsEventspublic 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;}}

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 24

PlansPlanspublic 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); } }}

4 April 2005 Managing a Relational Database with Intelligent Agents Slide 25

PlansPlanspublic 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)); } }