\chapter{Graphical Network Editor}
\label{XGUIEditor}
\index{Graphical Network Editor}
\thispagestyle{empty}
 
The graphical user interface of SNNS has a network editor built in.
With the network editor it is possible to generate a new network or to
modify an existing network in various ways. There also exist commands
to change the display style of the network.

As an introduction, operations on networks without sites will be
discussed first, since they are easier to learn and understand.
Operations that have a restricted or slightly different meaning for
networks with sites are displayed with the extension {\em (Sites!)} in
the following overview. These changes are discussed in detail in section
~\ref{EditorCommands}.

As usual with most applications of X-Windows, the mouse must be in the
window in which an input is to appear. This means that the mouse must
be in the display window for editor operations to occur. If the mouse
is moved in a display, the status indicator of the manager panel
changes each time a new raster position in the display is reached.

Different displays of a network can be seen as different views of the
same object. This means that all commands in one display may affect
objects (units, links) in the other displays. Objects are moved or
copied in a second display window in the same way as they are moved or
copied in the first display window.

\index{Editor!Operation}
The editor operations are usually invoked by a sequence of 2 to 4 keys
on the keyboard. They only take place when the last key of the command
(e.g.\ deletion of units) is pressed. We found that for some of
us, the fastest way to work with the editor was to move the mouse with
one hand and to type on the keyboard with the other hand. Keyboard
actions and mouse movement may occur at the same time, the mouse position
is only relevant when the last key of the sequence is pressed.

The keys that are sufficient to invoke a part of a command are written
in capital letters in the commands. The message line in the manager
panel indicates the completed parts of the command sequence. Invalid
keys are ignored by the editor. 

As an example, if one presses the keys {\tt U} for {\tt Units} and
{\tt C} for {\tt Copy} the status line changes as follows:

\begin{tabbing}
Units Struct>  \qquad \= Structure \qquad \= \kill
{\bf status line} \> {\bf command} \> {\bf comment}\\
{\tt >} \> {\tt Units} \> operation on units\\
{\tt Units>} \> {\tt Copy} \> copying of units\\
{\tt Units Copy>} \> \> (the sequence is not completed yet)\\
\end{tabbing}

To the left of the caret the fully expanded input sequence is
displayed. At this place also a message is displayed when a command
sequence is accepted and the corresponding operation is called. This
serves as feedback, especially if the operation takes some time. If
the operation completes quickly, only a short flicker of the text
displayed can be seen. Some error messages appear in the confirmer,
others in the message line.


\section{Editor Modes}
\label{EditorModes}
\index{Editor!Mode!Normal Mode}
\index{Editor!Mode!Unit Mode}
\index{Editor!Mode!Link Mode}

To work faster, three editor modes have been introduced which render
the first key unnecessary. In normal mode all sequences are possible,
in unit mode all sequences that deal with units (that start
with {\tt U}), and in link mode all command sequences that refer to
links (i.e.\ start with {\tt L}). 

Example (continued from above):

\begin{tabbing}
Units Struct>  \qquad \= Structure \qquad \= \kill
{\bf status line} \> {\bf command} \> {\bf comment}\\
{\tt Units Copy>} \> {\tt Quit} \> the input command may be cancelled\\
\> \> any time\\
{\tt >} \> {\tt Mode} \\
{\tt Mode>} \> {\tt Units} \> enter unit mode\\
{\tt Units>} \> {\tt Copy} \> copying \dots\\
{\tt Units Copy>} \> {\tt Quit} \> cancel again\\
{\tt Units>} \> \> {\tt Quit} leaves the current mode unchanged\\
{\tt Units>} \> {\tt Copy} \> copying \dots \\
{\tt Units Copy>} \> {\tt Return} \> return to normal mode\\
{\tt >}\\
\end{tabbing}

The mode command is useful, if several unit or link commands are given
in sequence. {\tt Return} cancels a command, like {\tt Quit} does, but
also returns to normal mode.


\section{Selection}
\label{Selection}

\subsection{Selection of Units}
\index{Selection of Units}

Units are selected by clicking on the unit with the left mouse button.
On Black\&White terminals, selected units are shown with crosses, on
color terminals in a special, user defined, color. The default is yellow. 
By pressing and holding the mouse button down and moving the mouse,
all units within a rectangular area can be selected, like in a number of
popular drawing programs. It is not significant in what direction the
rectangle is opened.

\index{Deselection of Units}
To remove a unit or group of units from a selection, one presses the
{\tt SHIFT} key on the keyboard while selecting the unit or group of
units again. This undoes the previous selection for the specified unit
or group of units. Alternatively, a single unit can be deselected with
the right mouse button. 

