Einzelnen Beitrag anzeigen

Benutzerbild von braingrenade
braingrenade

Registriert seit: 30. Okt 2002
Ort: Neufra
274 Beiträge
 
Delphi 6 Personal
 
#8

Re: Thread in die unendlichkeit...

  Alt 3. Sep 2003, 13:17
so , ich poste den execute code mal so :

Delphi-Quellcode:
procedure Tsynapse.update;
var in1,out1,in2,out2 : integer;
begin
in1 := input1^;
in2 := input2^;
if in1 > 0 then out1 := round( in1 * (100 / conductivity))
else out1:=0 ;
if in2 > 0 then out2 := round( in2 * (100 / conductivity))
else out2:=0 ;
if (in2 > 0) and (in1 > 0) then conductivity := conductivity+1;
if (conductivity > 4) and (in2 = 0) and (in1 = 0) then conductivity := conductivity-0.1;
output1^ := output1^ + out1;
output2^ := output2^ + out2;
end;

procedure Tsynapse.execute;
begin
while not Terminated do
update;
end;

procedure Tneuron.update;
begin
if input >= inputlimit then
begin
output := input;
send := true;
input:=0;
end else
begin
output := 0;
input:=0;
end;
if send = true then
begin
sendtimer := sendtimer +1;
if sendtimer = 5 then
 begin
 send := false;
 sendtimer := 0;
 end;
end else output := 0;
end;

procedure Tneuron.execute;
begin
while not Terminated do
update;
end;
Let the sun beat down upon my face
Stars fill my dream
I am a traveller of both time and space
To be where I have been ________________ Such A Surge
  Mit Zitat antworten Zitat