Next: About this document ...
Assignment notes: stage 1
CSE3301: SAR (C.Twardy)
March 12, 2001
Target date: Friday 23 March.
- Your program should read in (1-100) areas from the areas file
using the comma-separated format (one record per line):
- Area number: an integer from 1-100 with the special values -1
for RestOfWorld and -2 for Base Camp.
- Location: an (x,y) pair of integers specifying the center of the
area. The integers will be UTM coordinates: 4 digits by 4 digits.
- Size in square kilometers. A float. You may presume at this
point that all regions will have the same size, but read it in from
the file.
- Altitude in meters. An integer.
- Terrain: an integer
- Vegetation: an integer between 0 and 100, representing density
of plant cover.
- Initial POA (integer 0..100)
For example: 2, 1280, 4459, 0.1, 50, 2, 25, 5. You may want
to do some error-checking. Do the POAs add up to 100? You might want
to warn the user if RestOfWorld has a very high or a very low
POA. Likewise if BaseCamp has a nonzero POA. Anything else?
- Read some number of resources from the resources file.
- Resource number (positive integer)
- Resource type (unquoted string)
- POD (integer 0..100)
- ESW in meters (positive float)
- Speed in km per hour (positive float)
- Number of people (positive integer)
Example: Hasty Team, 30, 10, 6.5, 3
- Read assignments from assign.dat, in the format
resourceNum, area. Example: 2, 97. Check that the
assignments are possible. The assignments are for one period only,
so presume that one team cannot receive two assignments. All teams
need to be assigned, although some will be assigned to Base Camp
(area -2). You may wish to consider in the future keeping tabs on
how long a resource has gone without rest. Carry out any other
error-checking you think advisable.
- Print the original POA table. A grid would be a nice format. You
may wish to be fancier, but include a basic number grid.
- Update the POA for this assignment, and print the new POA table.
- In general: ignore any comment lines or blank lines in the files.
Comment lines begin with # or with %. Figure out
how many lines there are as you read. Save your program as
updatePOA, and write it to be run in batch mode so that I
may type updatePOA area.dat resources.dat assign.dat and
get the result on standard output. For the moment, we are ignoring
many of the fields. You will want to consider how to update the POA
given an LKP.
- Internal documentation: each function must identify
its author. All but the most trivial functions should explain what
they do.
Next: About this document ...
Charles Twardy
2001-03-12