If the whole selection should be reset, one clicks in an empty raster
position. The number of selected units is displayed at the bottom of
the manager panel next to a stylized selection icon.

Example (setting activations of a group of units):

The activations of a group of units can be set to a specific value as
follows: Enter the value in the activation value field of the target
unit in the info panel. Select all units that should obtain the new
value. Then enter the command to set the activation ({\tt Units
Set Activation}).


\subsection{Selection of Links}
\index{Selection of Links}

Since it is often very hard to select a single link with the mouse in
a dense web of links, in this simulator all selections of links are
done with the reference to units. That is, links are selected via
their source and target units.  To select a link or a number of links,
first a unit or a group of units must be selected in the usual way with
the left mouse button (indicated by crosses through the units). Then
the mouse pointer is moved to another unit.  All links between the
selected set of units and the unit under the mouse pointer during the
last key stroke of the link command are then selected.

Example (deleting a group of links):

All links from one unit to several other units are deleted as
follows: First select all target units, then point to the source unit
with the mouse. Now the command {\tt Links Delete from Source unit}
deletes all the specified links.

As can be seen from the examples, for many operations three types of
information are relevant: first a group of selected units, second the
position of the mouse and the unit associated with this position and
third some attributes of this unit which are displayed in the info
panel. Therefore it is good practise to keep the info panel visible
all the time.

In section~\ref{ExampleDialogue} a longer example dialogue to build
the well known XOR network (see also figure~\ref{PicSimpleNet}) is
given which shows the main interaction principles.


\section{Use of the Mouse}
\label{Mouse}
\index{Use of the Mouse}
\index{Mouse}

Besides the usual use of the mouse to control the elements of a
graphical user interface (buttons, scroll bars etc.) the mouse is
heavily used in the network editor. Many important functions like
selection of units and links need the use of the mouse.
The mouse buttons of the standard 3 button mouse are used in the
following way within a graphic window:

\begin{itemize}
\item left mouse button:

Selects a unit. If the mouse is moved with the button pressed down, a
group of units in a rectangular area is selected. If the {\tt SHIFT}
key is pressed at the same time, the units are deselected. The
direction of movement with the mouse to open the rectangular area is
not significant, i.e.\ one can open the rectangle from bottom right to
top left, if convenient.

If the left mouse button is pressed together with the {\tt CONTROL}
key, a menu appears with all alternatives to complete the current
command sequence.  The menu items that display a trailing '!' indicate
that the mouse position of the last command of a command sequence is
important. The letter 'T' indicates that the target unit in the info
panel plays a role. A (\verb@~@) denotes that the command sequence is
not yet completed.

\item right mouse button:

Undo of a selection. Clicking on a selected unit with the right mouse
button only deselects this unit. Clicking on an empty raster position
resets the whole selection.

\item middle mouse button:

Selects the source unit (on pressing the button down) and the target
unit (on releasing the button) and displays them both in the info
panel. 
If there is no connection between the two units, the target unit is
displayed with its first source unit. If the button is pressed on a
source unit and released over an empty target position, the link
between the source and the current (last) target is displayed. If
there is no such link the display remains unchanged.
Conversely, if the button is pressed on an empty source position and
released on an existing target unit, the link between the current
(last) source unit and the selected target unit is displayed, if one
exists. 
This is a convenient way to inspect links.

\end{itemize}

In order to indicate the position of the mouse even with a small
raster size, there is always a sensitive area of at least 16x16 pixels
wide. 

\section{Short Command Reference}
\label{ShortCommandReference}

The following section briefly describes the commands of the network
editor. Capital letters denote the keys that must be hit to invoke the
command in a command sequence.

The following commands are possible within any command sequence

\begin{itemize}
\item {\tt Quit}: quit a command 
\item {\tt Return}: quit a command and return to normal mode (see
chapter~\ref{EditorModes}) 
\item {\tt Help}: get help information. A help window pops up (see
chapter~\ref{HelpWindows}) 
\end{itemize}

As already mentioned, some operations have a different meaning if
there exist units with sites in a network. These operations are
indicated with the suffix {\em (Sites!)}\/ and are described in more
detail in chapter~\ref{EditorCommands}. Commands that manipulate sites
are also included in this overview. They start with the first command
{\tt Sites}.

\begin{enumerate}

\begin{itemize}

\item {\tt Flags Safety}: sets/resets safety flag (a flag to prompt
the user before units or links are deleted; additional question, if
units with different subnet numbers are selected.)

\end{itemize}

\item Link Commands:
\index{Editor!Command Reference!Link Command}
\index{Link!Editor Command}

\begin{itemize}

