next up previous contents index
Next: Unit Definition Functions Up: Unit Functions Previous: Unit Functions

Unit Enquiry and Manipulation Functions

  int krui_getNoOfUnits()
determines the number of units in the neural net. int krui_getNoOfSpecialUnits()
determines the number of special units in the neural net. int krui_getFirstUnit()
Many interface functions refer to a current unit or site. krui_getFirstUnit() selects the (chronological) first unit of the network and makes it current. If this unit has sites, the chronological first site becomes current. The function returns 0 if no units are defined. int krui_getNextUnit()
selects the next unit in the net, as well as its first site (if present); returns 0 if no more units exist. krui_err krui_setCurrentUnit( int UnitNo )
makes the unit with number UnitNo current unit; returns an error code if no unit with the specified number exists. int krui_getCurrentUnit()
determines the number of the current unit (0 if not defined) char *krui_getUnitName( int UnitNo )
krui_err krui_setUnitName( int UnitNo, char *unit_name )
determines/sets the name of the unit. krui_setUnitName returns NULL if no unit with the specified number exists. int krui_searchUnitName( char *unit_name )
searches for a unit with the given name. Returns the first unit number if a unit with the given name was found, 0 otherwise. int krui_searchNextUnitName( void )
searches for the next unit with the given name. Returns the next unit number if a unit with the given name was found, 0 otherwise. krui_searchUnitName( unit_name ) has to be called before at least once, to confirm the unit name. Returns error code if no units are defined. char *krui_getUnitOutFuncName( int UnitNo )
char *krui_getUnitActFuncName( int UnitNo )
determines the output function resp. activation function of the unit.

krui_err krui_setUnitOutFunc( int UnitNo, char *unitOutFuncName )
krui_err krui_setUnitActFunc( int UnitNo, char *unitActFuncName )
sets the output function resp. activation function of the unit. Returns an error code if the function name is unknown, i.e. if the name does not appear in the function table as output or activation function. The f-type of the unit is deleted. char *krui_getUnitFTypeName( int UnitNo )
yields the f-type of the unit; returns NULL if the unit has no prototype.

FlintType krui_getUnitActivation( int UnitNo )
krui_err krui_setUnitActivation( int UnitNo,
FlintTypeParam unit_activation )
returns/sets the activation of the unit.

FlintType krui_getUnitInitialActivation( int UnitNo )
void krui_setUnitInitialActivation( int UnitNo,
FlintType unit_i_activation )
returns/sets the initial activation of the unit, i.e. the activation after loading the net. See also krui_resetNet(). FlintType krui_getUnitOutput( int UnitNo )
krui_err krui_setUnitOutput( int unit_no, FlintTypeParam unit_output )
returns/sets the output value of the unit. FlintType krui_getUnitBias( int UnitNo )
void krui_setUnitBias( int UnitNo, FlintType unit_bias )
returns/sets the bias (threshold) of the unit. int krui_getUnitSubnetNo( int UnitNo )
void krui_setUnitSubnetNo( int UnitNo, int subnet_no)
returns/sets the subnet number of the unit (the range of subnet numbers is -32736 to +32735).

unsigned short krui_getUnitLayerNo( int UnitNo )
void krui_setUnitLayerNo( int UnitNo,int layer_no)
returns/sets the layer number (16 Bit integer).

void krui_getUnitPosition( int UnitNo, struct PosType *position )
void krui_setUnitPosition( int UnitNo, struct PosType *position )
determines/sets the (graphical) position of the unit. See also include file glob_typ.h for the definition of PosType.

int krui_getUnitNoAtPosition( struct PosType *position, int subnet_no )
yields the unit number of a unit with the given position and subnet number; returns 0 if no such unit exists.

int krui_getUnitNoNearPosition( struct PosType *position,
int subnet_no, int range,
int gridWidth )
yields a unit in the surrounding (defined by range) of the given position with the given graphic resolution gridWidth; otherwise like krui_getUnitNoAtPosition(...).

krui_err krui_getUnitCenters( int unit_no, int center_no,
struct PositionVector * *unit_center )
returns the 3D-transformation center of the specified unit and center number. Function has no effect on the current unit. Returns error number if unit or center number is invalid or if the SNNS-kernel isn't a 3D-kernel.

krui_err krui_setUnitCenters( int unit_no, int center_no,
struct PositionVector *unit_center )
sets the 3D-transformation center and center number of the specified unit. Function has no effect on the current unit. Returns error number if unit or center number is invalid or if the SNNS-kernel isn't a 3D-kernel.

krui_err krui_getXYTransTable( dummy )
returns the base address of the XY-translation table. Returns error code if the SNNS-kernel isn't a 3D-kernel. int krui_getUnitTType( int UnitNo )
krui_err krui_setUnitTType( int UnitNo, int UnitTType )
gets/sets the IO-typegif (i.e. input, output, hidden) of the unit. See include file glob_typ.h for IO-type constants. Set yields an error code if the IO-type is invalid. krui_err krui_freezeUnit( int unit_no )
freezes the output and the activation value of the unit, i.e. these values are not updated anymore. krui_err krui_unfreezeUnit( int unit_no )
switches the computation of output and activation values on again. bool krui_isUnitFrozen( int unit_no )
yields TRUE if the unit is frozen, else FALSE. int krui_getUnitInputType( UnitNo )
yields the input type. There are three kinds of input types:
NO_INPUTS: the unit doesn't have inputs (yet).
SITES: the unit has one or more sites (and therefore no direct inputs).
DIRECT_LINKS: the unit has direct inputs (and no sites).
See also file glob_typ.h. FlintType krui_getUnitValueA(int UnitNo)
void krui_setUnitValueA(int UnitNo, FlintTypeParam unit_valueA)
returns and sets the Value A field of the unit structure.


next up previous contents index
Next: Unit Definition Functions Up: Unit Functions Previous: Unit Functions



Niels Mache
Wed May 17 11:23:58 MET DST 1995