home *** CD-ROM | disk | FTP | other *** search
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --changep.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate (MANPOWER)
- procedure CHANGE_PARAMETERS (NAME : in string;
- COEFF_MM : in out ACCURATE_FLOAT;
- EXP_MM : in out ACCURATE_FLOAT;
- COEFF_TDEV : in out ACCURATE_FLOAT;
- EXP_TDEV : in out ACCURATE_FLOAT) is
- ----------------------------------------------------------------------
- --| NAME : CHANGE_PARAMETERS
- --|
- --| OVERVIEW:
- --| This procedure allows the user to modify the parameters in the
- --| COCOMO equations.
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed an processing continues
- ----------------------------------------------------------------------
-
- CHOICE : integer range 1..3;
- YES_OR_NO : character := 'N';
- PARAMETER : long_float digits 15 := 0.0;
-
- begin
- -- output the current equation
- new_line; put(NAME); set_col(17); put("MM = "); put(COEFF_MM,2,3,0);
- put(" * KSLOC ** "); put(EXP_MM,2,3,0); new_line;
- set_col(17); put("TDEV = "); put(COEFF_TDEV,2,3,0);
- put(" * MM ** "); put(EXP_TDEV,2,3,0); new_line(2);
-
- -- input the ManMonth coefficient
- put_line(" Enter coefficient of the ManMonth equation");
- put(" (default = "); put(COEFF_MM,2,3,0); put(") : ");
- begin
- if END_OF_LINE then
- SKIP_LINE;
- else
- get (PARAMETER); SKIP_LINE;
- COEFF_MM := PARAMETER;
- end if;
- exception
- when others => skip_line;
- end;
- new_line(2);
-
- -- input the ManMonth exponent
- put_line(" Enter exponent of the ManMonth equation");
- put(" (default = "); put(EXP_MM,2,3,0); put(") : ");
- begin
- if END_OF_LINE then
- SKIP_LINE;
- else
- get (PARAMETER); SKIP_LINE;
- EXP_MM := PARAMETER;
- end if;
- exception
- when others => skip_line;
- end;
- new_line(2);
-
- -- input the Development Schedule coefficient
- put_line(" Enter coefficient of the Development Schedule equation");
- put(" (default = "); put(COEFF_TDEV,2,3,0); put(") : ");
- begin
- if END_OF_LINE then
- SKIP_LINE;
- else
- get (PARAMETER); SKIP_LINE;
- COEFF_TDEV := PARAMETER;
- end if;
- exception
- when others => skip_line;
- end;
- new_line(2);
-
- -- input the Development Schedule coefficient
- put_line(" Enter coefficient of the Development Schedule equation ");
- put(" (default = "); put(EXP_TDEV,2,3,0); put(") : ");
- begin
- if END_OF_LINE then
- SKIP_LINE;
- else
- get (PARAMETER); SKIP_LINE;
- EXP_TDEV := PARAMETER;
- end if;
- exception
- when others => skip_line;
- end;
- new_line(2);
-
- exception
- when others => put_line ("exception raised in CHANGE_PARAMETER");
- end CHANGE_PARAMETERS;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --banner.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate (MANPOWER)
- procedure PRINT_BANNER_PAGE is
- ----------------------------------------------------------------------
- --| NAME : PRINT_BANNER_PAGE
- --|
- --| OVERVIEW:
- --| This procedure prints the banner page to the report file. This
- --| includes the global data input to the program and references
- --| to Barry Boehm's and Tom DeMarco's book (where these equations
- --| originated.
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| EXCEPTIONS HANDLED:
- --| others An error message is printed and processing continues
- --|
- ----------------------------------------------------------------------
-
- package ENUMERATION_IO is new TEXT_IO.ENUMERATION_IO (MODE_TYPE);
- use ENUMERATION_IO;
-
- begin
- -- print out the banner page
- new_page (report); new_line(report, 12); set_col(report, 40);
- put(report,"Boehm / DeMarco / Estimated Staffing Profiles");
-
- new_line(report, 7); set_col(report, 10);
- put(report," lines of source code in thousands (KSLOC) = ");
- put(report, KSLOC,5,4,0);
-
- new_line(report, 2); set_col(report, 10);
- put(report, "Man-months of effort (equation from ");
- put(report, "Barry W. Boehm, pg.75, table 6-1) = "); new_line;
- put(report, MAN_MONTHS,5,4,0);
-
- new_line(report, 2); set_col(report, 10);
- put(report, "Most likely delivery time (equation from Barry W. Boehm, ");
- put(report, "pg.75, table 601) = ");
- put(report, TD_NOMINAL,5,4,0);
-
- new_line(report, 2); set_col(report, 10);
- put(report, "The impossible region (equation from Tom DeMarco, pg.181) = ");
- put(report, IMP_REGION,3,3,0);
- put(report, " months or less");
-
- new_line(report, 2); set_col(report, 10);
- put(report, "Equation mode type used: ");
- put(report, MODE);
-
- exception
- when others => put_line ("exception raised in BANNER");
- end PRINT_BANNER_PAGE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --graphit.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate (MANPOWER)
- procedure GRAPH_IT (TITLE : in string) is
- ----------------------------------------------------------------------
- --| NAME : GRAPH_IT
- --|
- --| OVERVIEW:
- --| This procedure plots the monthly work distribution on a page of
- --| output. The graph is scaled vertically with no limitation placed
- --| on staffing requirement values, and horizontally, with the maximum
- --| amount of time being 100 months.
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| EXCEPTIONS:
- --| others An error message is printed and processing continues
- --|
- ----------------------------------------------------------------------
-
- DASHES : constant string (MONTH_TYPE) := (others => '-');
- MAX_LINES : constant integer := 30;
- STARS : constant string (1..20) := (others => '*');
-
- A_MONTH : MONTH_TYPE := MONTH_TYPE'first;
- BIG_AT : MONTH_TYPE := MONTH_TYPE'first;
- BIGGEST : long_float digits 15 := 0.0;
- GRAPH_LINE : string (MONTH_TYPE);
- HORIZ_SCALE : integer := 3;
- MONTH_WIDTH : integer := 3;
- MONTH_COUNT : integer := 1;
- NUM_LINES : integer := MAX_LINES;
- STAFF : array (MONTH_TYPE) of integer range 0..MAX_LINES;
- VERT_SCALE : long_float digits 15 := 1.0;
- VERT_INDEX : integer := 1;
-
- begin
- -- print header for page
- new_page(report);
- set_col(report, 56); put_line(report, TITLE);
- set_col(report, 56); put_line(report, DASHES(1..20));
-
- new_line(report, 2); put(report,' ');
- put(report, STARS(1..10));
- put(report, " Acceleration rate = ");
- put(report, ACCEL_RATE, 3, 3, 0);
- set_col(report, 60); put(report, STARS(1..5));
- set_col(report, 70); put(report, "Peak staffing occurs around month ");
- put(report, TDEV, 3, 1, 0);
- put(report, " "); put_line(report, STARS(1..10));
-
- -- print header for graph
- new_line(report, 2);
- put(report, " Staffing Estimate:");
- set_col(report, 110); put_line(report, "Month Est. Staff");
- set_col(report, 110); put(report, DASHES(1..5));
- set_col(report, 121); put_line(report, DASHES(1..10));
-
- -- find the largest staffing requirement
- for I in STAFFING'first..MONTH loop
- if BIGGEST < STAFFING(I) then
- BIG_AT := I;
- BIGGEST := STAFFING(I);
- end if;
- end loop;
-
- -- compute vertical height of '*' on the graph for each horizontal point
- if BIGGEST > long_float(MAX_LINES) then
- VERT_SCALE := long_float(MAX_LINES) / BIGGEST;
- else
- NUM_LINES := integer(BIGGEST);
- end if;
-
- for I in 1..MONTH loop
- STAFF(I) := integer (STAFFING(I) * VERT_SCALE);
- end loop;
-
- -- compute horizontal scaling and MONTH-COUNT field width
- if MONTH > 50 then
- HORIZ_SCALE := 1;
- elsif MONTH > 33 then
- HORIZ_SCALE := 2;
- MONTH_WIDTH := 4;
- end if;
-
- -- print out graph
- for I in reverse 1..NUM_LINES loop
-
- -- create graph line
- GRAPH_LINE := (others => ' ');
- for J in 1..MONTH loop
- if STAFF(J) = I then
- GRAPH_LINE(J*HORIZ_SCALE) := '*';
- end if;
- end loop;
-
- -- print graph lines
- VERT_INDEX := integer(long_float(I) / VERT_SCALE);
- set_col(report, 3); put(report, VERT_INDEX,5);
- put(report, " |"); put(report, GRAPH_LINE);
- if MONTH_COUNT <= MONTH then
- set_col(report, 111); put(report, MONTH_COUNT,3);
- set_col(report, 121); put(report, STAFFING(MONTH_COUNT),3,5,0);
- MONTH_COUNT := MONTH_COUNT + 1;
- end if;
- new_line(report);
- end loop;
-
- -- print bottom lines of graph
- set_col(report, 9); put(report, "+");
- GRAPH_LINE(1..MONTH*HORIZ_SCALE) := DASHES(1..MONTH*HORIZ_SCALE);
- for J in 1..MONTH loop
- if STAFF(J) = 0 then
- GRAPH_LINE(J*HORIZ_SCALE) := '*';
- end if;
- end loop;
- put(report, GRAPH_LINE);
-
- if MONTH_COUNT <= MONTH then
- set_col(report, 111); put(report, MONTH_COUNT,3);
- set_col(report, 121); put(report, STAFFING(MONTH_COUNT),3,5,0);
- MONTH_COUNT := MONTH_COUNT + 1;
- end if;
- new_line(report);
-
- -- print out month numbers
- set_col(report, 9); put(report, '0');
- A_MONTH := 4-HORIZ_SCALE;
- while A_MONTH <= MONTH loop
- put(report, A_MONTH, MONTH_WIDTH);
- A_MONTH := A_MONTH + (4-HORIZ_SCALE);
- end loop;
- if MONTH_COUNT <= MONTH then
- set_col(report, 111); put(report, MONTH_COUNT,3);
- set_col(report, 121); put(report, STAFFING(MONTH_COUNT),3,5,0);
- MONTH_COUNT := MONTH_COUNT + 1;
- end if;
- new_line(report);
-
- -- print out month label
- set_col(report, 40); put(report, "Duration (months)");
- if MONTH_COUNT <= MONTH then
- set_col(report, 111); put(report, MONTH_COUNT,3);
- set_col(report, 121); put(report, STAFFING(MONTH_COUNT),3,5,0);
- MONTH_COUNT := MONTH_COUNT + 1;
- end if;
- new_line(report);
-
- -- print out remainder of month/staffing requirement table
- for I in MONTH_COUNT .. MONTH loop
- set_col(report, 111); put(report, I,3);
- set_col(report, 121); put(report, STAFFING(I),3,5,0);
- new_line(report);
- end loop;
- exception
- when others => put_line ("exception raised in GRAPH_IT");
- end GRAPH_IT;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --getprof.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- separate (MANPOWER)
- procedure GET_STAFF_PROFILE (PROFILE : in profile_type;
- ACCEL_INCREMENT : in ACCURATE_FLOAT) is
- ----------------------------------------------------------------------
- --| NAME : GET_STAFF_PROFILE
- --|
- --| OVERVIEW:
- --| This procedure calculates the manpower staffing estimates by month
- --| of various acceleration rates. The acceleration rates tested start
- --| at ACCEL_INCREMENT and are incremented by ACCEL_INCREMENT for each
- --| successive test. GRAPH_IT is called to plot a graph of the
- --| distribution for each acceleration rate tested.
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| EXCEPTIONS HANDLED:
- --| others An error message is printed and processng continues.
- --|
- ----------------------------------------------------------------------
-
- DOWN_HILL : boolean := false;
-
- begin
- ACCEL_RATE := 0.0;
- OUTER_LOOP:
- loop
- ACCEL_RATE := ACCEL_RATE + ACCEL_INCREMENT;
- MONTH := MONTH_TYPE'first;
- TDEV := SQRT(1.0 / (2.0 * ACCEL_RATE));
- STAFFING := (others => 0.0); -- reset array
-
- -- the inner loop will calculate the manpower (staffing) estimates at
- -- each time period (1 month increments) with a constant acceleration
- -- rate 'ACCEL_RATE'
- INNER_LOOP:
- loop
- PARAM := -ACCEL_RATE * (long_float(MONTH)**2);
- STAFFING(MONTH) := 2.0 * MAN_MONTHS * ACCEL_RATE * long_float(MONTH)
- * exp(PARAM);
- DOWN_HILL := STAFFING(MONTH) < STAFFING(MONTH-1);
- if DOWN_HILL and STAFFING(MONTH) < 2.0 then
- exit INNER_LOOP;
- end if;
- MONTH := MONTH + 1;
- end loop INNER_LOOP;
-
- -- graph the appropriate profile
- if PROFILE = NOMINAL then
- if (long_float(MONTH) <= TD_NOMINAL + 0.5) then
- GRAPH_IT ("Nominal Schedule"); -- nominal schedule has been found
- exit OUTER_LOOP;
- end if;
- else
- if long_float(MONTH) <= TD_NOMINAL then
- GRAPH_IT("COMPRESSED SCHEDULE");
- else
- GRAPH_IT("EXTENDED SCHEDULE");
- end if;
- exit when STAFFING(integer(IMP_REGION)) < 2.0;
- end if;
- end loop OUTER_LOOP;
-
- exception
- when others => put_line ("exception raised in GET_STAFF_PROFILE");
- end GET_STAFF_PROFILE;
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- --manpower.ada
- --::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- With TEXT_IO;
- package INTEGER_IO is new TEXT_IO.INTEGER_IO(integer);
- with TEXT_IO;
- package LONG_FLOAT_IO is new TEXT_IO.FLOAT_IO(long_float);
-
- with TEXT_IO; use TEXT_IO;
- with LONG_FLOAT_IO; use LONG_FLOAT_IO;
- with INTEGER_IO; use INTEGER_IO;
- with IO_EXCEPTIONS; use IO_EXCEPTIONS;
- with FLOAT_MATH_LIB; use FLOAT_MATH_LIB;
- with LONG_FLOAT_MATH_LIB; use LONG_FLOAT_MATH_LIB;
-
- procedure MANPOWER is
- ----------------------------------------------------------------------
- --| NAME : MANPOWER
- --|
- --| OVERVIEW:
- --| This program uses Barry Boehm's COCOMO equations and Tom DeMarco's
- --| PNR cost model to estimate the staffing requirements for a typical
- --| software project. Some of the basic man-month estimate equations
- --| can be modified to reflect the project more accurately.
- --|
- --| HISTORY:
- --| written by Bonnie Burkhardt March 1985
- --|
- --| EXCEPTIONS HANDLED:
- --| others an error message is printed and execution terminates
- --|
- --| NOTES:
- --| The abbreviations MM and TDEV are used in the variable names so
- --| the equations will more closely correspond to the ones used by Barry
- --| Boehm.
- ----------------------------------------------------------------------
-
- type PROFILE_TYPE is (NOMINAL, COMPRESSED);
- type MODE_TYPE is (ORGANIC, SEMIDETACHED, EMBEDDED);
- subtype ACCURATE_FLOAT is long_float digits 15;
- subtype MONTH_TYPE is integer range 1..100;
-
- TDEV : ACCURATE_FLOAT;
- ACCEL_RATE : ACCURATE_FLOAT;
- STAFFING : array (MONTH_TYPE'first-1..MONTH_TYPE'last)
- of ACCURATE_FLOAT;
- MONTH : MONTH_TYPE;
- TD_NOMINAL : ACCURATE_FLOAT;
- IMP_REGION : ACCURATE_FLOAT;
- MAN_MONTHS : ACCURATE_FLOAT;
- REPORT : file_type;
- FILE_NAME : constant string := "MANPOWER.RPT";
-
- FINISHED : boolean := false;
- KSLOC : ACCURATE_FLOAT;
- MODE : mode_type;
- PARAM : ACCURATE_FLOAT;
- CHOICE : integer range 1..3;
- VALID_ENTRY: boolean := false;
- YES_OR_NO : character := 'N';
-
- -- parameters of the equations that may be varied
- COEFF_MM_ORG : ACCURATE_FLOAT := 2.4;
- COEFF_MM_SEMI : ACCURATE_FLOAT := 3.0;
- COEFF_MM_EMBED : ACCURATE_FLOAT := 3.6;
- EXP_MM_ORG : ACCURATE_FLOAT := 1.05;
- EXP_MM_SEMI : ACCURATE_FLOAT := 1.12;
- EXP_MM_EMBED : ACCURATE_FLOAT := 1.20;
- COEFF_TDEV_ORG : ACCURATE_FLOAT := 2.5;
- COEFF_TDEV_SEMI : ACCURATE_FLOAT := 2.5;
- COEFF_TDEV_EMBED : ACCURATE_FLOAT := 2.5;
- EXP_TDEV_ORG : ACCURATE_FLOAT := 0.38;
- EXP_TDEV_SEMI : ACCURATE_FLOAT := 0.35;
- EXP_TDEV_EMBED : ACCURATE_FLOAT := 0.32;
-
- procedure CHANGE_PARAMETERS (NAME : in string;
- COEFF_MM : in out ACCURATE_FLOAT;
- EXP_MM : in out ACCURATE_FLOAT;
- COEFF_TDEV : in out ACCURATE_FLOAT;
- EXP_TDEV : in out ACCURATE_FLOAT) is separate;
- procedure PRINT_BANNER_PAGE is separate;
- procedure GRAPH_IT (TITLE : in string) is separate;
- procedure GET_STAFF_PROFILE (PROFILE : in PROFILE_TYPE;
- ACCEL_INCREMENT : in ACCURATE_FLOAT) is separate;
-
- begin
- -- open report file
- create (REPORT, NAME => FILE_NAME);
-
- -- change the parameters of the equations, if desired
- new_line(6);
- put("Would you like to change any of the parameters in the COCOMO equations?");
- new_line; put(" (Y or N -- def=N) : ");
- begin
- if not END_OF_LINE then
- get(YES_OR_NO); skip_line; new_line(3);
- if YES_OR_NO = 'Y' or YES_OR_NO = 'y' then
- put_line ("Enter the value of the parameter (X.X)");
- put_line ("(Press <ret> to assume the default value)");
-
- CHANGE_PARAMETERS ("Organic", COEFF_MM_ORG, EXP_MM_ORG,
- COEFF_TDEV_ORG, EXP_TDEV_ORG);
- CHANGE_PARAMETERS ("Semidetached", COEFF_MM_SEMI, EXP_MM_SEMI,
- COEFF_TDEV_SEMI, EXP_TDEV_SEMI);
- CHANGE_PARAMETERS ("Embedded", COEFF_MM_EMBED, EXP_MM_EMBED,
- COEFF_TDEV_EMBED, EXP_TDEV_EMBED);
- end if;
- end if;
- exception
- when others => skip_line;
- end;
-
- -- repeat until user specifies to quit
- while not finished loop
- -- get lines of code estimate
- VALID_ENTRY := false;
- new_line(6);
- put(" Enter # of lines of source code in thousands (XX.X) : ");
- loop
- begin
- get (KSLOC);
- exit;
- exception
- when others =>
- skip_line; new_Line;
- put("Invalid input, try again (e.g., 0.2 or 2.0) : ");
- end;
- end loop;
-
- -- get the MODE type
- new_line(4);
- put_line(" Basic Cocomo Effort and Schedule Equations:");
- set_col(10); put_line("1. Organic");
- set_col(10); put_line("2. Semidetached");
- set_col(10); put_line("3. Embedded"); new_line(3);
- put(" Enter number corresponding to MODE type desired: ");
-
- loop
- begin
- get (CHOICE); skip_line;
- exit;
- exception
- when others =>
- skip_line; new_line;
- put("Invalid input, try again :");
- end;
- end loop;
-
- -- Calculate the MAN_MONTHS of effort and the month estimate for project
- -- final delivery using the user specified effort equation. These
- -- equations are Boehm's equations and can be slightly modified to reflect
- -- closer estimations, if desired.
- case CHOICE is
- when 1 => MODE := ORGANIC;
- MAN_MONTHS := COEFF_MM_ORG * exp(EXP_MM_ORG * log(KSLOC));
- TD_NOMINAL := COEFF_TDEV_ORG * exp(EXP_TDEV_ORG * log(MAN_MONTHS));
- when 2 => MODE := SEMIDETACHED;
- MAN_MONTHS := COEFF_MM_SEMI * exp(EXP_MM_SEMI * log(KSLOC));
- TD_NOMINAL := COEFF_TDEV_SEMI * exp(EXP_TDEV_SEMI * log(MAN_MONTHS));
- when 3 => MODE := EMBEDDED;
- MAN_MONTHS := COEFF_MM_EMBED * exp(EXP_MM_EMBED * log(KSLOC));
- TD_NOMINAL := COEFF_TDEV_EMBED * exp(EXP_TDEV_EMBED * log(MAN_MONTHS));
- end case;
-
- -- calculate the impossible region.
- IMP_REGION := 1.9 * exp(0.3333333333333 * log(MAN_MONTHS));
-
- PRINT_BANNER_PAGE;
-
- -- find the nominal staffing profile
- GET_STAFF_PROFILE(NOMINAL,0.001);
-
- -- find the compressed and expanded staffing profiles
- GET_STAFF_PROFILE(COMPRESSED,0.01);
-
- -- determine if user wishes to continue
- new_line(2);
- put(" Do you want to write another report (Y or N -- def=N): ");
- begin
- if END_OF_LINE then
- FINISHED := true;
- else
- get (YES_OR_NO);
- if YES_OR_NO /= 'Y' and YES_OR_NO /= 'y' then
- FINISHED := true;
- end if;
- end if;
- exception -- default is 'N'
- when others => skip_line;
- end;
- end loop;
-
- close (report);
-
- exception
- when others => put_line ("exception raised in MANPOWER");
- end MANPOWER;
-
-