Follow Us

Showing posts with label Class notes. Show all posts
Showing posts with label Class notes. Show all posts

Sunday, 27 May 2012

An overview of Decision Support Systems

Overview of Decision Support Systems

1. Introduction to Decision Support Systems
Inform students that a handout containing a full set of visuals will be provided to them at the end of this lecture. During the last session we looked at what we mean by decision making, considering various approaches to studying decision making, and studying some of the factors involved.
English: Roadmap from data collection to decis...
English: Roadmap from data collection to decision support. Source: NASA. (Photo credit: Wikipedia)
Decision making can be programmed or non-programmed.  Programmed decisions deal with problems which are clear cut and have well-established procedures to get to a solution; non programmed decision making, in the absence of such procedures, relies more on the experience and intuition of the decision maker.
2. What are DSS?
DSS evolved as a means for helping people, specifically senior management, make these non- programmed decisions. A definition of DSS (Sprague & Carlson, 1982) is:

“Computer-based systems that help decision-makers confront ill-structured problems through direct interaction with data and analysis models.”
Keen and Scott-Morton, 1978 (from Turban course text):
“...couple the intellectual resources of individuals with the capabilities of the computer to improve the quality of decisions.  It is a computer based support system for management decision makers who deal with semi-structured problems.”
3. Evolutions of DSS
There are two identifiable streams of development contributing to DSS:
·         Computer-based information systems.
·         Operational research and management science.
3.1. Computer-Based Information Systems
The first commercial computer systems used were known as EDPs – Electronic Data Processing systems. These were systems, usually running on mainframe computers, which were dedicated to some particular business transaction in batch-processing mode – Typically something like calculating payrolls or updating stock records.
The first of these was LEO (Lyons Electronic Office) developed by Lyons around 1958. EDP systems were used at lower levels of an organisation to automate existing, routine paper-based transactions.
Management Information Systems (MIS) appeared in the 1960s, and were aimed at integrating various EDP tasks, providing a structured information flow to middle management to allow these managers to better handle day to day operations. MIS were organised around a database with inquiry and report generating features. Most large organisations have built MIS.  University of London has one, which handles a wide range of information – things like courses, student numbers, room allocation etc. – and allows middle managers, such as Registry and Admission staff to keep track of huge amounts of information, and allocate resources efficiently.

3.2. Operational Research and Management Science
These disciplines deal with strategic and tactical planning, and managing resources efficiently.  They do this by building and using mathematical models and simulations for solving complex problems, and the techniques used in OR have saved companies large amounts of money.
4. Operational Researches and the Modelling Process
The basic steps involved in the modelling process are:
·         Define the problem.
·         Collect and record all relevant data.
·         Examine and analyse data and develop a mathematical or systematic model of the real life situation.
·         Check the model is valid.
·         Test the model under differing conditions.
·         Select the optimum solution using the model.
·         Implement the results.
·         Keep a check on the model and see it is still valid under changing Circumstances.
·         Always mention the drawbacks: i.e. – have all the questions been asked in formulating the problem?
·         Implicit it OR is the assumption that the problem can be formulated in mathematical terms.
Statistical techniques are used in the feedback process where the model is compared to the reality and checked to see if there are any significant differences.
Computer resources are mostly used in setting up the model and providing the mathematical solution required.
5. OR Problems
Around the early 1970s, these two streams came together in the form of DSS, in response to two things:
        Advances in technology – initially with access to time sharing terminals and new software.
        A growing realisation that MIS were not easily able to support unstructured strategic decision making, typical of the activities of senior management.
Further advances came in the late 1970s, with the emergence of PCs and with integrated software applications; and also applications generators – software environments and shells which could allow people who were not expert programmers to build their own DSS. As we have said then, DSS were traditionally aimed at senior managers, dealing not with day to day information but with mainly historical information.  By looking at trends in information stretching back months and years, managers could use DSS to model various scenarios, in order to make projections into the future – to see trends and patterns, and then take some action.  So DSS provided ways of manipulating all kinds of information to aid strategic decision making.
Nowadays, there is a tendency to call any system which supports decision making a DSS. For example, there are a number of spreadsheet applications available now, such as Excel, which incorporate features allowing users to explore a wide range of decision alternatives – essentially allowing people to ask “What if?” questions.
There are also a number of project planning applications on the market. A significant activity of senior management is planning the work of the organisation, perhaps establishing goals for project teams, and time scales for various activities over a 5 or 10 year period. The best of these applications allow users easily to manipulate all kinds of variables to come to some optimum solution – again, to explore scenarios by asking “What if?” questions (for example, “What is the effect on the whole project if we increase Task B time scale by 10%?”).
Also, nowadays, there is a realisation that DSS can potentially support decision making throughout an organisation, and newer systems are not just aimed at senior management.

