CS92: Bridges!
in conjuction with the Lincoln School
Erin Carey,
Diana Chien,
Jason Li

Programming Modules Specifications
last updated 4/8/04

Goal:
To simulate a bridge (structurally) and to place test loads on it.

 

Organization:
There are two Lingo modules:

  1. animation + loading
  2. bridge modelling

The two interact during structural failure analysis:

  • The first module will tell the second module how much total load there,
    the second module will determine whether or not the bridge breaks.
    .
  • If the bridge breaks, then the second module will signal the first module and the first module will animate the bridge breaking.
    .
  • This will occur at regular intervals to check for instantaneous load (more on that later).

 

 

Mod1: animation + loading

What it should do:

  • Loads take the form of passengers on the bridge.
    E.g. a person walking or a car travelling across the Brooklyn Bridge
    .
  • The user is allowed to choose when to add a new load by clicking on the 'load' button.
    .
  • Upon this click, an event will be triggered and the computer will randomly select a load type to output.
    E.g. a person, a car, a tank
    .
  • After the load type has been chosen, then it will travel across the bridge on screen. During travel, it will be animated.
    .
  • The animation will be graphically constructed from alternating images.
    E.g. a person walking could be animated by having alternating images of swinging arms/legs
    .
  • The animation will also travel at a speed consistent with its speed in real life
    E.g. a car will travel faster than a person
    .
  • The computer will keep track of the loading effect, this will be stopped once the load leaves the screen
    E.g. a person's weight
    .
  • There may be multiple clicks on the 'load' button that will enable multiple loads to travel across the bridge simultaneously, making the last 4 points much more complicated in terms of data management and graphical manipulation.
    E.g. a person walking next to a car, taking into account both the person's and the car's weight, and the fact the car will speed past the person and leave the screen first
    .
  • The clicks will be moderated so that there will be a minimum delay between consecutive clicks so that loads do not appear literally on top of one another or crash the computer due to overload.
    .
  • If the other module signals bridge failure, then there will be an animation sequence of the bridge breaking
    E.g. people falling off

Programming issues:

Overall:

input: multiple user clicks
output: graphical display (animation), current total load

This is a much simplified model as the program does most of the work behind the scenes. It has to keep track of:

  • load position
  • load current image (as the images alternate for animation)
  • load speed of travel
  • total load (sum of all loads) on bridge

From these, it has to determine:

  • if load position is past the bridge (if it s the case, subtract its contribution to total load)
  • if load's next position (determined by its speed) will be result in the above

The catch is that the computer has to keep track of these items simultaneously, and that they are changing all the time. Dynamic data structures?

 

 

 

Mod2: bridge modelling:

What it should do:

  • accurately implement a engineering / mathematical model of the 3 bridge types (beam, arch, suspend)
    .
  • allow the user to change the material and size of the bridge
    .
  • when given a load, be able to tell whether or not the bridge fails, this status will have to be updated periodically as loads are added to the bridge

Programming issues:

Overall:

input: dimensions of bridge (height, length, cross-sectional area, etc), tensile strength of material, type of bridge, load on bridge
output: bridge failure (T/F)

The mathematical model for a bridge includes many data points, that vary from bridge to bridge. Additionally, there will be calculations involving moments at numerous points on the bridge. This can be thought of as a large Excel spreadsheet implemented in Lingo using complicated data structures. Below is a table that details this conversion:

Excel
Director Lingo
tables
multi-dimensional arrays
caluations involving multiple cells
functions that select data from various arrays

(more detail later)

 

 

General notes:

  • commented code is a necessity as the program can be adapted towards older audiences who will have greater control over the simulations
    .
  • this also mandates neat, elegant code

 

 

CONTACT US