UML based expert system generation Using Enterprise Architect to model and generate a web-based...

18
UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system

Transcript of UML based expert system generation Using Enterprise Architect to model and generate a web-based...

Page 1: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

UML based expert system generation

Using Enterprise Architect to model and generate a web-

based expert system

Page 2: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Aims of research

Using Unified Modelling Language (UML) to model expert systems (ES)

Developing a system that can consume and analyze that model to generate an ES

Using the web as a deployment platform

Page 3: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Reasons for research

ES need maintaining and scaling ES model should remain accurate As the system grows, it’s model

should still be understandable ES benefit from portability

Page 4: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Technologies used

Enterprise Architect UML model development XML exporting of model

Visual Studio 2010 Shell development using ASP.NET and

C# Web based user interface

Page 5: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Similar research

Dunstan’s ES generator Uses XML to output web-based ES

related to university courses XML file contains course information Prolog interpreter processes the data

and outputs web pages WITS – web-based training ES for

SME’s Uses JavaScript to provide functionality Easy to use interface

Page 6: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

What does this research add?

XML data generation methods consistency and validity of ES model accessible web-based ES not reliant

on client side scripting mechanism for both developers and

users to access the system

Page 7: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

ES Modelling

Relevant UML elements Activity Diagrams

Activities, objects, decisions, initials and finals

Edges used to link elements with optional guards

Sample ES Housing Benefit

Income, dependants, housing need define level of housing benefit

act HousingNeed

HousingNeedActivityInitial

Do you havea fixedabode? (trueor false)

hn1 :HousingBenefit

HousingNeed = true

hn2 :HousingBenefit

HousingNeed = false

HousingNeedActivityFinal

Is the abodeadequate? (true orfalse)

hn3 :HousingBenefit

HousingNeed = true

[false][true]

[true]

[false]

Page 8: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

KBS and ES Shell components

Knowledge base The uml model

Development environment EA

Inference engine .net shell

User interface Web page

Explanation facilities Web page

Page 9: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Mapping UML to ES

Critical factors are determined through activity diagrams

Decisions within the diagrams become rules – for example ‘fixed abode’

Forward chaining is used to test all decisions against current knowledge base – leading to a goal state.

Uses a blind search

Page 10: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Model development

A Class model defines the system (HousingBenefit) Class variables define

critical factors Nested composite

activity diagrams define how critical factors are determined

Page 11: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Activity Diagrams

Instances of the class are added to diagrams

Run state of a variable in that instance is set accordingly

Ensures consistency/ integrity of data Where variables must only hold

specific values, enumerations are used (demo)

Page 12: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

ES Generator Classes

ExpertSystem class Dictionary containing all the critical factors Source XML data Processes the top level activities and outputs

the results

CriticalFactor class Processes the composite activities Determines the result of each critical factor

Nodes Process individual elements of an activity

diagram

Page 13: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Processing

Loops Top level loop successively finds all top

level activities starting from the first initial node

Sub loop processes discrete elements on each composite activity diagram

(es generator activities)

Page 14: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Determining critical factors

Object node finds the variable ‘extendedProperties’ subnode of the

current noderunstate="@VAR;Variable=HousingNeed;Value=true;Op==;@END

VAR;“

Split on ‘;’ Split on ‘=‘ Get the variable name and value Set the parent _criticalFactorResult to

the value

Page 15: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Handling decisions Determine the type of decision

Critical factor Direct input

If response already exists, get it, find the corresponding guard then find the target node and continue

If not, halt programme execution, output the question and wait for a response

Page 16: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Output

Once all critical factors have been determined, the goal state is determined

Then results are output This includes output of determining

factors Thereby providing simple explanation

Page 17: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Limitations

Only simple input can be handled Inputs are not validated Not like a traditional ES shell Developers must have knowledge of

UML Changes to the system must take

place at the correct location UML based XML data is hard-coded

Page 18: UML based expert system generation Using Enterprise Architect to model and generate a web-based expert system.

Advantages

ES model can scale whilst still being logically organised/ understandable

The model is a perfect representation of the implementation

Being web-based it is portable The shell allows any ES to be

developed and deployed on the web Provided the developer knows UML and

has Enterprise Architect.