6. What Should DSS Do?
Sprague (1989) describes a number of characteristics that an ideal or generic DSS should possess, from a manager’s point of view:

1. They should provide support for decision making, particularly semi-structured and unstructured decisions – Sprague reports that this is an expressed requirement by managers.
2. They should provide decision support for managers at all levels, particularly supporting the integration of decision making between levels – managers at different levels typically work on different aspects of the same problem.  Co- ordination of the activities of these people is a central requirement.
3. They should support interdependent as well as independent decisions – interdependent decisions are those where an individual makes part of a decision then passes the responsibility on to someone else (example of bank loans office). They might also involve decisions made by some group process.
4. They should support all phases of the decision making process, for example, Simon (1960):
ü  establishing a goal;
ü  identifying possible courses of action;
ü  selecting the optimum action plan;
ü  Implementing the chosen plan.
5. They should support a variety of decision making processes – Simon’s model is only one of many process models.  DSS should support others.
6. They should be easy and convenient to use.
7. Scopes of DSS
It is difficult to get an overall view of the scope of DSS.  Probably they are most widely used in the area of financial planning.  For example, the Treasury uses DSS to aid in its forecasting and management of the economy.
These systems have a number of economic models embodied in software which process all kinds of economic data – money supply, GNP, trade data etc., in order to make forecasts and projections of the state of the economy.  Also, a number of City institutions, banks and large firms use DSS for financial management – things like investment management.
DSS are also used in the areas of:
        transport planning and operation;
        productivity management;
        industrial process management;
        marketing;
        business planning;
        auditing;
7.1 Survey of DSS Applications (Eom and Lee 1990)
A paper by Eom & Lee (1990) discusses a literature survey of DSS applications from the early 1970s to 1988.  They found 203 papers in journals dealing with specific DSS applications.  Their selection criteria for including applications were:
        Supporting decision makers rather than replacing them.
        Utilising both data and models.
        Solving problems with varying degrees of structure (mainly semi-structured and unstructured).
The main application area seemed to be corporate financial management (65.5%).  Included in this area were papers to do with marketing, transportation and logistics; as well as production and operations management, finance and strategic management. Outside the corporate area, applications focused on natural resources, hospital and health care, education, military, urban planning and administration and government.
Eom and Lee also looked at the level of management at which the DSS applications were aimed.  They found that 23.6% were aimed at strategic decision making support: the rest at tactical or operational decisions. They also claim there seems to be an increasing trend towards DSS for strategic decision making.
8. Management Reluctance to DSS
Do senior management readily and regularly use DSS?  This is a difficult question to answer.

There seems to be a greater acceptance of DSS by management in the USA than in the UK (Eom and Lee’s study largely focused on US systems).

This might relate to the way managers in the USA are educated – there has been a longer tradition in the USA that management is a set of skills that needs to be learnt, whereas in the UK, management until recently has been regarded as something that you pick up through experience.  Certainly the development of DSS seems more widespread in the USA than anywhere else.
A recent conversation with a Management Consultant colleague told me that the use of DSS in the UK was not well advanced because of resistance to the idea of computer- aided support. This resistance seems to take a number of forms:

·         The notion that “secretaries use computers”.  This attitude seems to be declining nowadays – having a sophisticated PC on one’s desk is a mark of status.
·         Managers are convinced of the quality of their own, intuitive, unaided decision making.
·         Reluctance because managers do not understand the models used in the DSS.
·         Time constraints – managers do not have time to help build or learn to use DSS.
·         Previous experience with inadequate DSS.
9. Current Trends in DSS
Users of DSS – There are a trend towards the use of DSS by other people in the organisation, besides senior management. These might be middle managers, engineers, R&D staff etc.
Group decision support – There is also a trend towards more widespread group working in business generally.  In part this has been driven by technological developments – better communications, based on efficient exchange of information by computer networks; and by realisations that better decisions are likely to be produced if the decision making process has the input of people with a range of skills and expertise.  This has led to attempts to produce GDSS– and we will be looking at GDSS in later lectures.

Application of AI to DSS – As we will see in later lectures, the heart of a DSS is a Model Base – a collection of software algorithms which process largely numerical data held in a database.  These are procedural and inflexible – and the output often consists of indecipherable tables of probability data. The use of AI techniques in DSS construction: such as frames and rules, and heuristic, rule of thumb reasoning, allows the possibility of representing knowledge in more flexible ways; ways that are more useful to humans than the output of traditional algorithmic processing. Strategic level problems require that manipulation of symbolic rather that numerical information, and AI and Expert Systems can handle this well.



Enhanced by Zemanta

