with
  DC_Keyb,
  DC_Scrn;

package body ANN is
---------------------------------------------------------------------------
---------------------------------------------------------------------------

procedure Initialize ( ANN: in out ANN_Type) is
---------------------------------------------------------------------------
begin
  for index in ANN'range loop
    Neuron.Initialize ( Neuron => ANN ( index ) );
  end loop;
end Initialize;

procedure Move  ( ANN: in ANN_Type ) is
---------------------------------------------------------------------------
begin
  null;
end Move;

procedure Sense ( ANN: in out ANN_Type ) is
---------------------------------------------------------------------------
begin
  for index in ANN'range loop
    ANN ( index ).Axon_Output :=
      DC_Keyb.Ask ( "Neuron" & integer'image ( index ) & " axon_output ",
	Default => ANN ( index ).Axon_Output );
  end loop;
end Sense;

procedure Show_State(ANN: in ANN_Type) is
---------------------------------------------------------------------------
begin
  for index in ANN'range loop
    DC_Scrn.PutL ( "Neuron" & integer'image ( index ) );
    Neuron.Show_State ( Neuron => ANN ( index ) );
  end loop;
end Show_State;

procedure Think ( ANN: in out ANN_Type ) is
---------------------------------------------------------------------------
begin
  for index in ANN'range loop
    Neuron.Think ( ANN ( index ) );
  end loop;
  for index1 in ANN'range loop
    for index2 in ANN ( index1 ).Synapse_Input'range loop
      ANN ( index1 ).Synapse_Input ( index2 )
	:= ANN ( index2 ).Axon_Output;
    end loop;
  end loop;
end Think;

------------------------------------------------------------------------------------------------------------------------------------------------------
end ANN;
