The Persistent Programming Language ODE
Database description
Consider a 8 x 8 two-dimensional grid of counties in a state. (For
data consider the data published for assignmenet 1.) Each grid cell
has a dimension of 20 km by 20 km. The southwest corner is the origin
(0,0).
- Each county (i.e., each grid cell) contains the following
information. A name. A list of between 1 and 4 cities located within
that county. There is one of the cities in each county designated as the
county seat. Each city has associated with it its population size.
- There is a list of highways between pairs of cities. (Obviously
the pair of cities do not have to be in the same cell or in
neighboring cells. However a highway should not be longer in Taxi-Cab
distance than 6.) The graph of highways needs to be connected. Each
highway has a name, a distance, and an estimated duration to travel
between the two cities linked by the highway. Certain highways carry
the designation ``scenic.''
Tasks
- Define using ODE's data definition language the schema for the
this map database.
- Populate your database. A county is called CountyIJ if the
county is located at the x-coordinate I and the y-coordinate J. Call
the cities CityIJN, IJ denotes the name of the county, N the name of
the city in that county. The county seat is always city 1. Call the
highway HighwayIJKLMN, if the highway connects CityIJM to CityIJN.
Distances and duration are set realistically but with some randomness
built in.
- Solve the following problems in ODE. (REMARK: you are not
allowed to load the entire database in main memory and make this a
simply data structures assignment.)
- Write an application that takes as input two cities (for simplicity
I will refer to these cities as cite1 and city2) and determines
- The shortest path from city1 to city2. You are to write out
this path and give its distance and duration. Also give a list
of counties through which the path runs.
- Whether there exist scenic paths between city1 and city2,
and if so, writes out the shortest of these paths.
- Given as input a city C, a distance D, and a population size P,
list all the cities with population size larger than P that have a
distance to C smaller than D.