\item {\tt Links Set}: sets all links between the selected units to
the weight displayed in the info panel (independent of sites)

\item {\tt Links Make \dots}: creates or modifies connections

\item {\tt Links Make Clique}: connects every selected unit with every
other selected unit {\em (Sites!)}\/

\item {\tt Links Make to Target unit}: creates links from all selected
source units to a single target unit (under the mouse pointer) {\em
(Sites!)}

\item {\tt Links Make from Source unit}: creates links from a single
source unit (under the mouse pointer) to all selected target units
{\em (Sites!)}

\item {\tt Links Make Double}: doubles all links between the selected
units, i.e.\ generates two links (from source to target and from
target to source) from each single link) {\em (Sites!)}

\item {\tt Links Make Invers}: changes the direction of all links
between the selected units {\em (Sites!)}

\item {\tt Links Delete Clique}: deletes all links between all
selected units {\em (Sites!)}

\item {\tt Links Delete to Target unit}: deletes all incoming links
from a selected group of units to a single target unit (under the
mouse pointer) {\em (Sites!)}

\item {\tt Links Delete from Source unit}: deletes all outgoing links
from a single source unit (under the mouse pointer) to a selected
group of units {\em (Sites!)}

\item {\tt Links Copy Input}: copies all input links leading into the
selected group of units as new input links to the target unit (under
the mouse pointer) {\em (Sites!)}

\item {\tt Links Copy Output}: copies all output links starting from
the selected group of units as new output links of the source unit
(under the mouse pointer) {\em (Sites!)}. 

\item {\tt Links Copy All}: copies all input and output links from the
selected group of units as new input or output links to the unit under
the mouse pointer {\em (Sites!)}

\item {\tt Links Copy Environment}: copies all links between the
selected units and the {\tt TARGET} unit to the actual unit, if there
exist units with the same relative distance {\em (Sites!)}

\end{itemize}

\item Site Commands:
\index{Editor!Command Reference!Site Command}
\index{Site!Editor Command}

\begin{itemize}

\item {\tt Sites Add}: add a site to all selected units

\item {\tt Sites Delete}: delete a site from all selected units

\item {\tt Sites Copy with No links}: copies the current site of the
{\tt Target} unit to all selected units. Links are not copied

\item {\tt Sites Copy with All links}: ditto, but with all links

\end{itemize}

\item Unit Commands:
\index{Editor!Command Reference!Unit Command}
\index{Unit!Editor Command}

\begin{itemize}

\item {\tt Units Freeze}: freeze all selected units 

\item {\tt Units Unfreeze}: reset freeze for all selected units

\item {\tt Units Set Name}: sets name to the name of {\tt Target}

\item {\tt Units Set io-Type}: sets I/O type to the type of {\tt Target}

\item {\tt Units Set Activation}: sets activation to the activation of
{\tt Target}

\item {\tt Units Set Initial activation}: sets initial activation to
the initial activation of {\tt Target}

\item {\tt Units Set Output}: sets output to the output of {\tt
Target}

\item {\tt Units Set Bias}: sets bias to the bias of {\tt Target}

\item {\tt Units Set Function Activation}: sets activation function.
Note: all selected units loose their default type (f-type)

\item {\tt Units Set Function Output}: sets output function
Note: all selected units loose their default type (f-type)

\item {\tt Units Set Function Ftype}: sets default type (f-type)

\item {\tt Units Insert Default}: inserts a unit with default values.
The unit has no links

\item {\tt Units Insert Target}: inserts a unit with the same values
as the {\tt Target} unit. The unit has no links

\item {\tt Units Insert Ftype}: inserts a unit of a certain default
type (f-type) which is determined in a popup window

\item {\tt Units Delete}: deletes all selected units

\item {\tt Units Move}: all selected units are moved. The mouse
determines the destination position of the {\tt TARGET} unit
(info-panel). The selected units and their position after the move are
shown as outlines.

\item {\tt Units Copy \dots}: copies all selected units to a new
position. The mouse position determines the destination position of
the {\tt TARGET} unit (info-panel). 

\item {\tt Units Copy All}: copies all selected units with {\em all\/}
links

\item {\tt Units Copy Input}: copies all selected units with their
input links

\item {\tt Units Copy Output}: copies all selected units and their
output links

\item {\tt Units Copy None}: copies all selected units, but no links

\item {\tt Units Copy Structure \dots}: copies all selected units and
the link structure between these units, i.e.\ a whole subnet is copied

\item {\tt Units Copy Structure All}: copies all se\-lected units,
all links between them, and all input and output links to and from
these units

\item {\tt Units Copy Structure Input}: copies all se\-lected units,
all links between \linebreak them, and all input links to these units

