unit progrmnejron; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtDlgs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) Image1: TImage; Button1: TButton; Button2: TButton; Button3: TButton; Edit1: TEdit; Label1: TLabel; Label2: TLabel; Edit2: TEdit; Edit3: TEdit; Label3: TLabel; OpenPictureDialog1: TOpenPictureDialog; Edit4: TEdit; Label4: TLabel; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var array i [1..100] of integer; vihod: integer; Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var begin image1.Visible:=true; if openPictureDialog1.Execute Then Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName); i[3]:=floatToInt(Edit1.text); i[4]:=floatToInt (Edit2.text); vihod:=floatToInt (Edit3.text); end; procedure TForm1.Button2Click(Sender: TObject); var array receptor [1..100,1..100] of real; array w [1..nsl,1..sl] of real; array porog [1..n] of real; array s [1..i[4],1..i[3]] of integer; array resultat [1..vihod] of integer; nsl, sl,n: integer; rec1.rec2,x,y,nsli,ni,sli: integer; ogid, pot: integer; begin x:=1; y:=1; for rec1:=1 to 100 do Begin for rec2:=1 to 100 do Begin color:=image1.Canvas.Pixels [x,y]; if color=$000000 then receptor[x,y]:=1 else n[x,y]:=0; x:=x+1; end; y:=y+1; x:=1; end; nsl:=1; sl:=1; for i[1]:=1 to 100 do begin for i[2]:=1 to 100 do begin s[nsl,sl]:=w[nsl,sl]*receptor[x,y]; end; end; for sli:=1 to i[3] do begin for nsli:=1 to i[4] do Begin s[nsl,sl]:=w[nsl,sl]+s[nsl,sl]; nsl:=nsl+1; end; sl:=sl+1; end; sl:=i[3]; for i[5]:=1 to vihod do for i[6]:=1 to vihod do begin begin s[nsl,sl]:=w[nsl,sl]+s[nsl.sl]; nsl:=nsl+1; end; s[nsl,sl]:=s[nsl,sl]-porog[nsl]; if s[nsl,sl]>0 then resultat [i[5]]:=1 else resultat[i[5]]:=0; //i5 - íåéðîí âûõîä end; pot:=strToInt(edit4.text); repeat ogid:=1; for i[9]:=1 to sl do Begin for i[8]:=1 to nsl do begin w[nsl,sl]:=w[nsl,sl]+pot*(k-ogid); nsl:=nsl+1; end; sl:=sl+1; end; until resultat [1]=1; repeat ogid:=1; for i[9]:=1 to sl do Begin for i[8]:=1 to nsl do begin w[nsl,sl]:=w[nsl,sl]+pot*(k-ogid); nsl:=nsl+1; end; sl:=sl+1; end; until resultat [1]=1; end; end; end.