Friday, 25 May 2012

Networking with Java


In this topic, we'll cover networking with Java. Don't worry if you're not familiar with networking - this will be only a brief introduction. We'll examine some of the classes in the java.net package, and show you how to write a simple network client in Java. First, however, we need to cover some background theory.

How do computers talk to each other via the Internet?

The Internet is composed of millions of computers, located all across the globe, communicating and transmitting information over a variety of computing systems, platforms, and networking equipment.  Each of these computers (unless they are connecting via an intranet) will have a unique IP address.
IP addresses are 32-bit numbers, containing four octets (8 bit numbers) separated by a full stop. Each computer with a direct internet connection will have a unique IP address, (e.g. 207.68.156.61). Some computers have temporary addresses, such as when you connect to your ISP through a modem. Others have permanent addresses, and some even have their own unique domain names (e.g. www.microsoft.com).
An IP address allows us to uniquely identify a device or system connected to the Internet. If I wanted to connect to a specific IP address, and send a message, I could do so. Without an IP address, my message would have no way of reaching its destination - a bit like leaving the address off a letter or parcel.
Often, computers connected to the Internet provide services. This page is provided by a web server, for example. Because computers are capable of providing more than one type of service, we need a way to uniquely identify each service. Like an IP address, we use a number. We call this number a port. Common services (such as HTTP, FTP, Telnet, SMTP) have well known port numbers. For example, most web servers use port 80. Of course, you can use any port you like - there's no rule that says you must use 80.
Figure 1.0 - Ports help computers identify which service data is for.

There are several communications mechanisms that we can use to provide network services. We could use UDP (unreliable datagram protocol), or TCP (transfer-control protocol). For the purposes of this tutorial, we'll choose TCP, because it makes life much easier. TCP guarantees that messages will arrive at their destination. UDP is unreliable, and your application isn't notified if the message is lost in transit. Also, many protocols (such as HTTP, SMTP, POP & FTP) use TCP, so it's important that you are familiar with it for networking in Java.

Internet Addressing with Java

Handling internet addresses (domain names, and IP addresses) is made easy with Java. Internet addresses are represented in Java by the InetAddress class. InetAddress provides simple methods to convert between domain names, and numbered addresses.
We start by importing the java.net package, which contains a set of pre-written networking routines (including InetAddress).
import java.net.*;
Next, we declare a new variable of type InetAddress, which we assign the value of the local host machine (for machines not connected to a network, this should represent 127.0.0.1). Due to the fact that InetAddresses can generate exceptions, we must place this code between a try .. catch UnknownHostException block.
// Obtain the InetAddress of the computer on which this program is running
InetAddress localaddr = InetAddress.getLocalHost();
The InetAddress class has methods that return the IP address as an array of bytes (which can be easily converted into a string), as well as a string representation of its domain name (e.g. mydomain.org ). We can print out the InternetAddress, as well as the domain name of the local address.
System.out.println ("Local IP Address : " + localaddr );
System.out.println ("Local hostname : " + localaddr.getHostName());
 
public class MyFirstInternetAddress
{
        public static void main(String args[])
        {
               try
               {
                       InetAddress localaddr = InetAddress.getLocalHost();
                       
                       System.out.println ("Local IP Address : " + localaddr );
                       System.out.println ("Local hostname   : " + localaddr.getHostName());
               }
               catch (UnknownHostException e)
               {
                       System.err.println ("Can't detect localhost : " + e);
               }
               
        }
 
        /** Converts a byte_array of octets into a string */
        public static String byteToStr( byte[] byte_arr )
        {
               StringBuffer internal_buffer = new StringBuffer();
 
               // Keep looping, and adding octets to the IP Address
               for (int index = 0; index < byte_arr.length -1; index++)
               {
                       internal_buffer.append ( String.valueOf(byte_arr[index]) + ".");
               }
               
               // Add the final octet, but no trailing '.'
               internal_buffer.append ( String.valueOf (byte_arr.length) );
 
               return internal_buffer.toString();
        }
}
Compile and run this application and you should be told your local IP address, and hostname. Don't worry if your computer isn't connected to the Internet, though. Providing your system has a TCP stack, it should give you back an IP address even if you aren't currently connected. On most systems, you can refer to your local machine (which often has the hostname "localhost") as IP address 127.0.0.1
Why would every machine that's not connected to the Internet have the same address? This address is known as a loopback address. Every time you connect to this address, you're actually connected to your local machine. So, if you were running a local webserver, and you pointed your browser to http://127.0.0.1, you should see your web-site. But if I were to go to the same address, I'd connect to a different site - that of my own machine.
This is great when developing Java applications. You don't need a permanent connection to the Internet - you can run client and server applications on your own machine. This is handy, because writing and testing client/server applications can take some time, and unless you have a permanent connection, you wouldn't want to be billed on an hourly rate by your ISP!