\item {\tt Units Copy Structure Output}: copies all se\-lected units,
all links be\-tween them, and all output links from these units

\item {\tt Units Copy Structure None}: copies all selected units and
all links between them

\item {\tt Units Copy Structure Back binding}: copies all selected
units and all links between them and inserts additional links from the
new to the corresponding original units {\em (Sites!)}

\item {\tt Units Copy Structure Forward binding}: copies all selected
units and all links between them and inserts additional links from the
original to the corresponding new units {\em (Sites!)}

\item {\tt Units Copy Structure Double binding}: ditto, but inserts
additional links from the original to the new units and vice versa
{\em (Sites!)}

\end{itemize}

\item Mode Commands:
\index{Editor!Command Reference!Mode Command}
\begin{itemize}

\item {\tt Mode Units}: unit mode, shortens command sequence if one
wants to work with unit commands only. All subsequences after the {\tt
Units} command are valid then

\item {\tt Mode Links}:  analogous to {\tt Mode Units}, but for link
commands 

\end{itemize}

\item Graphics Commands:
\index{Editor!Command Reference!Graphics Command}
\index{Graphic!Editor Command}

\begin{itemize}

\item {\tt Graphics All}: redraws the local window 

\item {\tt Graphics Complete}: redraws all windows 

\item {\tt Graphics Direction}: draws all links from and to a unit
with arrows in the local window

\item {\tt Graphics Links}: redraws all links in the local window

\item {\tt Graphics Move}: moves the origin of the local window such
that the {\tt Target} unit is displayed at the position of the mouse
pointer

\item {\tt Graphics Origin}: moves the origin of the local window to
the position indicated

\item {\tt Graphics Grid}: displays a graphic grid at the raster
positions in the local window

\item {\tt Graphics Units}: redraws all units in the local window

\end{itemize}

\end{enumerate}



\section{Editor Commands}
\label{EditorCommands}
\index{Editor!Command}

We now describe the editor commands in more detail. The description
has the following form that is shown in two examples:

{\bf Links Make Clique} (selection LINK : site-popup)

\index{Editor!Command Sequence}
First comes the command sequence ({\bf Links Make Clique}) which is
invoked by pressing the keys L, M, and C in this order.  The items in
parentheses indicate that the command depends on the objects of a
previous selection of a group of units with the mouse (selection),
that it depends on the value of the LINK field in the info panel, and
that a site-popup appears if there are sites defined in the network.
The options are given in their temporal order, the colon ':' stands
for the moment when the last character of the command sequence is
pressed, i.e.\ the selection and the input of the value must precede
the last key of the command sequence.

{\bf Units Set Activation} (selection TARGET :)

The command sequence {\bf Units Set Activation} is invoked by pressing
the keys U, S, A, in that order. The items in parentheses indicate
that the command depends on the selection of a group of units with the
mouse (selection) which it depends on the value of the TARGET field
and that these two things must be done before the last key of the
command sequence is pressed.

The following table displays the meaning of the symbols in parenthesis:


\begin{center}
\begin{tabular}{|ll|}
\hline
selection       & all selected units\\
:               & now the last key of a command sequence is pressed\\
$[$unit$]$      & the raster cursor is placed on a unit\\
$[$empty$]$     & the raster cursor is placed on an empty position\\
default         & the default values are used\\
TARGET          & the TARGET unit field in the info panel must be set\\
LINK            & the LINK field in the info panel must be set\\
site-links      & only links to the current site in the info panel
play a role\\
site            & the current site in the info panel must be set\\
popup           & a popup menu appears to ask for a value\\
site-popup      & if there are sites defined in the network, a popup\\
                & appears to choose the site for the operation\\
dest?           & a raster position for a destination must be clicked\\
                & with the mouse (e.g.\ in {\tt Units Move})\\
\hline
\end{tabular}
\end{center}

In the case of a {\tt site-popup} a site for the operation can be
chosen from this popup window. However, if one clicks the {\tt DONE}
button immediately afterwards, only the direct input without sites is
chosen. In the following description, this direct input should be
regarded as a special case of a site.

All newly generated units are assigned to all active layers in
the display in which the command for their creation was issued.

The following keys are always possible within a command sequence:

\begin{itemize}
\item {\tt Quit}: quit a command
\item {\tt Return}: quit and return to normal mode
\item {\tt Help}: get help information to the commands
\end{itemize}

A detailed description of the commands follows:

\begin{enumerate}

\item {\bf Flags Safety} (:)
\index{Editor!Command!Flags Safety}

