TarzaNN
TarzaNN neural network simulator
C:/Users/albertlr/projects/TarzaNN/TarzaNN/NetworkParser.h
Go to the documentation of this file.
00001 //Added by qt3to4:
00002 #include <QLinkedList>
00003 #ifndef NETWORKPARSER_H_INCLUDED
00004 #define NETWORKPARSER_H_INCLUDED
00005 
00006 class NodeAbstract;
00007 class FPInput; // Just a convenient pairing of filter and feature-plane
00008 
00009 #define XML_DEF_FILE "cfg/definitions.xml"
00010 
00011 typedef vector<FeaturePlaneAbstract*> FPList;
00012 typedef QPair<QString, QString> SPair;
00013 typedef QLinkedList<SPair> PairList;
00014 typedef QMap<QString, FeaturePlaneAbstract*> FPMap;
00015 
00018 class NetworkParser{
00019 public:
00020         NetworkParser(Network* NN);
00021         ~NetworkParser();
00022         
00023         int parse(const char *xmlFile);
00024         void dumpNodes();
00025         
00026 private:
00027         Network* nn;
00028         //methods
00029         char *getCDATA(QDomNode e);
00030         char *getNamedAttr(QDomElement e, char *name);
00031         QString getCDATAQS(QDomNode e);
00032         QString lnn_file;
00033 
00034         Filter *parseSpatialBiasAttrib(QDomNode node);
00035         void parseNetwork(QDomNode node);
00036         void parseNN(QDomNode node);
00037         void parseNodes(QDomNode node);
00038         void parseLayersForFPs(QDomNode node);
00039     void parseLayersForConnections(QDomNode node);
00040     FeaturePlaneAbstract* parseLElems(QDomNode node, int layer);
00041         void reparseLElems(QDomNode node);
00042         void parseFpInput(QDomElement node, FeaturePlaneAbstract* cur);
00043         void parseFilter(QDomNode node);
00044         void parseFilterOperations(QDomNode node);
00045         Filter* makeFilter();
00046         FeaturePlaneAbstract* parseFpRef(QDomNode node);
00047         
00048         //vars
00049         std::stack<FPList*> layers;
00050         // Also need to keep track of filter parameters in a floatmap just in case they
00051         // are needed for the autolayer.
00052         paramMap svals;
00053         PairList fovals;
00054         
00055         typedef QLinkedList<QString> OperationList;
00056         
00058         vector<FeaturePlaneAbstract*>* fpTable;
00059 
00061     vector<NodeProxy*>* nodeTable;
00062 
00064         FPMap fpMap;
00066         FPNodes fpnodes;
00067         
00069         InputFeaturePlane** ifps;
00070         int ifp_count;
00071 };
00072 
00073 class FPInput{
00074 public:
00075         Filter* filter;
00076         FeaturePlaneAbstract* fpRef;
00077 };
00078 
00079 #endif /*NETWORKPARSER_H_INCLUDED*/
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines