Список использованных источников.
1 Айзерман М.А., Алескеров Ф.Т. Выбор вариантов: основы теории. – М.: Наука, 1990. – 640 с. 2 Волков И.К., Загоруйко Е.А. Исследование операций. – М.: Изд. МГТУ им. Н.Э. Баумана, 2000 г. – 384 с. 3 Волкова В.Н., Денисов А.А.. Основы теории систем и системного анализа: Учебник. – Изд. 3-е. – СПб.: Изд. СПбГПУ, 2003. – 520 с. 4 Грешилов А.Аю Математические методы принятия решений. – М.: Изд. МГТУ им. Н.Э. Баумана, 2006 г. – 584 с. 5 Ларичев О.И. Теория и методы принятия решений, а также Хроника событий в Волшебных странах: Учебник. – М.: Логос, 2003. - 294 с. 6 Месаревич М., Тарахара Я. Общая теория систем: Математические основы. – М.: Мир, 1978. – 311 с. 7 Ногин В.Д. Принятие решений в многокритериальной среде. – М.: Физматлит, 2002. – 408 с.
Приложение А
Листинг программы unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, ExtCtrls, StdCtrls, Grids, Spin;
type TForm1 = class(TForm) Lex: TPanel; StringGrid9: TStringGrid; SpeedButton28: TSpeedButton; SpeedButton30: TSpeedButton; SpeedButton31: TSpeedButton; SpeedButton32: TSpeedButton; SpeedButton33: TSpeedButton; SpeedButton34: TSpeedButton; SpeedButton35: TSpeedButton; ocen4: TLabel; ocen3: TLabel; ocen2: TLabel; ocen1: TLabel; Label14: TLabel; SpeedButton29: TSpeedButton; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Panel1: TPanel; Label2: TLabel; Label16: TLabel; Label17: TLabel; StringGrid3: TStringGrid; Panel2: TPanel; Label11: TLabel; Label12: TLabel; StringGrid1: TStringGrid; Label10: TLabel; Label13: TLabel; Label15: TLabel; Label18: TLabel; SpeedButton4: TSpeedButton; SpeedButton5: TSpeedButton; Label1: TLabel; Label19: TLabel; Label20: TLabel; Label21: TLabel; procedure SpeedButton13Click(Sender: TObject); procedure SpeedButton8Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1; i,j,k,m: integer; kai, opt: Real;
implementation
{$R *.dfm}
procedure Zabivka; Begin For i:=1 to 4 do For j:=1 to 3 do Begin form1.Stringgrid3.Cells[i,j]:=form1.Stringgrid1.Cells[i,j]; form1.Stringgrid9.Cells[i,j]:=form1.Stringgrid1.Cells[i,j]; end; For i:=1 to 4 do Begin form1.Stringgrid3.Cells[i,0]:='k'+inttostr(i); form1.Stringgrid9.Cells[i,0]:='k'+inttostr(i); end; For j:=1 to 3 do Begin form1.Stringgrid3.Cells[0,j]:='a'+inttostr(j); form1.Stringgrid9.Cells[0,j]:='a'+inttostr(j); end; end;
procedure TForm1.SpeedButton13Click(Sender: TObject); begin panel1.Visible:=true; Stringgrid3.Cells[0,4]:='А(опт)'; Stringgrid3.Cells[5,0]:='K(ai)'; For i:=1 to 3 do Begin Kai:=(StrtoFloat(Stringgrid3.Cells[1,i])+StrtoFloat(Stringgrid3.Cells[2,i])+StrtoFloat(Stringgrid3.Cells[3,i])+StrtoFloat(Stringgrid3.Cells[4,i]))/4; Stringgrid3.Cells[5,i]:=FloattostrF(Kai,ffgeneral,1,2); End; Kai:=StrtoFloat(Stringgrid3.Cells[5,1]); J:=1; For i:=1 to 3 do Begin If Kai<StrtoFloat(Stringgrid3.Cells[5,i]) then Begin Kai:=StrtoFloat(Stringgrid3.Cells[5,i]); j:=i; end; end; Stringgrid3.Cells[5,4]:=FloattostrF(Kai,ffgeneral,1,2); Label2.Caption:=Stringgrid3.Cells[0,j]+'='+Stringgrid3.Cells[5,4];
end;
procedure TForm1.SpeedButton8Click(Sender: TObject); begin lex.Visible:=true; Stringgrid9.Cells[5,0]:='1'; Stringgrid9.Cells[0,4]:='Оценка'; Stringgrid9.Cells[0,5]:='А(опт)'; {} for i:=1 to 6 do form1.Stringgrid9.Cells[5,i]:=''; form1.Stringgrid9.Cells[1,4]:=form1.ocen1.Caption; form1.Stringgrid9.Cells[2,4]:=form1.ocen2.Caption; form1.Stringgrid9.Cells[3,4]:=form1.ocen3.Caption; form1.Stringgrid9.Cells[4,4]:=form1.ocen4.Caption; for i:=1 to 4 do if form1.Stringgrid9.Cells[i,4]='1' then j:=i; Kai:=strtofloat(form1.Stringgrid9.Cells[j,1]); for i:=2 to 3 do if kai<strtofloat(form1.Stringgrid9.Cells[j,i]) then kai:=strtofloat(form1.Stringgrid9.Cells[j,i]); m:=0; for i:=1 to 3 do Begin opt:=strtofloat(form1.Stringgrid9.Cells[j,i]); if kai=opt then begin form1.Stringgrid9.Cells[5,i]:=floattostr(kai); m:=m+1; end; End; if m>1 then Begin form1.Stringgrid9.ColCount:=7; form1.Stringgrid9.Cells[6,0]:='2'; for i:=1 to 4 do if form1.Stringgrid9.Cells[i,4]='2' then j:=i; Kai:=0; for i:=2 to 3 do if (kai<strtofloat(form1.Stringgrid9.Cells[j,i])) and (form1.Stringgrid9.Cells[5,i]<>'') then kai:=strtofloat(form1.Stringgrid9.Cells[j,i]);
for i:=1 to 3 do if kai=strtofloat(form1.Stringgrid9.Cells[j,i]) then begin m:=i; form1.Stringgrid9.Cells[6,i]:=floattostr(kai); end;
form1.Label14.Caption:=form1.Stringgrid9.Cells[0,m]+'='+form1.Stringgrid9.Cells[6,m]; form1.Stringgrid9.Cells[6,5]:=form1.Stringgrid9.Cells[6,m]; end else begin m:=0; for i:=1 to 3 do begin if form1.Stringgrid9.Cells[5,i]<>'' then m:=i; end; form1.Label14.Caption:=form1.Stringgrid9.Cells[0,m]+'='+form1.Stringgrid9.Cells[5,m]; form1.Stringgrid9.Cells[5,5]:=form1.Stringgrid9.Cells[5,m]; end; {} end;
procedure TForm1.FormCreate(Sender: TObject); begin Label1.Caption:='Задача №2'; Stringgrid1.Cells[0,1]:='Аспирин (a1)'; Stringgrid1.Cells[0,2]:='Парацитомол (a2)'; Stringgrid1.Cells[0,3]:='Бисиптол (a3)'; Stringgrid1.Cells[1,1]:='0,5'; Stringgrid1.Cells[1,2]:='0,2'; Stringgrid1.Cells[1,3]:='0,1'; Stringgrid1.Cells[2,1]:='0,1'; Stringgrid1.Cells[2,2]:='0,4'; Stringgrid1.Cells[2,3]:='0,2'; Stringgrid1.Cells[3,1]:='0,3'; Stringgrid1.Cells[3,2]:='0,5'; Stringgrid1.Cells[3,3]:='0,1'; Stringgrid1.Cells[4,1]:='0,25'; Stringgrid1.Cells[4,2]:='0,8'; Stringgrid1.Cells[4,3]:='0,4'; Stringgrid1.Cells[1,0]:='Птичий грипп (k1)'; Stringgrid1.Cells[2,0]:='Свиной грипп (k2)'; Stringgrid1.Cells[3,0]:='Оспа (k3)'; Stringgrid1.Cells[4,0]:='Язва (k4)'; Zabivka; end;
end.
|