\index{Safety-Flag}
If the {\tt SAFETY}-Flag is set, then with every operation which deletes
units, sites or links ({\tt Units Delete \dots} or {\tt Links Delete
\dots}) a confirmer asks if the units, sites or links should really be
deleted. If the flag is set, this is shown in the manager panel with a {\tt
safe} after the little flag icon. If the flag is not set, units, sites
or links are deleted immediately. There is no undo operation for these
deletions.


\item {\bf Links Set} (selection LINK :)
\index{Editor!Command!Links Set}

All link weights between the selected units are set to the value of
the LINK field in the info panel.


\item {\bf Links Make Clique} (selection LINK : site-popup)
\index{Editor!Command!Links Make Clique}

A full connection between all selected units is generated. Since
links may be deleted selectively afterwards, this function is useful
in many cases where many links in both directions are to be generated.

If a site is selected, a complete connection is only possible if
all units have a site with the same name.


\item {\bf Links Make from Source unit} (selection $[$unit$]$ : site-popup)
\index{Editor!Command!Links Make from Source unit}

{\bf Links Make to Target unit} (selection $[$unit$]$ : site-popup)
\index{Editor!Command!Links Make to Target unit}

Both operations connect all selected units with a single unit under
the mouse pointer. In the first case, this unit is the source, in the
second, it is the target. All links get the value of the LINK field in
the info panel.

If sites are used, only links to the selected site are generated.


\item {\bf Links Make Double} (selection :)
\index{Editor!Command!Links Make Double}

\index{Bidirectional Link}
All unidirectional links become double (bidirectional) links. That is,
new links in the opposite direction are generated. Immediately after
creation the new links possess the same weights as the original links.
However, the two links do not share the weight, i.e.\ subsequent
training usually changes the similarity.

Connections impinging on a site only become bidirectional, if the
original source units has a site with the same name.


\item {\bf Links Make Inverse}  (selection :)
\index{Editor!Command!Links Make Inverse}

All unidirectional links between all selected units change their
direction. They keep their original value.

Connections leading to a site are only reversed, if the original source
unit has a site of the same name. Otherwise they remain as they are.


\item {\bf Links Delete Clique} (selection : site-popup)
\index{Editor!Command!Links Delete}

{\bf Links Delete from Source unit} (selection $[$unit$]$ : site-popup)

{\bf Links Delete to Target unit} (selection $[$unit$]$ : site-popup)

These three operations are the reverse of {\tt Links Make} in that they
delete the connections. If the safety flag is set (the word {\tt safe}
appears behind the flag symbol in the manager panel), a confirmer
window forces the user to confirm the deletion.


\item {\bf Links Copy Input} (selection $[$unit$]$ :)
\index{Editor!Command!Links Copy Input}

{\bf Links Copy Output} (selection $[$unit$]$ :)
\index{Editor!Command!Links Copy Output}

{\bf Links Copy All} (selection $[$unit$]$ :)
\index{Editor!Command!Links Copy All}

{\tt Links Copy Input} copies all input links of the selected group of
units to the single unit under the mouse pointer. If sites are used,
incoming links are only copied if a site with the same name as in the
original units exists.

{\tt Links Copy Output} copies all output links of the selected group
of units to the single unit under the mouse pointer.

{\tt Links Copy All} Does both of the two operations above


\item{\bf Links Copy Environment} (selection TARGET site-links $[$unit$]$ :)
\index{Editor!Command!Links Copy Environment}

This is a rather complex operation: {\tt Links Copy Environment} tries
to duplicate the links between all selected units and the current {\tt
TARGET} unit in the info panel at the place of the unit under the
mouse pointer. The relative position of the selected units to the {\tt
TARGET} unit plays an important role: if a unit exists that has the
same relative position to the unit under the mouse cursor as the {\tt
TARGET} unit has to one of the selected units, then a link between
this unit and the unit under the mouse pointer is created. 

The result of this operation is a copy of the structure of links
between the selected units and the TARGET unit at the place of the
unit under the mouse pointer. That is, one obtains the same
topological structure at the unit under the mouse pointer. 

This is shown in figure~\ref{PicEnvironment}. In this figure the
structure of the {\tt TARGET} unit and the four {\tt Env} units is
copied to the unit {\tt UnderMousePtr}. However, only two units
are in the same relative position to the {\tt UnderMousePtr} as
the {\tt Env} units are to the {\tt Target} unit, namely {\tt
corrEnv3} corresponding to {\tt Env3} and {\tt corrEnv4} corresponding
to {\tt Env4}. So only those two links from the units {\tt corrEnv3}
to {\tt UnderMousePtr} and from {\tt corrEnv4} to {\tt
UnderMousePtr} are generated.