Writing a TCP client in Java

Writing network client in Java is very simple. If you've ever written a network client in C, you'll know how complicated it can be. You have to be concerned with structures, and pointers. Java cuts out this complexity, through its java.net.Socket class. To demonstrate just how easy Java makes it, I'm going to show you how to write a finger client.
For those who are unfamiliar with the finger protocol, I'll briefly explain how it works. Finger allows a remote user to query a host machine for information, either about the host machine in general or a specific user. Most unix systems support finger, and many non-Unix systems also support the protocol. Most finger applications take as a parameter 'username@hostmachine'.
Finger clients connect to a host server at port 79 and establish a TCP stream. The client sends the username (or a blank, for a general query), followed by a newline character. The server then sends back information about the user, in the form of a text stream. This should be displayed to the user, and then the connection should be terminated.
As with any networking application in Java, we need to first import the network and input/output packages.
import java.io.*;
import java.net.*;
Our application should have a single method, main, which is responsible for issuing a finger query. The first step is to validate and parse the command line parameters, looking for a username and hostname.
public static void main ( String args[] )
{
        // Check command line paramaters
        if (args.length != 1)
        {
               System.err.println ("Invalid paramaters");
               System.exit(1);
        }
        else
        // Check for existence of @ in paramater
        if (args[0].indexOf("@") == -1)
        {
               System.err.println ("Invalid paramater : syntax user@host");
               System.exit(1);
        }
 
        // Split command line paramater at the @ character
        String username = args[0].substring(0, args[0].indexOf("@") );
        String hostname = args[0].substring(args[0].indexOf("@") +1, args[0].length());
 
        ........
}
In the code above, we check that only a single parameter has been entered, and also that there exists a '@' character in the parameter. The next step is to split the command line parameter into a username and a hostname. To do this, we rely on the substring method which can be applied to any string. Username becomes the string from offset 0, to the first index of character '@'. Hostname becomes the string from the first index of character '@', to the length of the original parameter.
                         
Figure 2.0 - Extracting username & hostname from command-line parameter

The next step is to connect to the finger server, which operates on port 79. As with the previous example, we must enclose our network code inside of a try { ... } catch block. This allows us to trap any network errors that may occur (such as invalid hostnames, or an inability to connect with the server). You'll notice that the code to create a TCP collection is actually only a single line - networking in Java is very easy.
try
{
        // Create a connection to server
        Socket s = new Socket(hostname, 79);
 
        // Remainder of finger client code goes here
        .........
 
}
catch (SocketException e )
{
        System.err.println ("Socket error : " + e);
}
catch (UnknownHostException e )
{
        System.err.println ("Invalid host!");
}
catch (IOException e )
{
        System.err.println ("I/O error : " + e);
}
After connecting to port 79 of the finger server, we now have to obtain input and output streams for the socket. We can treat these streams then just as we would file or text input and output. For ease of use we'll covert the input stream into a DataInputStream, and the output stream into a PrintStream. This will allow us to use the readLine and println methods with our socket streams.
// Create input and output streams to socket
PrintStream out = new PrintStream( s.getOutputStream()) ;
DataInputStream in = new DataInputStream(s.getInputStream());
Using our PrintStream out, we write the name of the user we wish to find out information about to the finger server. The server will process the query, and output a result, which we will print to the user's screen.
// Write username to socket output
out.println( username );
 
// Read response from socket
System.out.println ( in.readLine() );
 
// Read remaining finger response
String line = in.readLine();
 
while (line != null)
{
        System.out.println ( line );
 
        // Read next line
        line = in.readLine();
}
The first line is read from the input stream, and then printed to screen. We then enter a loop, checking to see if there are any more lines to display. The while loop terminates when there are no more bytes available.
Finally, we must close the connection to our finger server. With this last statement, our finger client is complete!
// Terminate connection
s.close();
While the example program functions as a finger client, it can easily be used as a TCP client skeleton, substituting the connection to port 79 with another port matching the application protocol you are trying to use, and modifying the read/write routines to send different data.
Tip - Not all ISP's run finger servers, so you won't be able to finger every user. The example above should work, however (providing my ISP doesn't change its policy).

Summary

Writing network applications in Java is extremely easy. Java takes away much of the implementation details which are operating system specific. There's no need to worry about hostname lookups, size of IP address structures, or pointers. The java.net package provides all this functionality for you, and provides a simple way to write networking clients. However, when writing Java applets (as opposed to applications), remember that the browser may impose security restrictions - many applets can only communicate with the host from which they were downloaded from.
Radio Foorti