\chapter{Kernel File Interface}
\label{KernelCompilerInterface}
\thispagestyle{empty}

\section{The ASCII Network File Format}
\index{Network File!Format}

%\subsection{Parts of the Network Display}

The ASCII representation of a network consists of the
following parts:
\begin{itemize}
\item a header, which contains information about the net
\item the definition of the teaching function
\item the definition of the sites
\item the definition of cell types
\item the definition of the default values for cells
\item the enumeration of the cells with all their characteristics
\item the list of connections
\item a list of subnet numbers
\item a list of layer numbers
\end{itemize}

All parts, except the header and the enumeration of the cells, may be
omitted. Each part may also be empty. It then consists only of the
part title, the header line and the boarder marks (e.g.:
\verb&----|---|------&).

Entries in the {\it site definition section\/} do not contain any
empty columns. The only empty column in the {\it type definition
section\/} may be the {\it sites\/} column, in which case the cells
of this type do not have sites. 

Entries in the {\it unit definition section\/} have at least the
columns {\it no.\/} (cell number) and {\it position\/} filled. The
entries (rows) are sorted by increasing cell number. If column {\it
typeName} is filled, the columns {\it act func\/}, {\it out func\/},
and {\it sites\/} remain empty.

Entries in the {\it connection definition section\/} have all columns
filled. The respective cell does not have a site, if the column {\it
site\/} is empty. The entries are sorted by increasing number of the
target cell (column {\it target\/}). Each entry may have multiple
entries in the column {\it sources\/}. In this case, the entries
(number of the source cell and the connection strength) are separated
by a comma and a blank, or by a comma and a newline (see example in
the Appendix~\ref{AppendixExamples}).

The file may contain comment lines. Each line beginning with {\bf
\#} is skipped by the SNNS-kernel.


\section{Form of the Network File Entries}
\index{Network File!Entries Format}

Columns are separated by the string  {\verb*& | &}. A row never
exceeds 250 characters. 

Strings may have arbitrary length. The compiler determines the length
of each row containing strings (maximum string length + 2). Within the
columns, the strings are stored left adjusted. Strings may not contain
blanks, but all special characters except { \verb&|&}. The first
character of a string has to be a letter.

Integers may have an arbitrary number of digits. Cell numbers are
always positive and not zero. Position coordinates may be positive or
negative. The compiler determines the length of each row containing
integers (maximum digit number + 2). Within the columns, the numbers
are stored right adjusted.

Floats are always stored in fixed length with the format {\tt
\verb&Vx.yyyyy&}, where {\bf V} is the sign ($+$, - or blank), {\bf x}
is 0 or 1 and {\bf y} is the rational part (5 digits behind the
decimal point).

Rows containing floats are therefore always 10 characters long (8 +
1 blank on each side).

If a row contains several sites in the {\it type\/} or {\it unit definition
section\/}, they are written below each other. They are separated in
the following way: Directly after the first site follows a comma and a
newline (\verb&\n&). The next line starts with an arbitrary number of
blanks or tabs in front of the next site.
 
The source of a connection is described by a pair, the cell number and
the strength of the connection. It always has the format {\tt
\verb&nnn:Vx.yyyyy&} with the following meaning:

\begin{itemize}
\item {\verb&nnn&} Number of the source
\item {\verb&Vx.yyyyy&} Strength of the connection as a float
value (format as described above)
\end{itemize}

The compiler determines the width of the column {\bf nnn} by the
highest cell number present. The cell numbers are written into the
column right adjusted (according to the rules for integers). The
column {\verb&Vx.yyyyy&} has fixed width. Several source pairs in
an entry to the {\it connection definition section\/} are separated by
a comma and a blank. If the list of source pairs exceeds the length
of one line, the line has to be parted after the following rule:

\begin{itemize}
\item Separation is always between pairs, never within them.
\item The comma between pairs is always directly behind the last pair,
i.e. remains in the old line.
\item After a newline (\verb&\n&) an arbitrary number of blanks or
tabs may precede the next pair.
\end{itemize}