\begin{figure}[htbp]
\begin{center}
  \begin{minipage}{\textwidth}
    \screendump{0.45}{xgui_figs/PicEnvironment.ps}
  \end{minipage}
\caption{Example to {\tt Links Copy Environment}}
\label{PicEnvironment}
\end{center}
\end{figure}


\item {\bf Sites Add} (selection : Popup)
\index{Editor!Command!Sites Add}

A site which is chosen in a popup window is added to all selected
units. The command has no effect for all units which already have a
site of this name (because the names of all sites of a unit must be different)


\item {\bf Sites Delete} (selection : Popup)
\index{Editor!Command!Sites Delete}

The site that is chosen in the popup window is deleted at all selected
units that possess a site of this name. Also all links to this site
are deleted.
If the safety flag is set (in the manager panel the word {\tt safe} is
displayed behind the flag icon at the bottom), then a confirmer window
forces the user to confirm the deletion first.


\item {\bf Sites Copy with No links} (selection SITE :)
\index{Editor!Command!Sites Copy with No links}

{\bf Sites Copy with All links} (selection SITE :)
\index{Editor!Command!Sites Copy with All links}

The current site of the {\tt Target} unit is added to all selected
units which do not have this site yet. Links are copied together with
the site only with the command {\tt Site Copy with All links}. If a
unit already has a site of that name, only the links are copied.
 
\bigskip
\item {\bf Units Freeze} (selection :)
\index{Editor!Command!Units Freeze}

{\bf Units Unfreeze} (selection :)
\index{Editor!Command!Units Unfreeze}

These commands are used to freeze or unfreeze all selected units.
Freezing means, that the unit does not get updated anymore, and
therefore keeps its activation and output. Upon loading input units
change only their activation, while keeping their output. For output
units, this depends upon the setting of the pattern load mode. In the
load mode {\tt Output} only the output is set. Therefore, if frozen
output units are to keep their output, another mode ({\tt None} or
{\tt Activation}) has to be selected. A learning cycle, on the other
hand, executes as if no units have been frozen.

\bigskip
\item {\bf Units Set Name}  (selection TARGET :)
\index{Editor!Command!Units Set Name}
\index{Unit!Set!Name}

{\bf Units Set Initial activation} (selection TARGET :)
\index{Editor!Command!Units Set Initial activation}
\index{Unit!Set!Initial activation}

{\bf Units Set Output} (selection TARGET :)
\index{Editor!Command!Units Set Output}
\index{Unit!Set!Output}

{\bf Units Set Bias}  (selection TARGET :)
\index{Editor!Command!Units Set Bias}
\index{Unit!Set!Bias}

{\bf Units Set io-Type} (selection : Popup)
\index{Editor!Command!Units Set io-Type}
\index{Unit!Set!io-Type}

{\bf Units Set Function Activation} (selection : Popup)
\index{Editor!Command!Units Set Function Activation}
\index{Unit!Set!Function Activation}

{\bf Units Set Function Output} (selection : Popup)
\index{Editor!Command!Units Set Function Output}
\index{Unit!Set!Function Output}

{\bf Units Set Function F-type} (selection : Popup)
\index{Editor!Command!Units Set Function F-type}
\index{Unit!Set!Function F-type}

Sets the specific attribute of all selected units to a common value.
Types and functions are defined by a popup window. The operations can
be aborted by immediately clicking the {\tt DONE} button in the popup
without selecting an element of the list.

The list item {\tt special\_X} for the command {\tt Units Set io-Type}
makes all selected units special while keeping their topologic type,
.i.e.: a selected hidden unit becomes a special-hidden, a selected
output becomes a special-output unit. The list item {\tt non-special\_X}
performs the reverse procedure.

The remaining attributes are read from the corresponding fields of the
{\tt Target} unit in the info panel. The user can of course change the
values there (without clicking the {\tt SET} button) and then execute
{\tt Units Set \dots}. A different approach would be to make a unit
target unit (click on it with the middle mouse button) which already
has the desired values. This procedure is very convenient, but works
only if appropriate units already exist. A good idea might be to
create a couple of such model units first, to be able to quickly set
different attribute sets in the info panel.


\bigskip
\item {\bf Units Insert Default} ($[$empty$]$ default :)
\index{Editor!Command!Units Insert Default}

{\bf Units Insert Target} ($[$empty$]$ TARGET :)
\index{Editor!Command!Units Insert Target}

{\bf Units Insert F-type} ($[$empty$]$ : popup)
\index{Editor!Command!Units Insert F-type}

