Computational Models
- A computational model takes the form of an algorithm,
that is, a precise description of the steps that are carried
out.
Two informal examples of algorithms are recipes and instructions
for knitting.
- The
algorithm takes a set of inputs and eventually
turns them into an output.
In
a recipe, the ingredients are the inputs, the finished dish the
output.
- In
a serial algorithm, only one action can be executed at a time.
This is true for knitting instructions, for example.
- In a parallel algorithm, multiple actions are executed
simultaneously by different parts of the system.
A
recipe may be partly parallel because you can cook something while
chopping or stirring something else.
- A
computational modeler implements an algorithm
in a computer program, which is a set of instructions written
in a programming language (or computer language) which particular
computers know how to interpret.
The actual computer (the hardware) used to run the program
(the hardware) should not make any difference (even though this not
always true in practice, as we have seen from our experience trying
to get StarLogo to work on the Macintosh used for the lecture).
- Most programming languages, such as Basic, C, Pascal, Fortran, Cobol,
Logo, Lisp, and Scheme, are designed for implementing serial
algorithms.
- Parallel programming languages, for example, StarLogo, are designed
for implementing parallel algorithms.
- Since most computers are serial machines which can execute only one
instruction at a time, it is necessary to simulate
parallelism on them.
This can be done by dividing each of the processes which are
supposed to happen simultaneously into a number of small
steps and interleaving these steps to give the illusion of
parallelism.
Because we can make the steps as small as we want, we can come as close
as we want to simulating parallelism.
With a parallel language like StarLogo, the work of implementing
the parallel algorithm on the serial machine is done for us by
the language.
When you write a program in StarLogo, it is as if you are writing
it for a parallel computer.