Procedural Design by dffhrtcv3

VIEWS: 0 PAGES: 27

									Procedural Design

  February 2001
   Janet Murray
What is a Computer?
         What is a Computer?

• A device or system that is capable of
  carrying out a sequence of operations in
  a distinctly and explicitly defined
  manner.

- Oxford Dictionary of Computing
         What is a Computer?

• A device or system that is capable of
  carrying out a sequence of operations in
  a distinctly and explicitly defined
  manner.

- Oxford Dictionary of Computing
                Primitives

• Not capable of being broken down into
  simpler form. (Oxford Dictionary of
  Computing)

• E.g. arithmetical primitives
• ASCII code
• on/off bits
     Computation and Complexity

• “The central problem for computer
  science is to develop methods for
  handling complexity. The two
  techniques that have proven most
  effective are finding the best
  representation for the problem and
  decomposing it into smaller parts.”
- Biermann, Great Ideas in Computer Science
              Lego - like Design
•  Primitives the first layer in increasingly complex
  structure
• Building complexity by nesting abstractions:
   – arithmetic operators; square roots; quadratic
     equations
   – ascii code; compare strings; read / retrieve/display
     information; search database
• Like the human mind:
   – chair; kitchen; room; home
   – move limbs; drive; use map; go to mall
               Abstraction

• The principle of ignoring those aspects
  of a subject that are not relevant to the
  current purpose in order to concentrate
  on those that are.



- Oxford Dictionary of Computing
            Data Abstraction
• The principle of defining a data type in
  terms of the operations that apply to
  objects of the type with the constraint
  that the values of such objects can be
  modified and observed only by use of
  those operations.
- Oxford Dictionary of Computing
        Procedural Abstraction

• The principle that any operation that
  achieves a well-defined effect can be
  treated by its users as a single entity,
  despite the fact that the operation may
  actually be achieved by some sequence
  of lower level operations. [e.g. Pascal
  subroutines, Director custom behaviors]
- Oxford Dictionary of Computing
 Information Hiding (encapsulation)
• A principle, used when developing an
  overall program structure that each
  component should encapsulate or hide
  a single design decision. [Parnas’
  method of preparing a list of tricky and
  changeable design decision elements,
  and make each one its own module;
  interface to module hides specifics of
  processing, so does not change.]
- Oxford Dictionary of Computing
              Modularity

• Modular programming: A style of
  programming in which the complete
  program is decomposed into a set of
  components called modules….[usually
  refers to Parnas’ idea of promoting
  “information hiding”; now usually on
  object oriented principles]
- Oxford Dictionary of Computing
                Object

• …an identifiable component of a
  software system…that is in some sense
  self-contained….an instance of a
  component comprising data structures
  and procedures (called methods) for
  manipulating the structures. The
  methods [behaviors in Director] are
  activitated by messages sent to the
  object
          Object … continued

• The methods [behaviors in Director] are
  activitated by messages sent to the
  object, and the interior structure of the
  object is entirely hidden from any other
  object (a property called encapsulation).

- Oxford Dictionary of Computing
             Object: Class

• Objects are derived from a template,
  and the collection of objects that are
  instances of a particular template are
  said to form a class.

- Oxford Dictionary of Computing
           Object: Inheritance

…A particularly important feature is
  inheritance which allows new classes to
  be defined in terms of existing classes,
  inheriting some or all of the properties of
  an existing class. [if more than one
  parent allowed, it is called “multiple
  inheritance”
- Oxford Dictionary of Computing
       Declarative vs Procedural
              Knowledge
• Describes         • Does something
  something         • Recipe in action
• Recipe in words   • The dance itself
• Choreographic
  notes
          Model vs Simulation

• Describes the     • Embodies the
  structure and       structure and
  behavior            behavior
               Procedural

• I am using it as opposite of declarative:
  as referring to behavior, to actions
• I am NOT using it to refer to the
  difference between Pascal and C++
  (NOT meant as opposite of object
  oriented, but as INCLUDING object
  oriented and older style programming
  environments)
            Algorithm vs Heuristic

• Exactly specified            • Rule of thumb
  procedure                    • Dependent on domain
• Contains all the               knowledge that cannot
  knowledge you need to          yet be represented
  process any instance of      • Necessary for
  the data                       “travelling salesman”
• Useful for rote tasks like     like problems
  payrolls                     • How people do things
• How computers do               (“being analog”)
  things
          Group Exercise #1

• Specify a procedure for making
  breakfast
            Group Exercise #1

• Specify a procedure for making breakfast
  – Abstraction (what is ignored?)
  – Encapsulation (what is “black boxed”)
  – Templates (does it account for drip coffee and
    instant coffee? For tea?)
  – Cultural constructions? What do you assume?
  – Modularity? Are there messages or parameters
    passed between distinct activities?
           Group Exercise #2

• Make a family of autonomous
  characters
• Take the family through a day together
• Modularity:
  – divide up the work and coordinate it
  – What do you need to know about other people’s
    modules?
         Autonomous Agents

• Agent (Oxford): An autonomous system
  that receives information from its
  environment, processes it, and performs
  actions on the environment.

• E.g. the dogz and catz in pfmagic’s Petz
  series
                   Emergence

• Behavior that arises from systems that
  are made up of multiple autonomous
  elements and therefore give rise to
  results that could not be specifically
  determined.

• E.g. we can’t know exactly how a particular dog and
  cat will play together because too many factors are
  involved; artificial life phenomena such as flocking
                   State

• A composite of variables within a
  system that define the current
  configuration; the state of a system will
  effect the range of possible responses
  to the same input. For example, a
  virtual character in a “hungry” state will
  show more interest in food. A container
  in an “empty” state will be able to
  receive contents.

								
To top