This command is used to insert a unit with the IO-type {\tt hidden}.
It has no connections and its attributes are set according to the
default values and the {\tt Target} unit. With the command {\tt Units
Insert Default}, the unit gets no F-type and no sites. With {\tt Units
Insert F-type} an F-type and sites have to be selected in a popup
window. {\tt Units Insert Target} creates a copy of the target unit in
the info panel. If sites/connections are to be copied as well, the
command {\tt Units Copy All} has to be used instead.
   

\bigskip
\item {\bf Units Delete} (selection :)
\index{Editor!Command!Units Delete}

All selected units are deleted. If the safety flag is set ({\tt safe}
appears in the manager panel behind the flag symbol) the deletion has
to be confirmed with the confirmer.


\bigskip
\item {\bf Units Move} (selection TARGET : dest?)
\index{Editor!Command!Units Move}

All selected units are moved. The {\tt Target} unit is moved to the
position at which the mouse button is clicked. It is therefore
recommended to make one of the units to be moved target unit and
position the mouse cursor over the target unit before beginning the
move. Otherwise all moving units will have an offset from the cursor.
This new position must not be occupied by an unselected unit, because a
position conflict will result otherwise.  All other units move in the
same way relative to that position. The command is ignored, if:

\begin{enumerate}
\item the target position is occupied by an unselected unit, or
\item units would be moved to grid positions already taken by
unselected units.
\end{enumerate}

It might happen that units are moved beyond the right or lower border
of the display. These units remain selected, as long as not all units
are deselected (click the right mouse button to an empty grid
position). 

As long as no target is selected, the editor reacts only to {\tt
Return}, {\tt Quit} or {\tt Help}. Positioning is eased by displaying
the unit outlines during the move. The user may also switch to another
display. If this display has a different subnet number, the subnet
number of the units changes accordingly. Depending upon layer and
subnet parameters, it can happen that the moved units are not visible
at the target.

If networks are generated externally, it might happen that several
units lie on the same grid position. Upon selection of this position,
only the unit with the smallest number is selected. With ``Units
Move'' the user can thereby clarify the situation.


\bigskip
\item {\bf Units Copy \dots} (selection : dest?)

{\bf Units Copy All}
\index{Editor!Command!Units Copy All}

{\bf Units Copy Input}
\index{Editor!Command!Units Copy Input}

{\bf Units Copy Output}
\index{Editor!Command!Units Copy Output}

{\bf Units Copy None}
\index{Editor!Command!Units Copy None}

This command is similar to {\tt Units Move}. {\tt Copy} creates copies
of the selected units at the positions that would be assigned by {\tt
Move}. Another difference is that if units are moved to grid positions
of selected units the command is ignored. The units created have the
same attributes as their originals, but different numbers.  Since unit
types are copied as well the new units also inherit the activation
function, output function and sites. There are four options regarding
the copying of the links. If no links are copied, the new unit has no
connections. If, for example, the input links are copied, the new
units have the same predecessors as their originals.


\bigskip
\item {\bf Units Copy Structure \dots} (selection : dest?)

{\bf Units Copy Structure All}    

{\bf Units Copy Structure Input}  

{\bf Units Copy Structure Output}

{\bf Units Copy Structure None}   

{\bf Units Copy Structure \dots binding} (selection : dest? site-popup)

{\bf Units Copy Structure Back binding}

{\bf Units Copy Structure Forward binding}

{\bf Units Copy Structure Double binding}
\index{Editor!Command!Units Copy Structure}

These commands are refinements of the general {\tt Copy} command.
Here, all links between the selected units are always copied as well.
This means that the substructure is copied form the originals to the
new units. On a copy without {\tt Structure} these links would go
unnoticed. There are also options, which additional links are to be
copied. If only the substructure is to be copied, the command {\tt
Units Copy Structure None} is used.

\begin{figure}[htbp]
\begin{center}
  \begin{minipage}{\textwidth}
    \screendump{0.5}{xgui_figs/PicForwardBinding.ps}
  \end{minipage}
\caption{An Example for {\tt Units Copy Structure with Forward binding}}
\label{PicForwardBinding}
\end{center}
\end{figure}

The options with {\tt binding} present a special feature. There, links
between original and copied units are inserted automatically, in
addition to the copied structure links.  {\tt Back}, {\tt Forward} and
{\tt Double} specify thereby the direction of the links, where
``back'' means the direction towards the original unit. An example is
shown in picture~\ref{PicForwardBinding}. If sites are used, the
connections to the originals are assigned to the site selected in the
popup. If not all originals have a site with that name, not all new
units are linked to their predecessors.

With these various copy options, large, complicated nets with the
same or similar substructures can be created very easily.


\bigskip
\item {\bf Mode Units} (:)
\index{Editor!Command!Mode Units}

