Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members  

NetLoader Class Reference

#include <amygdala/netloader.h>

List of all members.

Public Methods

 NetLoader (Network *_net)
 ~NetLoader ()
void RegisterNeuronClass (NeuronFactoryBase *factory)
void LoadXML (const char *filename)
void SaveXML (string filename)
Layer * BuildLayer (int size, int startNrnId, LayerConstants layerConst, string neuronType)
void SAXStartElement1 (const char *name, const char **attrs)
void SAXEndElement1 (const char *name)
void SAXStartElement2 (const char *name, const char **attrs)
void SAXEndElement2 (const char *name)
void SAXError ()

Protected Methods

void WriteSynapses (FILE *netFile, Neuron *preNrn)
void SaveLayers (FILE *netFile)
string LayerTypeStr (LayerType lType)
void SAXPass (const char *filename, int pass)
void ParseLayerConstants (LayerConstants *layerConst, char **name, const char **attrs)

Protected Attributes

hash_map< const char *, NeuronFactoryBase *,
hash< const char * >, eqstr > 
registry
Network * net
Layer * currLayer
AmIdInt currNeuron
unsigned int saxErrors


Detailed Description

load and save Network instances. This class can be used with MP, but each NetLoader instance is attached to the Network instance it is managing. If you want to use this class in an SMP environmant with 20 Network instances you will need 20 associated NetLoader instances
Author:
Rüdiger Koch , Matt Grover
See also:
Node


Member Function Documentation

Layer* NetLoader::BuildLayer (  int    size,
int    startNrnId,
LayerConstants    layerConst,
string    neuronType
) 
 

Build a Layer that is composed of one particular Neuron type

string NetLoader::LayerTypeStr (  LayerType    lType )  [protected]
 

Returns:
a string identifying the layer given by IType

void NetLoader::LoadXML (  const char *    filename ) 
 

Load a Network from a file

Parameters:
filename 

void NetLoader::RegisterNeuronClass (  NeuronFactoryBase *    factory ) 
 

Register a new NeuronFactory

void NetLoader::SaveLayers (  FILE *    netFile )  [protected]
 

Put all layers into the DOM tree

void NetLoader::SaveXML (  string    filename ) 
 

save a single Network Instance to a file.

Parameters:
filename  the file to save the Network

void NetLoader::SAXEndElement1 (  const char *    name ) 
 

a SAX callback - don't use this function

void NetLoader::SAXEndElement2 (  const char *    name ) 
 

a SAX callback - don't use this function

void NetLoader::SAXError (    ) 
 

handles all SAX errors - don't use this function

void NetLoader::SAXPass (  const char *    filename,
int    pass
)  [protected]
 

Loading is done in 2 passes: in the first pass we instantiate all layers and neurons. In the second we connect them.

void NetLoader::SAXStartElement1 (  const char *    name,
const char **    attrs
) 
 

a SAX callback - don't use this function

void NetLoader::SAXStartElement2 (  const char *    name,
const char **    attrs
) 
 

a SAX callback - don't use this function

void NetLoader::WriteSynapses (  FILE *    netFile,
Neuron *    preNrn
)  [protected]
 

put the weights into the DOM tree


Member Data Documentation

Network* NetLoader::net [protected]
 

The network object we're working on

hash_map<const char*, NeuronFactoryBase*, hash<const char*>, eqstr > NetLoader::registry [protected]
 

all known NeuronFactorys get registered here. The registry can hold unknown factories regiestered by the user's application


The documentation for this class was generated from the following file:
Generated on Wed Sep 4 02:30:36 2002 for Amygdala by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002