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;