{\bf Mode Links} (:)
\index{Editor!Command!Mode Links}

Switches to the mode {\bf Units} or {\bf Links}. All sequences of the
normal modes are available. The keys {\tt U} and {\tt L} need not be
pressed anymore. This shortens all sequences by one key.


\bigskip
\item {\bf Units \dots Return} (:)
\index{Editor!Command!Units Return}

{\bf Links \dots Return} (:)
\index{Editor!Command!Links Return}

Returns to normal mode after executing {\tt Mode Units}.


\bigskip
\item {\bf Graphics All}  (:)
\index{Editor!Command!Graphics All}

{\bf Graphics Complete}  (:)
\index{Editor!Command!Graphics Complete}

{\bf Graphics Units}  (:)
\index{Editor!Command!Graphics Units}

{\bf Graphics Links}  (:)
\index{Editor!Command!Graphics Links}

These commands initiate redrawing of the whole net, or parts of the
net.  With the exception of {\tt Graphics Complete}, all commands
affect only the current display. They are especially useful after
links have been deleted.


\bigskip
\item {\bf Graphic Direction} ($[$unit$]$ : )
\index{Editor!Command!Graphic Direction}

This command assigns arrowheads to all links leading to/from the unit
selected by the mouse. This is done independently from the setup
values. XGUI, however, does not recall that links have been drawn.
This means that, after moving a unit, these links remain in the
window, if the display of links is switched off in the SETUP.


\bigskip
\item {\bf Graphics Move} (TARGET $[$empty$]$/$[$unit$]$ :)
\index{Editor!Command!Graphics Move}

The origin of the window (upper left corner) is moved in a way that
the {\tt target} unit in the info panel becomes visible at the position
specified by the mouse.


\bigskip
\item {\bf Graphics Origin} ($[$empty$]$/$[$unit$]$ :)
\index{Editor!Command!Graphics Origin}

The position specified by the mouse becomes new origin of the display
(upper left corner).


\bigskip
\item {\bf Graphics Grid} (:)
\index{Editor!Command!Graphics Grid}

This command draws a point at each grid position. The grid, however,
is not refreshed, therefore one might have to redo the command from
time to time.

\end{enumerate}


\section{Example Dialogue}
\label{ExampleDialogue}
\index{Example!Editor Dialogue}
\index{Editor!Dialogue Example}

A short example dialogue for the construction of an XOR network might
clarify the use of the editor. First the four units are created. In
the info panel the target name ``input'' and the {\tt Target bias}
``$0$'' is entered.

\begin{tabbing}
Units Struct>  \qquad \= to Destination unit \qquad \= \kill
{\bf Status Display} \> {\bf Command} \> {\bf Remark}\\
{\tt >} \> {\tt Mode Units} \> switch on mode units\\
{\tt Units>} \> \> set mouse to position (3,5)\\
{\tt Units>} \> {\tt Insert Target} \> insert unit 1 with the attributes\\
\> \> of the {\tt Target} unit here.\\
\>  \> repeat for position (5,5).\\
{\tt Units>} \> \> name = ``hidden'', bias = $-2.88$\\
{\tt Units>} \> {\tt Insert Target} \>  position (3,3); insert unit 3\\
{\tt Units>} \> \> name = ``output'', bias = $-3.41$\\
{\tt Units>} \> {\tt Insert Target} \> position (3,1); insert unit 4\\
{\tt Units>} \> {\tt Return} \> return to normal mode\\
{\tt >}      \> {\tt Mode Links} \> switch on mode links\\
{\tt Links>} \> \> select both input units\\
            \> \>  and set mouse to third unit\\
\> \> (``hidden'')\\
{\tt Links>} \> \> specify weight ``$6.97$''\\
{\tt Links>} \> {\tt Make to Target} \> create links\\
{\tt Links>} \> \> set mouse to unit 4 (``output'');\\
\> \>  specify weight ``$-5.24$''\\
{\tt Links>} \> {\tt Make to Target} \> create links\\
{\tt Links>} \> \> deselect all units and\\
\> \>  select unit 3\\
{\tt Links>} \> \> set mouse to unit 4 and\\
\> \> specify ``$11.71$'' as weight.\\
{\tt Links>} \> {\tt Make to Target} \> create links\\
\end{tabbing}

Now the topology is defined. The only actions remaining are to set the IO
types and the four patterns. To set the IO types, one can either use
the command {\tt Units Set Default io-type}, which sets the types
according to the topological position of the units, or repeatedly use
the command {\tt Units Set io-Type}. The second option can be aborted
by pressing the {\tt Done} button in the popup window before making a
selection. 

